diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-12-29 07:35:57 -0800 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-12-29 16:23:23 +0000 |
commit | 02097e43c8cf33b4302717a489d322ac47fa15c2 (patch) | |
tree | 66d8c7f0641ea773a56e313e167c7d6d2e9b4402 /runtime/lua/vim/lsp/buf.lua | |
parent | 0e880b5612b0dece2863c70ee608971726ec5f2c (diff) | |
download | rneovim-02097e43c8cf33b4302717a489d322ac47fa15c2.tar.gz rneovim-02097e43c8cf33b4302717a489d322ac47fa15c2.tar.bz2 rneovim-02097e43c8cf33b4302717a489d322ac47fa15c2.zip |
fix(lsp): check if sig_help window is focusable when configuring cycle keymap
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r-- | runtime/lua/vim/lsp/buf.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 1926a0228d..69407bc6f8 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -329,7 +329,6 @@ local sig_help_ns = api.nvim_create_namespace('vim_lsp_signature_help') --- @class vim.lsp.buf.signature_help.Opts : vim.lsp.util.open_floating_preview.Opts --- @field silent? boolean --- TODO(lewis6991): support multiple clients --- Displays signature information about the symbol under the cursor in a --- floating window. --- @param config? vim.lsp.buf.signature_help.Opts @@ -356,6 +355,7 @@ function M.signature_help(config) local ft = vim.bo[ctx.bufnr].filetype local total = #signatures + local can_cycle = total > 1 and config.focusable local idx = 0 --- @param update_win? integer @@ -371,7 +371,7 @@ function M.signature_help(config) return end - local sfx = total > 1 and string.format(' (%d/%d) (<C-s> to cycle)', idx, total) or '' + local sfx = can_cycle and string.format(' (%d/%d) (<C-s> to cycle)', idx, total) or '' local title = string.format('Signature Help: %s%s', client.name, sfx) if config.border then config.title = title @@ -402,7 +402,7 @@ function M.signature_help(config) local fbuf, fwin = show_signature() - if total > 1 then + if can_cycle then vim.keymap.set('n', '<C-s>', function() show_signature(fwin) end, { |