smjonas / inc-rename.nvim

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

feat!: better preview window with inccommand=split #25

Closed smjonas closed 1 year ago

smjonas commented 1 year ago

Closes #19.

Breaking change for users that use an old Nvim 0.8 nightly version that does not have vim.defaulttable yet.

@pidgeon777 Please try out this PR. This preview window will be shown when you :set inccommand=split. Do you think the relatively low height of the window is fine (7 lines for me, idk if it varies)? (I might be able to change the height after the preview buffer was created)

Here is how it looks like for me: inc_rename_preview

pidgeon777 commented 1 year ago

I just tested it, seems to be a significant improvement than before.

I would increase the preview window height, even better in two ways:

smjonas commented 1 year ago

Thanks a lot for testing this! I have not found a way to increase the height of the preview window yet (in fact I can't even get the preview window handle) so I will go ahead and merge this soon and improve it later. I've asked for help on the Nvim matrix server though.

smjonas commented 1 year ago

I would increase the preview window height

I was told by famiu that apparently this is not currently possible.

pidgeon777 commented 1 year ago

Let's hope one day it will be available as a feature, then 🤞.

GitMurf commented 1 month ago

I would increase the preview window height

I was told by famiu that apparently this is not currently possible.

Is it still not possible change increase the height of the preview window? I figured the option previewheight was exactly what I needed but I cannot get it to change anything! 😢 Any luck from anyone else?

GitMurf commented 1 month ago

Oh wow @pidgeon777 @smjonas ... I finally stumbled upon the correct answer! It is not previewheight that controls inccommand preview window size. It is actually the cmdwinheight which is the same window you can navigate through your cmdline history in.

Here is the brief reference to it: https://neovim.io/doc/user/options.html#'cmdwinheight'

And simply need to do set cmdwinheight=20 for example.

smjonas commented 1 month ago

Thanks for letting us know, I didn't know that! This could be useful to add to the readme