nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.45k stars 287 forks source link

`peek_definition` mappings are broken (again)? #1033

Closed farzadmf closed 1 year ago

farzadmf commented 1 year ago

Describe the bug

Hi, I just did the usual update of my plugins, and now my bindings for peek_definition window don't work anymore; there was no change in my config.

The responsible commit seems to be commit b8d210f, since if I go back to the commit before that, things work as expected.

My config:

beacon = {
  enable = true,
  frequency = 16,
},
definition = {
  edit = '<C-c><cr>',
  quit = 'q',
  split = '<C-c><C-x>',
  tabe = '<C-c><C-t>',
  vsplit = '<C-c><C-v>',
},
finder = {
  keys = {
    expand_or_jump = '<C-c><cr>',
    vsplit = '<C-c><C-v>',
    split = '<C-c><C-x>',
    tabe = '<C-c><C-t>',
    quit = { 'q', '<ESC>' },
    close_in_preview = '<ESC>',
  },
},
outline = {
  win_width = 60,
  preview_width = 0.5,
  keys = { -- defaults; for reference
    expand_or_jump = 'o',
    quit = 'q',
  },
},
ui = {
  border = 'rounded',
},

Steps to reproduce

  1. Update lspsaga to the latest version
  2. Open a peek_definition window
  3. Try to use your custom keybindings and they don't work

Expected behavior

I expect my configured keybindings to work as before.

Can we please have some tests for this as it keeps braking. I REALLY, really like this plugin, but it's hard to troubleshoot things every time there's an update.

Neovim version (nvim -v)

0.9.0

lspsaga commit

83d78e2

Terminal name/version

wezterm 20230408-112425-69ae8472

glepnir commented 1 year ago

hmm which key not work ? it works fine in test. before commit just delete map when window close

farzadmf commented 1 year ago

I tried <C-c><cr> (open) and <C-c><C-v> (vertical split) and none of them seemed to work

glepnir commented 1 year ago

sry I can't reproduce it . works fine in my test .

glepnir commented 1 year ago

open peek_window then :verb nmap <C-c><CR>

farzadmf commented 1 year ago

sry I can't reproduce it . works fine in my test .

Sad šŸ™

open peek_window then :verb nmap <C-c><CR>

It gives no mapping found for some reason. Even if I do :verb nmap q it shows that it's bound to record macro

glepnir commented 1 year ago

that mean map has been deleted or not create but before commit just delete it on WinClosed callback. so you just open it. it should works fine.

test

farzadmf commented 1 year ago

True, but why do you think it works as before if I go back to a commit before the "delete commit"?

I would suspect other thing interfering with it, but things are fine before that commit šŸ¤”

glepnir commented 1 year ago

because that commit just do delete map when window close. you opened window then do verb command then the map not mapped to lspsaga .so it's wired. and a test on my local like gif it works fine. so idk . another tip is the definition is refactored in next version. The current implementation has some confusion.

farzadmf commented 1 year ago

the definition is refactored in next version

So, I guess that's not live yet, is it?

farzadmf commented 1 year ago

@glepnir I tried the following:

https://gist.github.com/farzadmf/3f922d8ec7aaafe09854763b060b7649

And it seems to solve the issue. Didn't create a PR since I'm not totally sure if that's the right fix, but let me know what you think

AngelontheRoad commented 1 year ago

I had the same question. What's interesting is that the same config and Neovim version I use in both Windows and WSL but Windows works properly but WSL not.

briskajanis1 commented 1 year ago

I'm having the same issue. After update my keybindings don't seem to work.

farzadmf commented 1 year ago

@glepnir Seems like 2 other people have confirmed the same issue (and that the change works for them). I'm going to create a PR for it