Skip to content

Commit a92bafb

Browse files
authored
Merge pull request #857 from ychin/pre-mojave-scrollbar-render-fix
Fix scrollbar rendering artifact in pre-Mojave renderer
2 parents 4bafe61 + ec0c14e commit a92bafb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/MacVim/MMVimView.m

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,19 @@ - (void)frameSizeMayHaveChanged:(BOOL)keepGUISize
929929
NSRect textViewRect = [self textViewRectForVimViewSize:[self frame].size];
930930
[textView setFrame:textViewRect];
931931

932-
self.pendingPlaceScrollbars = YES;
932+
// Immediately place the scrollbars instead of deferring till later here.
933+
// Deferral ended up causing some bugs, in particular when in <10.14
934+
// CoreText renderer where [NSAnimationContext beginGrouping] is used to
935+
// bundle state changes together and the deferred placeScrollbars would get
936+
// the wrong data to use. An alternative would be to check for that and only
937+
// call finishPlaceScrollbars once we call [NSAnimationContext endGrouping]
938+
// but that makes the code mode complicated. Just do it here and the
939+
// performance is fine as this gets called occasionally only
940+
// (pendingPlaceScrollbars is mostly for the case if we are adding a lot of
941+
// scrollbars at once we want to only call placeScrollbars once instead of
942+
// doing it N times).
943+
self.pendingPlaceScrollbars = NO;
944+
[self placeScrollbars];
933945

934946
// It is possible that the current number of (rows,columns) is too big or
935947
// too small to fit the new frame. If so, notify Vim that the text

0 commit comments

Comments
 (0)