File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments