diff --git a/Sources/NeonPlugin/Coordinator.swift b/Sources/NeonPlugin/Coordinator.swift index bb0dafe..e8a4442 100644 --- a/Sources/NeonPlugin/Coordinator.swift +++ b/Sources/NeonPlugin/Coordinator.swift @@ -73,7 +73,8 @@ public class Coordinator { } return tsClient.tokenProvider(with: highlightsQuery) { range, _ in - textContentManager.attributedString(in: NSTextRange(range, provider: textContentManager))?.string + guard range.isEmpty == false else { return nil } + return textContentManager.attributedString(in: NSTextRange(range, provider: textContentManager))?.string } }