-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Repro:
Create a fairly long brackets text file and word wrap it. As the word wrapped lines get longer and longer, the ruler gets longer as well. When it get up to 1000 columns long, the typing performance is sluggish. Removing the word wrap makes the type speed faster.
Expected behavior: The typing performance should stay the same whether the document is word wrapped or not.
Proposed solution: In the current code base, the ruler length is based on the longest line length in the document. When word wrap is on, the ruler length should be based on the width of the main editor frame. This will fix this problem in three ways:
First, the ruler will be shorter, which will make the code that updates the ruler length perform better.
Second, the ruler length will be updated on editor resize instead of text change, taking the pressure off of the typing.
Third, I can get rid of the weird word wrap flip workaround I had to use because CodeMirror doesn't define the longest line length in word wrap mode. This workaround is the most likely culprit for the performance problems.
Other Notes:
The fix for this issue depends upon the merging of pull request #4152.