@@ -327,7 +327,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager
327327 if (self.searchResults .count ) {
328328
329329 NSRange closestRange = NSMakeRange (self.textView .string .length , 0 );
330- for (NSDictionary *searchResultDictionary in self.searchResults ) {
330+ for (NSDictionary *searchResultDictionary in self.searchResults . copy ) {
331331 NSRange range = [searchResultDictionary[kAnnotationRangeKey ] rangeValue ];
332332
333333 if (NSLocationInRange (charIndex, range)) {
@@ -754,27 +754,25 @@ - (void)delayedInvalidateMinimap
754754
755755- (void )invalidateMinimap
756756{
757- void (^performFullRangeInvalidation )() = ^{
757+ void (^performRangeInvalidation )() = ^{
758758
759759 self.shouldAllowFullSyntaxHighlight = YES ;
760760
761- NSRange fullTextRange = NSMakeRange (0 , self.textView .string .length );
762-
763- [self .textView.layoutManager invalidateDisplayForCharacterRange: fullTextRange];
761+ [self .textView.layoutManager invalidateDisplayForCharacterRange: [self .textView visibleCharacterRange ]];
764762
765763 BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults ] objectForKey: SCXcodeMinimapShouldHighlightEditorKey] boolValue ];
766764 if (editorHighlightingEnabled) {
767- [self .editorTextView.layoutManager invalidateDisplayForCharacterRange: fullTextRange ];
765+ [self .editorTextView.layoutManager invalidateDisplayForCharacterRange: [ self .editorTextView visibleCharacterRange ] ];
768766 }
769767 };
770768
771769 if (self.shouldUpdateBreakpointsAndIssues ) {
772770 self.shouldUpdateBreakpointsAndIssues = NO ;
773771 [self updateBreakpointsAndIssuesWithCompletion: ^{
774- performFullRangeInvalidation ();
772+ performRangeInvalidation ();
775773 }];
776774 } else {
777- performFullRangeInvalidation ();
775+ performRangeInvalidation ();
778776 }
779777}
780778
0 commit comments