Piturnah / gex

Git Explorer: cross-platform git workflow improvement tool inspired by Magit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line wrapping breaks the scrolling + non-ANSI truncation

Piturnah opened this issue · comments

We can now scroll (yay) but there is a problem with line wrap which is that it messes up all the calculations for the viewable window. Currently (I am about to push the commit) we allow configuring gex such that lines are truncated instead (but this only works with ANSI). Also, the truncation is slow because we have to create a whole VTE state machine.

It is to do with the escape codes used for coloring and cursor manipulation and etc that it is not straightforward at all to implement the line wrap. I have tried many ways of doing it. Also, it's made more difficult by the fact that we aren't always using ANSI codes (I think - this part is handled by Crossterm, so I still need to investigate).

Proposed Solution

Refactor so all the styling is done in the renderer itself. This way we can delay the painting until after the viewable window is already determined. This should be a bit faster, too.