diff --git a/MMBackend.h b/MMBackend.h index bca3b03abf..c2fe4159ce 100644 --- a/MMBackend.h +++ b/MMBackend.h @@ -24,6 +24,7 @@ BOOL tabBarVisible; int backgroundColor; int foregroundColor; + int specialColor; int defaultBackgroundColor; int defaultForegroundColor; NSDate *lastFlushDate; @@ -34,6 +35,7 @@ - (void)setBackgroundColor:(int)color; - (void)setForegroundColor:(int)color; +- (void)setSpecialColor:(int)color; - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg; - (BOOL)checkin; diff --git a/MMBackend.m b/MMBackend.m index 64e9a42186..7ba66cfbbf 100644 --- a/MMBackend.m +++ b/MMBackend.m @@ -84,6 +84,11 @@ static int specialKeyToNSKey(int key); foregroundColor = color; } +- (void)setSpecialColor:(int)color +{ + specialColor = color; +} + - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg { defaultBackgroundColor = bg; @@ -239,6 +244,7 @@ static int specialKeyToNSKey(int key); [drawData appendBytes:&backgroundColor length:sizeof(int)]; [drawData appendBytes:&foregroundColor length:sizeof(int)]; + [drawData appendBytes:&specialColor length:sizeof(int)]; [drawData appendBytes:&row length:sizeof(int)]; [drawData appendBytes:&col length:sizeof(int)]; [drawData appendBytes:&flags length:sizeof(int)]; diff --git a/MMTextStorage.h b/MMTextStorage.h index dd7c765805..457e195f24 100644 --- a/MMTextStorage.h +++ b/MMTextStorage.h @@ -34,9 +34,9 @@ - (int)maxColumns; - (void)getMaxRows:(int*)rows columns:(int*)cols; - (void)setMaxRows:(int)rows columns:(int)cols; -- (void)replaceString:(NSString*)string atRow:(int)row column:(int)col - withFlags:(int)flags foregroundColor:(NSColor*)fg - backgroundColor:(NSColor*)bg; +- (void)replaceString:(NSString *)string atRow:(int)row column:(int)col + withFlags:(int)flags foregroundColor:(NSColor *)fg + backgroundColor:(NSColor *)bg specialColor:(NSColor *)sp; - (void)deleteLinesFromRow:(int)row lineCount:(int)count scrollBottom:(int)bottom left:(int)left right:(int)right color:(NSColor *)color; diff --git a/MMTextStorage.m b/MMTextStorage.m index ed29f4d87a..97ae7f2c0e 100644 --- a/MMTextStorage.m +++ b/MMTextStorage.m @@ -154,9 +154,9 @@ maxColumns = cols; } -- (void)replaceString:(NSString*)string atRow:(int)row column:(int)col - withFlags:(int)flags foregroundColor:(NSColor*)fg - backgroundColor:(NSColor*)bg +- (void)replaceString:(NSString *)string atRow:(int)row column:(int)col + withFlags:(int)flags foregroundColor:(NSColor *)fg + backgroundColor:(NSColor *)bg specialColor:(NSColor *)sp { //NSLog(@"replaceString:atRow:%d column:%d withFlags:%d", row, col, flags); [self lazyResize]; @@ -169,9 +169,9 @@ return; } - if (!(fg && bg)) { - NSLog(@"[%s] WARNING: background or foreground color not specified", - _cmd); + if (!(fg && bg && sp)) { + NSLog(@"[%s] WARNING: background, foreground or special color not " + "specified", _cmd); return; } @@ -183,7 +183,9 @@ #if !HEED_DRAW_TRANSP bg, NSBackgroundColorAttributeName, #endif - fg, NSForegroundColorAttributeName, nil]; + fg, NSForegroundColorAttributeName, + sp, NSUnderlineColorAttributeName, + nil]; [attribString setAttributes:attributes range:range]; #if HEED_DRAW_TRANSP diff --git a/MMVimController.m b/MMVimController.m index b657c666bc..4b257d56ec 100644 --- a/MMVimController.m +++ b/MMVimController.m @@ -770,6 +770,7 @@ static NSMenuItem *findMenuItemWithTagInMenu(NSMenu *root, int tag) } else if (ReplaceStringDrawType == type) { int bg = *((int*)bytes); bytes += sizeof(int); int fg = *((int*)bytes); bytes += sizeof(int); + int sp = *((int*)bytes); bytes += sizeof(int); int row = *((int*)bytes); bytes += sizeof(int); int col = *((int*)bytes); bytes += sizeof(int); int flags = *((int*)bytes); bytes += sizeof(int); @@ -785,7 +786,8 @@ static NSMenuItem *findMenuItemWithTagInMenu(NSMenu *root, int tag) atRow:row column:col withFlags:flags foregroundColor:[NSColor colorWithRgbInt:fg] - backgroundColor:[NSColor colorWithRgbInt:bg]]; + backgroundColor:[NSColor colorWithRgbInt:bg] + specialColor:[NSColor colorWithRgbInt:sp]]; [string release]; } else if (InsertLinesDrawType == type) { diff --git a/gui_macvim.m b/gui_macvim.m index fc11ac8a42..704eaa3146 100644 --- a/gui_macvim.m +++ b/gui_macvim.m @@ -1226,6 +1226,7 @@ gui_mch_set_shellsize( void gui_mch_set_sp_color(guicolor_T color) { + [[MMBackend sharedInstance] setSpecialColor:color]; }