From 9bd07078edf9dc949be1a44d04cf1f9d97701d07 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sun, 25 Jul 2010 16:49:05 +0200 Subject: [PATCH] No right/bot scrollbar -> no resize indicator The resize indicator covers the text view when there is no right or bottom scrollbar so don't draw it in this situation. Also avoids a display corruption when using Core Text renderer with ":set go-=r". --- src/MacVim/MMVimView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index c5a4a9f0b0..bd86dbb54f 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -663,6 +663,7 @@ enum { { NSRect textViewFrame = [textView frame]; BOOL lsbVisible = [self leftScrollbarVisible]; + BOOL botOrRightSbVisible = NO; // HACK! Find the lowest left&right vertical scrollbars, as well as the // rightmost horizontal scrollbar. This hack continues further down. @@ -686,10 +687,12 @@ enum { && range.location >= rowMaxRight) { rowMaxRight = range.location; lowestRightSbIdx = i; + botOrRightSbVisible = YES; } else if ([scroller type] == MMScrollerTypeBottom && range.location >= colMax) { colMax = range.location; rightmostSbIdx = i; + botOrRightSbVisible = YES; } } } @@ -778,6 +781,11 @@ enum { [scroller setNeedsDisplay:YES]; } } + + // HACK: If there is no bottom or right scrollbar the resize indicator will + // cover the bottom-right corner of the text view so tell NSWindow not to + // draw it in this situation. + [[self window] setShowsResizeIndicator:botOrRightSbVisible]; } - (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi