Giter Site home page Giter Site logo

Comments (7)

debugloop avatar debugloop commented on June 3, 2024

Not sure how that would happen, this plugin uses the complete :undolist. Can you compare the output of that with what your seeing on both plugins? Are the state numbers in telescope-undo continuous and without gaps too?

Also, I'm going to need a reproducible case where the two diverge. Can you provide a series of inputs to conjure a file? I.e. iline one<esc>oline two<esc>yypA1<esc>...

However, I can't imagine how this happens, as both plugins use the undolist built in and just render that.

from telescope-undo.nvim.

soer9459 avatar soer9459 commented on June 3, 2024

Took some screenshots.

Heres the last state in undotree and telescopeundo compared:
Screenshot 2024-03-31 at 08 51 04

It seems that all states appear, but they dont appear in correct order on telescopeundo. I'm assuming this is due to the ascending sort order in my ts config that screws with the branch alignment
Screenshot 2024-03-31 at 08 52 31

from telescope-undo.nvim.

soer9459 avatar soer9459 commented on June 3, 2024

I can reproduce by creating a new file, and inputting "hello" in the first line.
I then yank the line and paste over and over (~350 times)

Undotree goes to 0, and telescope-undo only goes to 121
Screenshot 2024-03-31 at 09 03 05

from telescope-undo.nvim.

debugloop avatar debugloop commented on June 3, 2024

I'm on vacation and can test it out myself right now. Some further things you can try:

  • At the bottom, your screenshots show that the buffer is not modifiable -> that will lead to telescope-undo exiting without doing anything further. Why is your buffer not modifiable? Maybe this is some strange behaviour from having the undo tree focused?
  • If you have branches, it is correct that you don't have some states in linear order. They should be all accounted for inside a subtree.
  • Did you compare to :undolist as well?
  • Can you find an undostate at position 50 when you do your 350 undostates example? You'd have to sneak in a world in your hello example at one of the early positions that you can search for.
  • Do you have some sort of result limiter as part of your telescope config? It's possible that something like this exists and has been configured. It's not a nvim/telescope default though.

from telescope-undo.nvim.

soer9459 avatar soer9459 commented on June 3, 2024
  • Can you find an undostate at position 50 when you do your 350 undostates example? You'd have to sneak in a world in your hello example at one of the early positions that you can search for.
  • Do you have some sort of result limiter as part of your telescope config? It's possible that something like this exists and has been configured. It's not a nvim/telescope default though.

Arh, yes i can. It is able to find previous states, that otherwise don't show in the list.
It might be relateed to this max list length item:
nvim-telescope/telescope.nvim#2779

Corresponds to about 250 lines as well

Heres the bottom of the list:
Screenshot 2024-03-31 at 09 50 36

And here's after searching for world. States that were previously hidden are now visible:
Screenshot 2024-03-31 at 09 50 41

I don't have anything to limit the list configured in telescope, but that may be the issue then

Heres my config

return {
    'nvim-telescope/telescope.nvim',
    dependencies = {
        'nvim-lua/plenary.nvim',
        'nvim-telescope/telescope-file-browser.nvim',
        'debugloop/telescope-undo.nvim',
        {
            'nvim-telescope/telescope-fzf-native.nvim',
            build = 'make',
        },
    },
    config = function()
        local ts = require('telescope')
        local ts_undo = require('telescope-undo.actions')
        ts.setup {
            defaults = {
                borderchars = { '', '', '', '', '', '', '', '' },
                layout_strategy = 'horizontal',
                sorting_strategy = 'ascending',
                layout_config = {
                    prompt_position = 'top',
                    width = 0.8,
                    height = 0.8,
                    preview_width = 0.5,
                },
            },
            pickers = {
                find_files = {
                    find_command = {
                        'fd',
                        '--type',
                        'f',
                        '-H',
                        '--strip-cwd-prefix',
                    }
                }
            },
            extensions = {
                file_browser = {
                    hijack_netrw = true,
                    hide_parent_dir = true,
                    hidden = {
                        file_browser = false,
                        folder_browser = false,
                    },
                    display_stat = { },
                    mappings = {
                        ['n'] = {
                            ['-'] = ts.extensions.file_browser.actions.goto_parent_dir,
                            ['<BS>'] = ts.extensions.file_browser.actions.goto_parent_dir,
                            -- KEYBIND TO OPEN SELECTED FILES
                        },
                    }
                },
                undo = {
                    mappings = {
                        i = {
                            ['<cr>'] = ts_undo.restore,
                            ['<C-cr>'] = ts_undo.restore,
                            ['<C-y>'] = ts_undo.yank_deletions,
                            ['<C-r>'] = ts_undo.yank_additions,
                        },
                        n = {
                            ['y'] = ts_undo.yank_additions,
                            ['r'] = ts_undo.yank_deletions,
                            ['<cr>'] = ts_undo.restore,
                        },
                    },
                }
            }
        }
        ts.load_extension('file_browser')
        ts.load_extension('fzf')
        ts.load_extension('undo')
    end,
}

from telescope-undo.nvim.

debugloop avatar debugloop commented on June 3, 2024

Seems you found the culprit in that other issue, yes 👍🏻 I read through your config, looking good, nothing out of the ordinary. I assume my nvim would behave the same way if I could check it right now.

Thanks for reporting and thus documenting this here, but I'm going to close this for now until there's something actionable :)

I know once noticed stuff like this can be nagging, but in all honesty: There should not be a scenario where you need more that those 250ish undo states since your last git commit 😅 Especially since searching still works, too ;)

from telescope-undo.nvim.

soer9459 avatar soer9459 commented on June 3, 2024

Seems you found the culprit in that other issue, yes 👍🏻 I read through your config, looking good, nothing out of the ordinary. I assume my nvim would behave the same way if I could check it right now.

Thanks for reporting and thus documenting this here, but I'm going to close this for now until there's something actionable :)

I know once noticed stuff like this can be nagging, but in all honesty: There should not be a scenario where you need more that those 250ish undo states since your last git commit 😅 Especially since searching still works, too ;)

Yes, that seems to be it. I don't think it'll ever be a "real" issue, but sometimes you notice something that nags you anyway,even if irrational :)

Thank you for the quick replies

from telescope-undo.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.