smjonas / inc-rename.nvim

Incremental LSP renaming based on Neovim's command-preview feature.
MIT License
634 stars 8 forks source link

On rename, when the entire name is deleted popup dissapears with `noice.nvim` #56

Open ravsii opened 2 months ago

ravsii commented 2 months ago

https://github.com/smjonas/inc-rename.nvim/assets/5007271/88318a83-236c-41fc-886b-fb6d55091be0

Compared to VSCode, where pressing backspace multiple times doesn't close the popup / discard changes

https://github.com/smjonas/inc-rename.nvim/assets/5007271/50f63a9d-7dbd-4e2d-80a9-3ae6e9f83db9

I'm using latest LazyVim (noice.nvim).

smjonas commented 1 month ago

That seems to be due to the configuration in noice.nvim. In noice.nvim the preset for inc-rename is configured as follows (https://github.com/folke/noice.nvim/blob/448bb9c524a7601035449210838e374a30153172/lua/noice/config/preset.lua#L107-L122):

inc_rename = {
  cmdline = {
    format = {
      IncRename = {
        pattern = "^:%s*IncRename%s+",
        icon = " ",
        conceal = true,
        opts = {
          relative = "cursor",
          size = { min_width = 20 },
          position = { row = -3, col = 0 },
        },
      },
    },
  },
},

Notice the %s+ after IncRename, meaning the window will only be shown if there is at least one space after the command name. Can you try updating your noice configuration to change the pattern to ^:%s*IncRename%s*?