Skip to content

Commit efa02ff

Browse files
committed
fix(ui): make progress bar work again
1 parent a6c8f22 commit efa02ff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lua/lazy/view/text.lua

+7-3
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ function Text:render(buf)
6767

6868
for _, line in ipairs(self._lines) do
6969
local str = (" "):rep(self.padding)
70+
local has_extmark = false
7071

7172
for _, segment in ipairs(line) do
7273
str = str .. segment.str
74+
if type(segment.hl) == "table" then
75+
has_extmark = true
76+
end
7377
end
7478

75-
if str:match("^%s*$") then
79+
if str:match("^%s*$") and not has_extmark then
7680
str = ""
7781
end
7882
table.insert(lines, str)
@@ -97,11 +101,11 @@ function Text:render(buf)
97101

98102
local extmark_col = extmark.col or col
99103
extmark.col = nil
100-
local ok = pcall(vim.api.nvim_buf_set_extmark, buf, Config.ns, l - 1, extmark_col, extmark)
104+
local ok, err = pcall(vim.api.nvim_buf_set_extmark, buf, Config.ns, l - 1, extmark_col, extmark)
101105
if not ok then
102106
Util.error(
103107
"Failed to set extmark. Please report a bug with this info:\n"
104-
.. vim.inspect({ segment = segment, line = line })
108+
.. vim.inspect({ segment = segment, line = line, error = err })
105109
)
106110
end
107111
end

0 commit comments

Comments
 (0)