Skip to content

Commit 3f53a6f

Browse files
committed
Fix up switch statement over alt-semantics colors
1 parent c9349b3 commit 3f53a6f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

PTYTextView.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,18 @@ - (NSColor*)_colorForCode:(int)theIndex
758758
case ALTSEM_BG_DEFAULT:
759759
color = defaultBGColor;
760760
break;
761-
default:
761+
case ALTSEM_FG_DEFAULT:
762762
if (isBold && useBrightBold) {
763763
color = [self defaultBoldColor];
764764
} else {
765765
color = defaultFGColor;
766766
}
767+
break;
768+
default:
769+
// This should never happen, but if it does we should
770+
// get some bug reports by returning red.
771+
NSLog(@"Unexpected alternate-semantics color %d", theIndex);
772+
return [NSColor colorWithCalibratedRed:1 green:0 blue:0 alpha:1];
767773
}
768774
break;
769775
case ColorMode24bit:

0 commit comments

Comments
 (0)