-
Kai Willadsen authored
We're trying to address multiple issues at once here. The primary one is that GtkTextView has issues with rendering very long lines, in a way that causes what are effectively hangs. Meld would also have issues with highlighting such lines, but we already have guard rails in place for that. The solution here is that we have just defined a maximum sensible line length - 8K, which is quite generous - and we will cancel opening any file with lines longer than that. While this doesn't directly address loading binary files, it should indirectly stop them from being an issue. The code that we've got does rely on us getting the loading callback often enough that we think the text view won't have gotten a line that's *too* much longer than our limit between callbacks, but currently that's tied to an 8K read size which seems like it's going to be fine for our purposes.