telescope-undo.nvim icon indicating copy to clipboard operation
telescope-undo.nvim copied to clipboard

Crashes when attempting to use

Open baroldgene opened this issue 1 year ago • 2 comments

Copied the standalone lazy.nvim config and when attempting to run it for the first time I get this error:

msg_show.lua_error Error executing Lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(undo):E438: u_undo: line numbers wrong
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...vim/lazy/telescope-undo.nvim/lua/telescope-undo/init.lua:22: in function '_traverse_undotree'
	...vim/lazy/telescope-undo.nvim/lua/telescope-undo/init.lua:83: in function 'build_undolist'
	...vim/lazy/telescope-undo.nvim/lua/telescope-undo/init.lua:105: in function 'undo'
	...y/telescope-undo.nvim/lua/telescope/_extensions/undo.lua:80: in function <...y/telescope-undo.nvim/lua/telescope/_extensions/undo.lua:72>
	...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
	...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
	...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>

Happy to help troubleshoot but honestly don't know where to start given the error. Here's my lazy config:

  {
    "debugloop/telescope-undo.nvim",
    dependencies = { -- note how they're inverted to above example
      {
        "nvim-telescope/telescope.nvim",
        dependencies = { "nvim-lua/plenary.nvim" },
      },
    },
    keys = {
      { -- lazy style key map
        "<leader>fu",
        "<cmd>Telescope undo<cr>",
        desc = "find undos",
      },
    },
    opts = {
      -- don't use `defaults = { }` here, do this in the main telescope spec
      extensions = {
        undo = {
          -- telescope-undo.nvim config, see below
        },
        -- no other extensions here, they can have their own spec too
      },
    },
    config = function(_, opts)
      -- Calling telescope's setup from multiple specs does not hurt, it will happily merge the
      -- configs for us. We won't use data, as everything is in it's own namespace (telescope
      -- defaults, as well as each extension).
      require("telescope").setup(opts)
      require("telescope").load_extension("undo")
    end,
  },

I also tried the instal variant where it's added directly to the telescope include. No change.

baroldgene avatar Sep 30 '24 07:09 baroldgene

This seems to work on code files but breaks on my markdown files within Obsidian. Maybe some sort of conflict there?

baroldgene avatar Sep 30 '24 07:09 baroldgene

Same issue as here: https://github.com/debugloop/telescope-undo.nvim/issues/59

I really need to get around to implement the suggestion made over there, sorry about the inconvenience, I'll handle it later this week 👍🏻

debugloop avatar Sep 30 '24 07:09 debugloop