From 478f5d00702ea88d9e9f48382fae07fe0eacdcac Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Sat, 26 Apr 2025 15:46:38 +0800 Subject: [PATCH] fix(lsp): cycling signatures with the default `config.focusable` (cherry picked from commit 342974773c5335ea9a09f50b8d10c2f9c506f9e5) --- runtime/lua/vim/lsp/buf.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 6d168cacb3..ee8fd4b452 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -370,7 +370,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 can_cycle = total > 1 and config.focusable ~= false local idx = active_signature - 1 --- @param update_win? integer @@ -386,7 +386,9 @@ function M.signature_help(config) return end - local sfx = can_cycle and string.format(' (%d/%d) ( to cycle)', idx, total) or '' + local sfx = total > 1 + and string.format(' (%d/%d)%s', idx, total, can_cycle and ' ( to cycle)' or '') + or '' local title = string.format('Signature Help: %s%s', client.name, sfx) if config.border then config.title = title