RishabhRD / nvim-lsputils

Better defaults for nvim-lsp actions
456 stars 19 forks source link

Go to location in preview windows #5

Closed tzachar closed 4 years ago

tzachar commented 4 years ago

Hi.

This is more a request than an issue. Is it possible, when inside the preview windows (for example in References), to jump to the currently displayed file in the main windows? Something which resembles a quickfix list.

10x

RishabhRD commented 4 years ago

I identified the bug maybe. But let me just ensure if you are asking same thing. If there are 2 splits open and I called goto definition in second split instead of first so after selecting option it opens the definition in first split instead of second. Is this the bug you are talking about. If not please attach the gif. Till then I am labelling the issue as bug.

tzachar commented 4 years ago

Attaching a GIF. Pressing while in the bottom split has no effect. I would expect it to open the file under the cursor. Note that I can replace the lower split if I use 'gf' while the cursor is on the file name (not shown in the GIF). Peek 2020-09-23 13-55

tzachar commented 4 years ago

Ok, after digging some more it looks like one of my settings interferes with this plugin. Investigating further.

RishabhRD commented 4 years ago

I just checked with my configurations, when I have selected some option and I press enter() on it so, it goes to that file without any problem and 'gf' works fine. If the settings you are talking about is a necessary one for many users then please post it, so that we can make it immune to that.

tzachar commented 4 years ago

ok, found the problem. its a strange one.

I have the following defined:

nnoremap ; :                                                                                                                        
nnoremap : ;                                                                                                                     
 vnoremap ; :                                                                                                                        
vnoremap : ; 

if I comment the "nnoremap : ; " everything works as expected. I have no idea why.

RishabhRD commented 4 years ago

Ok I will need to check it out. Because it's strange. In plugin, I have not mapped ';' or ':' to something or even anything related to that. This is an unexpected behaviour and hence surely needs to be fixed. Thanks for reporting.

tzachar commented 4 years ago

I wonder if you can replicate by defining the same mappings?

RishabhRD commented 4 years ago

Yes I was able to replicate it. It has same behaviour. Somehow not only \<CR> also \<ESC> is not working. That means the mappings are not being set maybe or those functions are failing.

tzachar commented 4 years ago

Very strange. Maybe you are sending commands using emulated keypresses?

RishabhRD commented 4 years ago

I am using vim.api.nvim_buf_set_keymap() lua function for setting keymaps. That should work fine I guess. I used \<cmd> for emulating for command line mode instead of ':' . However, it doesn't seem to work well.

RishabhRD commented 4 years ago

Try updating the plugins(popfix and nvim-lsputils). It should work properly. I mistakenly used ':' instead of \<cmd> in one line (contradicting my above comment also😅). That was causing the bug.

tzachar commented 4 years ago

Yeah. Work flawlessly now. 10x.

RishabhRD commented 4 years ago

Glad it works. Thanks for reporting. Closing issue then. Any other issue/request please report it.