Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions lua/blink/cmp/signature/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,29 @@ function signature.open_with_signature_help(context, signature_help)
sources.get_signature_help_trigger_characters().trigger_characters
)
if active_highlight ~= nil then
-- TODO: nvim 0.11+ returns the start and end line which we should use
local start_col = vim.fn.has('nvim-0.11.0') == 1 and active_highlight[2] or active_highlight[1]
local end_col = vim.fn.has('nvim-0.11.0') == 1 and active_highlight[4] or active_highlight[2]

vim.api.nvim_buf_set_extmark(
signature.win:get_buf(),
require('blink.cmp.config').appearance.highlight_ns,
0,
start_col,
{ end_col = end_col, hl_group = 'BlinkCmpSignatureHelpActiveParameter' }
)
if vim.fn.has('nvim-0.11.0') == 1 then
local start_line = active_highlight[1] - 1
local start_col = active_highlight[2]
local end_line = active_highlight[3] - 1
local end_col = active_highlight[4]
vim.api.nvim_buf_set_extmark(
signature.win:get_buf(),
require('blink.cmp.config').appearance.highlight_ns,
start_line,
start_col,
{ end_line = end_line, end_col = end_col, hl_group = 'BlinkCmpSignatureHelpActiveParameter' }
)
else
local start_col = active_highlight[1]
local end_col = active_highlight[2]
vim.api.nvim_buf_set_extmark(
signature.win:get_buf(),
require('blink.cmp.config').appearance.highlight_ns,
0,
start_col,
{ end_col = end_col, hl_group = 'BlinkCmpSignatureHelpActiveParameter' }
)
end
end

signature.win:open()
Expand Down