Sublime Forum

ST3 Word Wrap Bug?

#1

I am running ST3 3083 on Win 10 x64 and encountering the following issue with word wrap of long lines:

First, have a look at the display with word wrap off:


Note that the text has no line breaks, except at the end of lists (i.e., right after ]) and that some lines are too long. That is all as it should be.

Now, have a look at the display of the same file with word wrap on:


This is mostly right, but look at line 1: There is a spurious line-break at column 769. Similarly at line 3, column 513 and line 6, column 257 (that all the column numbers are multiples of 256 plus one is probably significant).

Having–in the long-ago-time–written a text editor or two, I seem to recall that there is an issue with rendering word-wrap for extremely long lines. Think of rendering, in word-wrap, the end of a file consisting out of a single million-character line. Unless you do something clever, your algorithm will end up having to effectively render the enter file, rather than just a screen, and that will crawl. Perhaps this word-wrap issue is related to a hack to work around that same problem?

0 Likes