Skip to content

Fix performance issue with draw-spaces tags and long lines

The iteration logic for drawing spaces doesn't take into account the last line in the file, such that the last line always iterates across the entire length of the line, performing expensive GtkTextIter operations, even though it's already progressed past the end of the visible line. This causes problems on files with very long lines as the last line in the file, which is common on e.g., normal UTF-8 that's been incorrectly decoded as UTF-16.

The fix here just checks to see whether the forward-to-next-line case actually forwards to a new line.

I haven't tested this against master at this point; Meld can't use it because we make use of GtkSourceFileLoader, etc.

Merge request reports

Loading