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

issues with `<c-r>` after the recent update

Open NStefan002 opened this issue 1 year ago • 3 comments

image

Since the recent breaking change, when I try to redo some changes, the prompt opens up in the bottom left corner (see the image) and there are no highlights. This type of prompt has never appeared before.

NStefan002 avatar Sep 30 '24 21:09 NStefan002

The basic functionality and mechanism for undo and redo did not change. I have no idea what triggers this... Are you using any other plugins? Can you try disabling them and see if this persists? Can you also please check if one of your global options triggers this?

tzachar avatar Oct 01 '24 09:10 tzachar

The one strange thing that I found in the short time I was testing this (I deleted all of the plugins I use except oil.nvim and highlight-undo) is the following:

  1. open a folder in neovim (with something like nvim .) - if the file is opened then there are no problems 2.1. if using oil.nvim then I get the prompt from my first comment 2.2. if using netrw then I get this: E81: Using <SID> not in a script context
  2. all of this happens only if highlight-undo is lazy-loaded, but if highlight-undo isn't lazy-loaded then it doesn't work at all (doesn't show highlights) about 50% of the time

This is my config:

return {
    {
        "tzachar/highlight-undo.nvim",
        -- event = "VeryLazy",
        lazy = false,
        opts = {
            duration = 300,
            keymaps = {
                Paste = { disabled = true },
                paste = { disabled = true },
            },
        },
    },
}

Note that I didn't have that much time to test this more thoroughly, it could be another issue.

NStefan002 avatar Oct 01 '24 14:10 NStefan002

@tzachar probably something similar to #28 (I provided a bit more context/info there)

farzadmf avatar Oct 02 '24 13:10 farzadmf

Can you try to load the plugin last, after all other plugins? If you are using lazy.nvim, try loading the plugin using the keys option and see if this persists

tzachar avatar Oct 06 '24 06:10 tzachar

Can you try to load the plugin last, after all other plugins? If you are using lazy.nvim, try loading the plugin using the keys option and see if this persists

I'm sorry for not getting back to you sooner. I tried to load it last and it works as expected.

NStefan002 avatar Oct 09 '24 19:10 NStefan002

Can you be a bit more specific? what did you change? So I can add to the Readme..

tzachar avatar Oct 10 '24 12:10 tzachar

Here is my config (using lazy):

return {
    {
        "tzachar/highlight-undo.nvim",
        keys = { { "u" }, { "<C-r>" } },
        opts = {
            duration = 300,
            keymaps = {
                paste = { disabled = true },
                Paste = { disabled = true },
            },
        },
    },
}

NStefan002 avatar Oct 11 '24 10:10 NStefan002