Skip to content

Commit ffec54f

Browse files
committed
When HeaderDoc formatting is enabled, disable the slashes prefix option since it is only supported by Appledoc.
1 parent a3e8107 commit ffec54f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ - (void)windowDidLoad
5555
} else {
5656
[self.mtxPrefixOptions selectCell:self.btnPrefixWithWhitespace];
5757
}
58+
59+
// Disable the slashes prefix option for HeaderDoc comments
60+
if (self.btnUseHeaderDoc.state == NSOnState) {
61+
self.btnPrefixWithSlashes.enabled = NO;
62+
}
5863

5964
[self updateUseSpace:self.btnUseSpaces.state];
6065
[self syncSpaceCount];
@@ -137,5 +142,19 @@ - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
137142
}
138143
- (IBAction)useHeaderDoc:(id)sender {
139144
[[VVDocumenterSetting defaultSetting] setUseHeaderDoc:self.btnUseHeaderDoc.state];
145+
146+
if (self.btnUseHeaderDoc.state == NSOnState) {
147+
self.btnPrefixWithSlashes.enabled = NO;
148+
149+
// If the slashes option was selected, change to the default stars
150+
if ([self.mtxPrefixOptions.selectedCell isEqual:self.btnPrefixWithSlashes]) {
151+
[self.mtxPrefixOptions selectCell:self.btnPrefixWithStar];
152+
153+
// Update the settings in addition to the display
154+
[self.mtxPrefixOptions sendAction];
155+
}
156+
} else {
157+
self.btnPrefixWithSlashes.enabled = YES;
158+
}
140159
}
141160
@end

0 commit comments

Comments
 (0)