Skip to content

Commit 8e90e5d

Browse files
committed
Small fixes.
1 parent 9b9fcfa commit 8e90e5d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

SCXcodeMinimap/SCXcodeMinimap.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender
152152
CGFloat width = editorTextView.bounds.size.width * kDefaultZoomLevel;
153153

154154
NSRect frame = editorTextView.frame;
155-
frame.size.width -= (width + kRightSidePadding);
155+
frame.size.width -= width;
156156
[editorTextView setFrame:frame];
157157

158158
NSRect miniMapScrollViewFrame = NSMakeRect(editorContainerView.bounds.size.width - width - kRightSidePadding, 0, width, editorScrollView.bounds.size.height);
@@ -212,10 +212,12 @@ - (void)onDidFinishSetup:(NSNotification*)sender
212212

213213
#pragma mark - NSLayoutManagerDelegate
214214

215-
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag
215+
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished
216216
{
217-
NSScrollView *editorScrollView = objc_getAssociatedObject(textContainer, &kKeyEditorScrollView);
218-
[self updateMiniMapForEditorScrollView:editorScrollView];
217+
if(layoutFinished) {
218+
NSScrollView *editorScrollView = objc_getAssociatedObject(textContainer, &kKeyEditorScrollView);
219+
[self updateMiniMapForEditorScrollView:editorScrollView];
220+
}
219221
}
220222

221223
- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange

0 commit comments

Comments
 (0)