diff --git a/MacDown/Code/Document/MPDocument.m b/MacDown/Code/Document/MPDocument.m index f7424d3d..3dcf4135 100644 --- a/MacDown/Code/Document/MPDocument.m +++ b/MacDown/Code/Document/MPDocument.m @@ -481,20 +481,15 @@ - (BOOL)validateUserInterfaceItem:(id)item BOOL validness = !self.previewVisible && self.previousSplitRatio >= 0.0; ((NSMenuItem *)item).hidden = !validness; } + else if (action == @selector(toggleTOCRendering:)) + { + NSInteger state = self.rendersTOC ? NSOnState : NSOffState; + ((NSMenuItem *)item).state = state; + } return result; } -#pragma mark - NSMenuValidation - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem -{ - if (menuItem.action == @selector(toggleTOCRendering:)) - menuItem.state = self.rendersTOC ? NSOnState : NSOffState; - return YES; -} - - #pragma mark - NSTextViewDelegate - (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector