@@ -174,7 +174,7 @@ - (id)initWithVimController:(MMVimController *)controller
174174
175175 [win setDelegate: self ];
176176 [win setInitialFirstResponder: [vimView textView ]];
177-
177+
178178 if ([win styleMask ] & NSWindowStyleMaskTexturedBackground ) {
179179 // On Leopard, we want to have a textured window to have nice
180180 // looking tabs. But the textured window look implies rounded
@@ -381,7 +381,6 @@ - (void)selectTabWithIndex:(int)idx
381381}
382382
383383- (void )setTextDimensionsWithRows : (int )rows columns : (int )cols isLive : (BOOL )live
384- keepGUISize : (BOOL )keepGUISize
385384 keepOnScreen : (BOOL )onScreen
386385{
387386 ASLogDebug (@" setTextDimensionsWithRows:%d columns:%d isLive:%d "
@@ -400,7 +399,7 @@ - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
400399
401400 [vimView setDesiredRows: rows columns: cols];
402401
403- if (setupDone && !live && !keepGUISize ) {
402+ if (setupDone && !live) {
404403 shouldResizeVimView = YES ;
405404 keepOnScreen = onScreen;
406405 }
@@ -429,15 +428,6 @@ - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
429428 }
430429}
431430
432- - (void )resizeView
433- {
434- if (setupDone)
435- {
436- shouldResizeVimView = YES ;
437- shouldKeepGUISize = YES ;
438- }
439- }
440-
441431- (void )zoomWithRows : (int )rows columns : (int )cols state : (int )state
442432{
443433 [self setTextDimensionsWithRows: rows
@@ -513,13 +503,19 @@ - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type
513503- (BOOL )destroyScrollbarWithIdentifier : (int32_t )ident
514504{
515505 BOOL scrollbarHidden = [vimView destroyScrollbarWithIdentifier: ident];
506+ shouldResizeVimView = shouldResizeVimView || scrollbarHidden;
507+ shouldMaximizeWindow = shouldMaximizeWindow || scrollbarHidden;
508+
516509 return scrollbarHidden;
517510}
518511
519512- (BOOL )showScrollbarWithIdentifier : (int32_t )ident state : (BOOL )visible
520513{
521514 BOOL scrollbarToggled = [vimView showScrollbarWithIdentifier: ident
522515 state: visible];
516+ shouldResizeVimView = shouldResizeVimView || scrollbarToggled;
517+ shouldMaximizeWindow = shouldMaximizeWindow || scrollbarToggled;
518+
523519 return scrollbarToggled;
524520}
525521
@@ -604,18 +600,7 @@ - (void)processInputQueueDidFinish
604600 fullScreenWindow ? [fullScreenWindow frame ].size :
605601 fullScreenEnabled ? desiredWindowSize :
606602 [self constrainContentSizeToScreenSize: [vimView desiredSize ]]];
607-
608- // Setting 'guioptions+=k' will make shouldKeepGUISize true, which
609- // means avoid resizing the window. Instead, resize the view instead
610- // to keep the GUI window's size consistent.
611- bool avoidWindowResize = shouldKeepGUISize && !fullScreenEnabled;
612-
613- if (!avoidWindowResize) {
614- [vimView setFrameSize: contentSize];
615- }
616- else {
617- [vimView setFrameSizeKeepGUISize: originalSize];
618- }
603+ [vimView setFrameSize: contentSize];
619604
620605 if (fullScreenWindow) {
621606 // NOTE! Don't mark the full-screen content view as needing an
@@ -628,15 +613,12 @@ - (void)processInputQueueDidFinish
628613 [fullScreenWindow centerView ];
629614 }
630615 } else {
631- if (!avoidWindowResize) {
632- [self resizeWindowToFitContentSize: contentSize
633- keepOnScreen: keepOnScreen];
634- }
616+ [self resizeWindowToFitContentSize: contentSize
617+ keepOnScreen: keepOnScreen];
635618 }
636619 }
637620
638621 keepOnScreen = NO ;
639- shouldKeepGUISize = NO ;
640622 }
641623}
642624
@@ -675,13 +657,15 @@ - (void)adjustLinespace:(int)linespace
675657{
676658 if (vimView && [vimView textView ]) {
677659 [[vimView textView ] setLinespace: (float )linespace];
660+ shouldMaximizeWindow = shouldResizeVimView = YES ;
678661 }
679662}
680663
681664- (void )adjustColumnspace : (int )columnspace
682665{
683666 if (vimView && [vimView textView ]) {
684667 [[vimView textView ] setColumnspace: (float )columnspace];
668+ shouldMaximizeWindow = shouldResizeVimView = YES ;
685669 }
686670}
687671
@@ -1203,7 +1187,7 @@ - (void)window:(NSWindow *)window
12031187 [[window animator ] setAlphaValue: 0 ];
12041188 } completionHandler: ^{
12051189 [self maximizeWindow: fullScreenOptions];
1206-
1190+
12071191 // Fade in
12081192 [NSAnimationContext runAnimationGroup: ^(NSAnimationContext *context) {
12091193 [context setDuration: 0.5 *duration];
@@ -1222,7 +1206,7 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification
12221206
12231207 // The separator should never be visible in fullscreen or split-screen.
12241208 [decoratedWindow hideTablineSeparator: YES ];
1225-
1209+
12261210 // ASSUMPTION: fullScreenEnabled always reflects the state of Vim's 'fu'.
12271211 if (!fullScreenEnabled) {
12281212 ASLogDebug (@" Full-screen out of sync, tell Vim to set 'fu'" );
@@ -1324,7 +1308,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification
13241308 // full-screen by moving the window out from Split View.
13251309 [vimController sendMessage: BackingPropertiesChangedMsgID data: nil ];
13261310 }
1327-
1311+
13281312 [self updateTablineSeparator ];
13291313}
13301314
@@ -1552,6 +1536,7 @@ - (void)hideTablineSeparator:(BOOL)hide
15521536 // The tabline separator was toggled so the content view must change
15531537 // size.
15541538 [self updateResizeConstraints ];
1539+ shouldResizeVimView = YES ;
15551540 }
15561541}
15571542
0 commit comments