Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fnune opened this issue May 21, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@fnune
Copy link

fnune commented May 21, 2023

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?

@fnune fnune changed the title [feat] Support modes other than insert [feat] Support modes other than insert for input_buffer_type = "dressing" May 21, 2023
@smjonas smjonas added the enhancement New feature or request label May 22, 2023
@smjonas
Copy link
Owner

smjonas commented Jun 9, 2023

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

  • the dressing window is opened with a "fake cursor" (i.e. I just put a highlight in the dressing buffer)
  • the real cursor still stays in the command line because the preview of the LSP renaming must take place from command line mode due to the way cmd-preview works in Neovim

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants