You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When appending text to the end of a file the highlighter doesn't apply fonts. If you resize the window or scroll away it will apply the fonts. After some investigation it looks like the visibleSet isn't being updated with new characters, so new characters are being removed from any actionable sets when highlights are being applied.
An easy fix would be to recalculate the visible set every edit, but that would be quite inefficient. A possible solution may be to check whether an edit is being applied to the end of the visible set, and if it's exactly on the end extend the visible set.
To Reproduce
Open a blank code file (or one you can see the bottom of without scrolling)
Type some code, you'll notice there's no fonts/colors being applied.
Expected behavior
Should apply fonts/colors to edits made at the end of the file.
This video shows the issue. I deleted exactly 5 characters from the file (4 lines and a tab) before typing this. So the visible set originally included the class text. After that the visible set no longer contains the edited indices.
Description
When appending text to the end of a file the highlighter doesn't apply fonts. If you resize the window or scroll away it will apply the fonts. After some investigation it looks like the
visibleSetisn't being updated with new characters, so new characters are being removed from any actionable sets when highlights are being applied.An easy fix would be to recalculate the visible set every edit, but that would be quite inefficient. A possible solution may be to check whether an edit is being applied to the end of the visible set, and if it's exactly on the end extend the visible set.
To Reproduce
Expected behavior
Should apply fonts/colors to edits made at the end of the file.
Version information
CodeEditTextView: [main]
macOS: [e.g. 13.2]
Xcode: [e.g. 14.2]
Additional context
Screen.Recording.2023-02-14.at.8.07.12.PM.mov
This video shows the issue. I deleted exactly 5 characters from the file (4 lines and a tab) before typing this. So the visible set originally included the
classtext. After that the visible set no longer contains the edited indices.