Skip to content

Commit 89040e3

Browse files
Rejudge-Fzhangfeng.z
andauthored
fix(beacon): fix beacon highlight conflict with virtual text display (#1547)
Co-authored-by: zhangfeng.z <[email protected]>
1 parent 920b125 commit 89040e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/lspsaga/definition.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ function def:apply_maps(bufnr)
106106
end
107107
api.nvim_win_set_cursor(0, pos)
108108
local width = #api.nvim_get_current_line()
109-
beacon({ pos[1] - 1, vim.fn.col('.') }, width)
109+
local col_pos = vim.fn.col('.')
110+
beacon({ pos[1] - 1, col_pos }, width - col_pos)
110111
end)
111112
else
112113
util.map_keys(bufnr, map, function()
@@ -318,7 +319,8 @@ function def:goto_handler(result, context, args)
318319
lsp.util._get_line_byte_from_position(target_bufnr, range.start, client.offset_encoding),
319320
})
320321
local width = #api.nvim_get_current_line()
321-
beacon({ range.start.line, vim.fn.col('.') }, width)
322+
local col_pos = vim.fn.col('.')
323+
beacon({ range.start.line, col_pos }, width - col_pos)
322324
end
323325

324326
function def:init(method, jump_T, args)

0 commit comments

Comments
 (0)