smjonas / inc-rename.nvim

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

[feat] Support modes other than insert for input_buffer_type = "dressing" #36

Open fnune opened 1 year ago

fnune commented 1 year ago

Here's my setup using lazy.nvim:

  {
    "smjonas/inc-rename.nvim",
    dependencies = { "stevearc/dressing.nvim" },
    config = function()
      local inc_rename = require("inc_rename")
      inc_rename.setup({ input_buffer_type = "dressing" })

      vim.keymap.set("n", "<leader>rn", function()
        return ":IncRename " .. vim.fn.expand("<cword>")
      end, { expr = true })
    end,
  },

inc-rename.nvim works just fine. However, I like to use dressing with these settings:

input = { insert_only = false }

(see the dressing README)

It seems like dressing's settings are ignored by inc-rename.nvim. When I press escape, the prompt just exits.

Could inc-rename.nvim inherit from the configuration passed to dressing's setup function? Or perhaps support passing an independent set of options?

smjonas commented 1 year ago

Unfortunately, adding support for insert_only is currently not possible to implement. Support for dressing.nvim is implemented as follows:

So a setting like insert_only does not make sense because you are not actually moving around in the dressing window. You can, however, override settings globally using dressing's setup function as shown in the readme. I hope that clears things up!