fix(lint): make neovim 0.11 typecheck happy (#1844)

This commit is contained in:
yetone
2025-04-10 14:14:47 +08:00
committed by GitHub
parent 04336913b3
commit 7e31317fbc
9 changed files with 38 additions and 10 deletions

View File

@@ -23,7 +23,9 @@ function M:set_highlights(ns_id, bufnr, line, offset)
local text = section[1]
local highlight = section[2]
if type(highlight) == "function" then highlight = highlight() end
if highlight then vim.api.nvim_buf_add_highlight(bufnr, ns_id, highlight, line, col_start, col_start + #text) end
if highlight then
vim.highlight.range(bufnr, ns_id, highlight, { line, col_start }, { line, col_start + #text })
end
col_start = col_start + #text
end
end