From 552088f0b9718a8714c82b43936a46be21f31ea9 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 20 Oct 2007 13:51:21 +0200 Subject: [PATCH] Fix cursor blinking in insert mode. Calls to draw text with the DRAW_TRANSP flag were ignored. By not ignoring these calls the background of the cursor is erased also in insert mode so that blinking works. --- src/MacVim/MMTextStorage.m | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/MacVim/MMTextStorage.m b/src/MacVim/MMTextStorage.m index af82156e72..c3deef9ee9 100644 --- a/src/MacVim/MMTextStorage.m +++ b/src/MacVim/MMTextStorage.m @@ -199,10 +199,6 @@ // row, col, flags, fg, bg, sp); [self lazyResize:NO]; - // TODO: support DRAW_TRANSP - if (flags & DRAW_TRANSP) - return; - if (row < 0 || row >= maxRows || col < 0 || col >= maxColumns || col+[string length] > maxColumns) { //NSLog(@"[%s] WARNING : out of range, row=%d (%d) col=%d (%d) " @@ -242,6 +238,16 @@ sp, NSUnderlineColorAttributeName, [NSNumber numberWithFloat:2],NSBaselineOffsetAttributeName, nil]; + } else if (flags & DRAW_TRANSP) { + // Don't include background color when DRAW_TRANSP is set. + // + // NOTE: I'm not sure what the point of this is, but if DRAW_TRANSP + // calls are ignored, then cursor blinking in insert mode doesn't work. + attributes = [NSDictionary dictionaryWithObjectsAndKeys: + theFont, NSFontAttributeName, + fg, NSForegroundColorAttributeName, + sp, NSUnderlineColorAttributeName, + nil]; } else { attributes = [NSDictionary dictionaryWithObjectsAndKeys: theFont, NSFontAttributeName,