Skip to content

Commit

Permalink
feat: remove the "Erase in Line" ANSI control sequence that *baleia* …
Browse files Browse the repository at this point in the history
…doesn't handle
  • Loading branch information
stevenxxiu committed Dec 18, 2024
1 parent 1af5eea commit 1a8ce40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/neogit/lib/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ function Buffer:set_ansi_highlights(highlights)
for _, hl in ipairs(highlights) do
local first_line, last_line = unpack(hl)
local text = self:get_lines(first_line, last_line, false)

-- Remove the "Erase in Line" ANSI control sequence that *baleia* doesn't handle
for i, line in ipairs(text) do
line = line:gsub("\27%[0K.*", "")
text[i] = line
end

vim.g.baleia.buf_set_lines(self.handle, first_line, last_line, false, text)
end
end
Expand Down

0 comments on commit 1a8ce40

Please sign in to comment.