Skip to content

Commit 1a8ce40

Browse files
committed
feat: remove the "Erase in Line" ANSI control sequence that *baleia* doesn't handle
1 parent 1af5eea commit 1a8ce40

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lua/neogit/lib/buffer.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ function Buffer:set_ansi_highlights(highlights)
148148
for _, hl in ipairs(highlights) do
149149
local first_line, last_line = unpack(hl)
150150
local text = self:get_lines(first_line, last_line, false)
151+
152+
-- Remove the "Erase in Line" ANSI control sequence that *baleia* doesn't handle
153+
for i, line in ipairs(text) do
154+
line = line:gsub("\27%[0K.*", "")
155+
text[i] = line
156+
end
157+
151158
vim.g.baleia.buf_set_lines(self.handle, first_line, last_line, false, text)
152159
end
153160
end

0 commit comments

Comments
 (0)