Skip to content

Commit 3fe4c75

Browse files
grecodavideSaghen
andauthored
fix: signature help now highlights the right parameter (#297)
* fix: use right version of `convert_signature_help_to_markdown_lines` * use correct version in `vim.version.gt` * fix: check for nvim 0.11 * chore: remove unused context on update position for signature --------- Co-authored-by: Liam Dyer <[email protected]>
1 parent 8e3af0e commit 3fe4c75

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lua/blink/cmp/windows/signature.lua

+9-4
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,24 @@ function signature.open_with_signature_help(context, signature_help)
6363
sources.get_signature_help_trigger_characters().trigger_characters
6464
)
6565
if active_highlight ~= nil then
66+
local start_region = active_highlight[1]
67+
local end_region = active_highlight[2]
68+
if vim.fn.has('nvim-0.11.0') == 1 then
69+
start_region = active_highlight[2]
70+
end_region = active_highlight[4]
71+
end
6672
vim.api.nvim_buf_add_highlight(
6773
signature.win:get_buf(),
6874
require('blink.cmp.config').highlight.ns,
6975
'BlinkCmpSignatureHelpActiveParameter',
7076
0,
71-
active_highlight[1],
72-
active_highlight[2]
77+
start_region,
78+
end_region
7379
)
7480
end
7581

7682
signature.win:open()
77-
signature.update_position(context)
83+
signature.update_position()
7884
end
7985

8086
function signature.close()
@@ -99,7 +105,6 @@ function signature.scroll_down(amount)
99105
vim.api.nvim_win_set_cursor(signature.win:get_win(), { desired_line, 0 })
100106
end
101107

102-
--- @param context blink.cmp.SignatureHelpContext
103108
function signature.update_position()
104109
local win = signature.win
105110
if not win:is_open() then return end

0 commit comments

Comments
 (0)