mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(lsp): update window title when cycling through signatures #35407
(cherry picked from commit 848c7a7894
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
fa64f2d09b
commit
1bea812953
@@ -352,6 +352,7 @@ function M.signature_help(config)
|
|||||||
|
|
||||||
config = config and vim.deepcopy(config) or {}
|
config = config and vim.deepcopy(config) or {}
|
||||||
config.focus_id = method
|
config.focus_id = method
|
||||||
|
local user_title = config.title
|
||||||
|
|
||||||
lsp.buf_request_all(0, method, client_positional_params(), function(results, ctx)
|
lsp.buf_request_all(0, method, client_positional_params(), function(results, ctx)
|
||||||
if api.nvim_get_current_buf() ~= ctx.bufnr then
|
if api.nvim_get_current_buf() ~= ctx.bufnr then
|
||||||
@@ -391,7 +392,7 @@ function M.signature_help(config)
|
|||||||
local sfx = total > 1
|
local sfx = total > 1
|
||||||
and string.format(' (%d/%d)%s', idx, total, can_cycle and ' (<C-s> to cycle)' or '')
|
and string.format(' (%d/%d)%s', idx, total, can_cycle and ' (<C-s> to cycle)' or '')
|
||||||
or ''
|
or ''
|
||||||
config.title = config.title or string.format('Signature Help: %s%s', client.name, sfx)
|
config.title = user_title or string.format('Signature Help: %s%s', client.name, sfx)
|
||||||
-- If no border is set, render title inside the window.
|
-- If no border is set, render title inside the window.
|
||||||
if not (config.border or vim.o.winborder ~= '') then
|
if not (config.border or vim.o.winborder ~= '') then
|
||||||
table.insert(lines, 1, '# ' .. config.title)
|
table.insert(lines, 1, '# ' .. config.title)
|
||||||
|
Reference in New Issue
Block a user