mirror of https://github.com/folke/lazy.nvim.git
fix(ui): make progress bar work again
This commit is contained in:
parent
a6c8f22362
commit
efa02ff8d3
|
@ -67,12 +67,16 @@ function Text:render(buf)
|
||||||
|
|
||||||
for _, line in ipairs(self._lines) do
|
for _, line in ipairs(self._lines) do
|
||||||
local str = (" "):rep(self.padding)
|
local str = (" "):rep(self.padding)
|
||||||
|
local has_extmark = false
|
||||||
|
|
||||||
for _, segment in ipairs(line) do
|
for _, segment in ipairs(line) do
|
||||||
str = str .. segment.str
|
str = str .. segment.str
|
||||||
|
if type(segment.hl) == "table" then
|
||||||
|
has_extmark = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if str:match("^%s*$") then
|
if str:match("^%s*$") and not has_extmark then
|
||||||
str = ""
|
str = ""
|
||||||
end
|
end
|
||||||
table.insert(lines, str)
|
table.insert(lines, str)
|
||||||
|
@ -97,11 +101,11 @@ function Text:render(buf)
|
||||||
|
|
||||||
local extmark_col = extmark.col or col
|
local extmark_col = extmark.col or col
|
||||||
extmark.col = nil
|
extmark.col = nil
|
||||||
local ok = pcall(vim.api.nvim_buf_set_extmark, buf, Config.ns, l - 1, extmark_col, extmark)
|
local ok, err = pcall(vim.api.nvim_buf_set_extmark, buf, Config.ns, l - 1, extmark_col, extmark)
|
||||||
if not ok then
|
if not ok then
|
||||||
Util.error(
|
Util.error(
|
||||||
"Failed to set extmark. Please report a bug with this info:\n"
|
"Failed to set extmark. Please report a bug with this info:\n"
|
||||||
.. vim.inspect({ segment = segment, line = line })
|
.. vim.inspect({ segment = segment, line = line, error = err })
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue