Skip to content

Commit

Permalink
fix: virtual text with a hlgroup with background (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser authored Sep 15, 2024
1 parent 6e3c00e commit 7d62bf9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/lsp_signature/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ local function virtual_hint(hint, off_y)
log('virtual text: ', cur_line, 'invalid offset')
return -- no offset found
end
local vt = { pad .. hp .. hint, _LSP_SIG_CFG.hint_scheme }
local vt = {
{ pad },
{ hp .. hint, _LSP_SIG_CFG.hint_scheme },
}
if inline_display then
if type(inline_display) == 'boolean' then
inline_display = 'inline'
Expand All @@ -240,7 +243,7 @@ local function virtual_hint(hint, off_y)
-- this seems eaiser to handle in the code also easy to read
virt_text_pos = inline_display,
-- virt_text_pos = 'right_align',
virt_text = { vt },
virt_text = vt,
hl_mode = 'combine',
ephemeral = false,
-- hl_group = _LSP_SIG_CFG.hint_scheme
Expand All @@ -249,7 +252,7 @@ local function virtual_hint(hint, off_y)
else -- I may deprecated this when nvim 0.10 release
log('virtual text: ', cur_line, show_at, vt)
vim.api.nvim_buf_set_extmark(0, _LSP_SIG_VT_NS, show_at, 0, {
virt_text = { vt },
virt_text = vt,
virt_text_pos = 'eol',
hl_mode = 'combine',
-- virt_lines_above = true,
Expand Down

0 comments on commit 7d62bf9

Please sign in to comment.