Closed theSafdarAwan closed 2 years ago
This also happens to me randomly, but also the signature popup is visible. I'm here in normal mode, cursor is just not visible on screenshot:
I'm just not sure how to reproduce it 100%.
Some additional info:
I'm getting this too frequently. Enough for it to be very annoying.
Running nvim-cmp
.
I'd love to help debug and solve this, just ping what information you need.
I would suspect it is a issue that InsertLeave event was not trigger/missed. But not sure is it a defect from neovim or from the plugin. I am working on code cleanup this week. And will back to this once I finished.
This also happens to me randomly, but also the signature popup is visible
This happens to me (every time) whenever I open a function parenthesis and leave insert mode before the signature popup shows.
The pop will get stuck and the only two ways to close it is to enter insert mode again inside the parenthesis and exit or to call lua vim.lsp.buf.signature_help()
.
I'm also using nvim-cmp
and lspconfig
.
Please, let me know if I can help with more info for debugging or anything else, really. :)
EDIT
Included a gif, for clarity.
It shows the preview window being opened after exiting insert mode and getting stuck, not closing on CursorMoved
.
At the end of the gif I issue a vim.lsp.buf.signature_help()
somewhere else, which closes the pervious window and gets closed on CursorMoved
.
I think it takes so long to open because the python lsp response to the signature query is slow, and maybe the problem is a race condition where the vim.lsp.util.close_preview_autocmd()
callback is called before the actual preview windows get created, so the window reference passed to close_preview_autocmd
second argument is not the correct ref to the window?
Just some thoughts, I haven't studied the code yet.
Maybe that is not the problem at all since the signature hint gets stuck too and it is not a preview window...
btw, my nvim --version
output, if it helps:
nvim --version
NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
Can confirm that I'm still getting this behaviour too.
NVIM v0.6.0-dev+397-gc7a63f35d
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by <me>
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "
/home/linuxbrew/.linuxbrew/Cellar/neovim/HEAD-c7a63f3/share/nvim"
settings:
require("lsp_signature").on_attach({
bind = true, -- This is mandatory, otherwise border config won't get registered.
floating_window = true,
floating_window_above_cur_line = true, -- try to place the floating above the current line
-- floating_window_off_y = 1, -- adjust float windows y position. allow the pum to show a few lines
-- fix_pos = true,
hint_enable = false,
decorator = { "`", "`" },
handler_opts = {
border = "double",
},
})
What is your function signature?
I've noticed this too... When pasting a method in insert mode
-> move cursor to end of method parenthesis
-> ^C
-> :w
.
same here! :(
I did not see this happen for a while. I am using gopls
, tsserver
and pyright
Please check if it goes away by disabling autopair plugins or any similar plugins (or, maybe check my setup ray-x/nvim regarding how to setup autopir).
Please post your language server, your function signature and your lsp_signature config.
Also, a walk around is define the toggle key to toggle the floating window.
sorry i found what was causing it if you use
Had the same problem. Setting inoremap (ctrl+c) to (esc) fixed this for me. Thanks @imSafdarAwan!
<ctrl-c>
will trigger InsertLeave
event on which signature is hooked on. So the plugin has no idea you are not in Normal mode and should close the popup.
Thanks guys I really liked the plugin and was facing the same problem exiting with <ctrl-c>
Sorry. I was doing some refactoring in the last few days. Pushed a change to master. Hope it works.
It seems to work! Thanks!