File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ - (void)updateTextView
218218 // Send the text storage update off to the main thread
219219 [[NSOperationQueue mainQueue ] addOperationWithBlock: ^{
220220 [weakSelf.textView.textStorage setAttributedString: mutableAttributedString];
221-
221+ [weakSelf updateSelectionView ];
222222 }];
223223
224224 // Now that we've sent that off, let's see how many lines we have while
@@ -229,10 +229,14 @@ - (void)updateTextView
229229
230230- (void )calculateLinesFromString : (NSString *)string
231231{
232- NSArray *lines = [string componentsSeparatedByString: @" \n " ];
232+ NSUInteger stringLength = [string length ];
233+ NSInteger numberOfLines = 0 ;
234+ for (NSInteger index = 0 ; index < stringLength; numberOfLines++) {
235+ index = NSMaxRange ([string lineRangeForRange: NSMakeRange (index, 0 )]);
236+ }
233237
234238 // Cache the last calculated lines so we can figure out how long we should take to render this minimap.
235- self.lastCalculatedLines = lines. count ;
239+ self.lastCalculatedLines = numberOfLines ;
236240}
237241
238242- (void )resizeWithOldSuperviewSize : (NSSize )oldSize
You can’t perform that action at this time.
0 commit comments