Skip to content

Commit cec1cee

Browse files
committed
fix(chunk): handle potential error in virtcol function in Neovim 0.10
1 parent 6098f39 commit cec1cee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/tiny-inline-diagnostic/chunk.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ function M.get_chunks(opts, diags_on_line, diag_index, diag_line, cursor_line, b
259259
if need_to_be_under then
260260
offset = 0
261261
else
262-
local win_col = vim.fn.virtcol("$")
262+
local ok, win_col = pcall(vim.fn.virtcol, "$")
263+
if not ok then
264+
win_col = 0
265+
end
266+
263267
offset = win_col
264268
end
265269

0 commit comments

Comments
 (0)