mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 07:24:52 +01:00
fix: dont use RowCol anymore
its tables all the way down...
This commit is contained in:
parent
9b6739b167
commit
9780059f90
1 changed files with 11 additions and 11 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue