mirror of https://github.com/folke/lazy.nvim.git
fix(ui): don' render extmarks for empty lines
This commit is contained in:
parent
ceb413678d
commit
dbe0e29d85
|
@ -82,13 +82,14 @@ function Text:render(buf)
|
||||||
vim.api.nvim_buf_clear_namespace(buf, Config.ns, 0, -1)
|
vim.api.nvim_buf_clear_namespace(buf, Config.ns, 0, -1)
|
||||||
|
|
||||||
for l, line in ipairs(self._lines) do
|
for l, line in ipairs(self._lines) do
|
||||||
|
if lines[l] ~= "" then
|
||||||
local col = self.padding
|
local col = self.padding
|
||||||
|
|
||||||
for _, segment in ipairs(line) do
|
for _, segment in ipairs(line) do
|
||||||
local width = vim.fn.strlen(segment.str)
|
local width = vim.fn.strlen(segment.str)
|
||||||
|
|
||||||
local extmark = segment.hl
|
local extmark = segment.hl
|
||||||
if extmark and width > 0 then
|
if extmark then
|
||||||
if type(extmark) == "string" then
|
if type(extmark) == "string" then
|
||||||
extmark = { hl_group = extmark, end_col = col + width }
|
extmark = { hl_group = extmark, end_col = col + width }
|
||||||
end
|
end
|
||||||
|
@ -109,6 +110,7 @@ function Text:render(buf)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@param patterns table<string,string>
|
---@param patterns table<string,string>
|
||||||
function Text:highlight(patterns)
|
function Text:highlight(patterns)
|
||||||
|
|
Loading…
Reference in New Issue