@@ -127,15 +127,15 @@ - (PlainTextWindowControllerTabContext *)windowControllerTabContextForDocument:(
127127}
128128
129129- (PlainTextWindowControllerTabContext *)selectedTabContext {
130- //
131130 return I_tabContext;
132131}
133132
134133- (void )document : (PlainTextDocument *)document isReceivingContent : (BOOL )flag ;
135134{
136- if (![[self documents ] containsObject: document])
135+ if (![[self documents ] containsObject: document]) {
137136 return ;
138-
137+ }
138+
139139 PlainTextWindowControllerTabContext *tabContext = [self windowControllerTabContextForDocument: document];
140140 if (tabContext) {
141141
@@ -337,6 +337,21 @@ - (void)selectRangeInBackground:(NSRange)aRange {
337337
338338#pragma mark -
339339
340+ - (BOOL )showsCautionSymbolInTab {
341+ return !!(self.window .tab .accessoryView );
342+ }
343+
344+ - (void )setShowsCautionSymbolInTab: (BOOL )showsCautionSymbolInTab {
345+ NSWindowTab *tab = self.window .tab ;
346+
347+ tab.accessoryView = showsCautionSymbolInTab ? ({
348+ NSImage *image = [NSImage imageNamed: @" CautionSymbol" ];
349+ image.size = NSMakeSize (18 ,18 );
350+ NSImageView *view = [NSImageView imageViewWithImage: image];
351+ view;
352+ }) : nil ;
353+ }
354+
340355- (BOOL )showsBottomStatusBar {
341356 PlainTextWindowControllerTabContext *tabContext = self.selectedTabContext ;
342357 return [[tabContext.plainTextEditors lastObject ] showsBottomStatusBar ];
@@ -378,7 +393,6 @@ - (IBAction)jumpToPreviousSymbol:(id)aSender {
378393 [[self activePlainTextEditor ] jumpToPreviousSymbol: aSender];
379394}
380395
381-
382396- (IBAction )jumpToNextChange: (id )aSender {
383397 [[self activePlainTextEditor ] jumpToNextChange: aSender];
384398}
0 commit comments