Skip to content

Commit 46c7a01

Browse files
author
Zachary Lineman
committed
Fixed an issue where changing from a larger text to a smaller text would crash the editor.
Signed-off-by: Zachary Lineman <zachary.lineman@gmail.com>
1 parent c546bad commit 46c7a01

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/Highlighter/Data/Languages.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let jellyLanguage: [String: Any] = [
9090
"multi_comment": [
9191
"regex": "/\\*.*?\\*/",
9292
"group": 0,
93-
"relevance": 4,
93+
"relevance": 7,
9494
"options": [NSRegularExpression.Options.dotMatchesLineSeparators],
9595
"multiline": true
9696
]

Sources/Views/FireflySyntaxView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class FireflySyntaxView: FireflyView {
3232
}
3333
set(nText) {
3434
textView.text = nText
35+
textStorage.cachedTokens.removeAll()
3536
textStorage.highlight(NSRange(location: 0, length: textStorage.string.utf16.count), cursorRange: nil)
3637
if dynamicGutterWidth {
3738
updateGutterWidth()

0 commit comments

Comments
 (0)