fix: dont use RowCol anymore

its tables all the way down...
This commit is contained in:
əlemi 2024-09-16 20:19:56 +02:00
parent 9b6739b167
commit 9780059f90
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -167,18 +167,18 @@ end
---@param buf integer buffer to highlight onto ---@param buf integer buffer to highlight onto
---@param ns integer namespace for highlight ---@param ns integer namespace for highlight
---@param group string highlight group ---@param group string highlight group
---@param start RowCol ---@param start [integer, integer]
---@param fini RowCol ---@param fini [integer, integer]
local function multiline_highlight(buf, ns, group, start, fini) local function multiline_highlight(buf, ns, group, start, fini)
for i=start.row,fini.row do for i=start[1],fini[1] do
if i == start.row and i == fini.row then if i == start[1] and i == fini[1] then
local fini_col = fini.col local fini_col = fini[2]
if start.col == fini.col then fini_col = fini_col + 1 end if start[2] == fini[2] then fini_col = fini_col + 1 end
vim.api.nvim_buf_add_highlight(buf, ns, group, i, start.col, fini_col) vim.api.nvim_buf_add_highlight(buf, ns, group, i, start[2], fini_col)
elseif i == start.row then elseif i == start[1] then
vim.api.nvim_buf_add_highlight(buf, ns, group, i, start.col, -1) vim.api.nvim_buf_add_highlight(buf, ns, group, i, start[2], -1)
elseif i == fini.row then elseif i == fini[1] then
vim.api.nvim_buf_add_highlight(buf, ns, group, i, 0, fini.col) vim.api.nvim_buf_add_highlight(buf, ns, group, i, 0, fini[2])
else else
vim.api.nvim_buf_add_highlight(buf, ns, group, i, 0, -1) vim.api.nvim_buf_add_highlight(buf, ns, group, i, 0, -1)
end end