Skip to content
Snippets Groups Projects
Commit 82106fc6 authored by George Nachman's avatar George Nachman
Browse files

Add category prefixes to advanced settings descriptions and show them in sorted order.

parent 107ca48d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -24,6 +24,7 @@ static NSString *const kAdvancedSettingDescription = @"kAdvancedSettingDescripti
 
@interface NSDictionary (AdvancedSettings)
- (iTermAdvancedSettingType)advancedSettingType;
- (NSComparisonResult)compareAdvancedSettingDicts:(NSDictionary *)other;
@end
 
@implementation NSDictionary (AdvancedSettings)
Loading
Loading
@@ -32,6 +33,10 @@ static NSString *const kAdvancedSettingDescription = @"kAdvancedSettingDescripti
return (iTermAdvancedSettingType)[[self objectForKey:kAdvancedSettingType] intValue];
}
 
- (NSComparisonResult)compareAdvancedSettingDicts:(NSDictionary *)other {
return [self[kAdvancedSettingDescription] compare:other[kAdvancedSettingDescription]];
}
@end
 
static BOOL gIntrospecting;
Loading
Loading
@@ -136,6 +141,10 @@ static NSDictionary *gIntrospection;
return settings;
}
 
+ (NSArray *)sortedAdvancedSettings {
return [[self advancedSettings] sortedArrayUsingSelector:@selector(compareAdvancedSettingDicts:)];
}
+ (NSArray *)advancedSettings {
static NSMutableArray *settings;
if (!settings) {
Loading
Loading
@@ -210,11 +219,11 @@ static NSDictionary *gIntrospection;
 
- (NSArray *)filteredAdvancedSettings {
if (_searchField.stringValue.length == 0) {
return [[self class] advancedSettings];
return [[self class] sortedAdvancedSettings];
} else {
NSMutableArray *result = [NSMutableArray array];
NSArray *parts = [_searchField.stringValue componentsSeparatedByString:@" "];
for (NSDictionary *dict in [[self class] advancedSettings]) {
for (NSDictionary *dict in [[self class] sortedAdvancedSettings]) {
NSString *description = dict[kAdvancedSettingDescription];
if ([self description:description matchesQuery:parts]) {
[result addObject:dict];
Loading
Loading
Loading
Loading
@@ -44,44 +44,57 @@
description:theDescription]; \
}
 
DEFINE_BOOL(useUnevenTabs, NO, @"Uneven tab widths allowed")
DEFINE_INT(minTabWidth, 75, @"Minimum tab width")
DEFINE_INT(minCompactTabWidth, 60, @"Minimum tab width for tabs without close button or number")
DEFINE_INT(optimumTabWidth, 175, @"Preferred tab width")
DEFINE_BOOL(alternateMouseScroll, NO, @"Scroll wheel sends arrow keys in alternate screen mode")
DEFINE_BOOL(traditionalVisualBell, NO, @"Visual bell flashes the whole screen, not just a bell icon")
DEFINE_FLOAT(hotkeyTermAnimationDuration, 0.25, @"Duration in seconds of the hotkey window animation")
DEFINE_STRING(searchCommand, @"http://google.com/search?q=%@", @"Template for URL of search engine")
DEFINE_FLOAT(antiIdleTimerPeriod, 60, @"Anti-idle interval in seconds. Will not go faster than 60 seconds.")
DEFINE_BOOL(dockIconTogglesWindow, NO, @"If the only window is a hotkey window, then clicking the dock icon shows/hides it")
DEFINE_FLOAT(timeBetweenBlinks, 0.5, @"Time in seconds between cursor blinking on/off when a blinking cursor is enabled")
DEFINE_BOOL(neverWarnAboutMeta, NO, @"Suppress a warning when Option Key Acts as Meta is enabled");
DEFINE_BOOL(neverWarnAboutSpaces, NO, @"Suppress a warning about how to configure Spaces when setting a window's Space")
DEFINE_BOOL(neverWarnAboutOverrides, NO, @"Suppress a warning about a change to a Profile key setting that overrides a global setting")
DEFINE_BOOL(neverWarnAboutPossibleOverrides, NO, @"Suppress a warning about a change to a global key that's overridden by a Profile")
DEFINE_BOOL(trimWhitespaceOnCopy, YES, @"Trim whitespace when copying to pasteboard")
DEFINE_INT(autocompleteMaxOptions, 20, @"Number of autocomplete options to present (less than 100 recommended)")
DEFINE_BOOL(noSyncNeverRemindPrefsChangesLostForUrl, NO, @"Suppress warning shown when a setting changed but prefs are loaded from a URL")
DEFINE_BOOL(noSyncNeverRemindPrefsChangesLostForFile, NO, @"Suppress warning shown when a setting changed but prefs are loaded from a custom folder")
DEFINE_BOOL(openFileInNewWindows, NO, @"Open files (like shell scripts opened from Finder) in new windows, not new tabs")
DEFINE_FLOAT(minRunningTime, 10, @"Don't let iTerm2 quit automatically until it's been running for this many seconds (0 disables)")
DEFINE_FLOAT(updateScreenParamsDelay, 1, @"Wait this long after display settings change before updating windows")
DEFINE_INT(quickPasteBytesPerCall, 1024, @"Bytes to paste in each chunk when pasting normally")
DEFINE_FLOAT(quickPasteDelayBetweenCalls, 0.01, @"Delay in seconds between chunks when pasting normally")
DEFINE_INT(slowPasteBytesPerCall, 16, @"Bytes to paste in each chunk when pasting slowly")
DEFINE_FLOAT(slowPasteDelayBetweenCalls, 0.125, @"Delay in seconds between chunks when pasting slowly")
DEFINE_INT(pasteHistoryMaxOptions, 20, @"Number of entires to show in Paste History (will not go below 2 or above 100)")
DEFINE_BOOL(pinchToChangeFontSizeDisabled, NO, @"Disable using a pinch gesture to change font size")
DEFINE_BOOL(doNotSetCtype, NO, @"Never set the CTYPE environment variable")
DEFINE_BOOL(debugKeyDown, NO, @"Log verbose debug info about key presses")
DEFINE_BOOL(growlOnForegroundTabs, NO, @"Enable Growl or Notification Center notifications for the foreground tab")
DEFINE_FLOAT(smartCursorColorBgThreshold, 0.5, @"Threshold for Smart Cursor Color for background color (0 to 1, larger values are more aggressive)")
DEFINE_FLOAT(smartCursorColorFgThreshold, 0.75, @"Threshold for Smart Cursor Color for text color (0 to 1, larger values are more aggressive)")
DEFINE_BOOL(logDrawingPerformance, NO, @"Log stats about text drawing performance to console")
DEFINE_BOOL(ignoreHardNewlinesInURLs, NO, @"Ignore hard newlines for the purposes of locating URLs for Cmd-click")
DEFINE_BOOL(copyWithStylesByDefault, NO, @"Copy to pasteboard includes color and font style")
#pragma mark Tabs
DEFINE_BOOL(useUnevenTabs, NO, @"Tabs: Uneven tab widths allowed")
DEFINE_INT(minTabWidth, 75, @"Tabs: Minimum tab width")
DEFINE_INT(minCompactTabWidth, 60, @"Tabs: Minimum tab width for tabs without close button or number")
DEFINE_INT(optimumTabWidth, 175, @"Tabs: Preferred tab width")
 
#pragma mark Mouse
DEFINE_BOOL(alternateMouseScroll, NO, @"Mouse: Scroll wheel sends arrow keys in alternate screen mode")
DEFINE_BOOL(pinchToChangeFontSizeDisabled, NO, @"Mouse: Disable using a pinch gesture to change font size")
#pragma mark Terminal
DEFINE_BOOL(traditionalVisualBell, NO, @"Terminal: Visual bell flashes the whole screen, not just a bell icon")
DEFINE_FLOAT(antiIdleTimerPeriod, 60, @"Terminal: Anti-idle interval in seconds. Will not go faster than 60 seconds.")
DEFINE_FLOAT(timeBetweenBlinks, 0.5, @"Terminal: Time in seconds between cursor blinking on/off when a blinking cursor is enabled")
DEFINE_BOOL(doNotSetCtype, NO, @"Terminal: Never set the CTYPE environment variable")
// For these, 1 is more aggressive and 0 turns the feature off:
DEFINE_FLOAT(smartCursorColorBgThreshold, 0.5, @"Terminal: Threshold for Smart Cursor Color for background color (0 to 1)")
DEFINE_FLOAT(smartCursorColorFgThreshold, 0.75, @"Terminal: Threshold for Smart Cursor Color for text color (0 to 1)")
#pragma mark Hotkey
DEFINE_FLOAT(hotkeyTermAnimationDuration, 0.25, @"Hotkey: Duration in seconds of the hotkey window animation")
DEFINE_BOOL(dockIconTogglesWindow, NO, @"Hotkey: If the only window is a hotkey window, then clicking the dock icon shows/hides it")
#pragma mark General
DEFINE_STRING(searchCommand, @"General: http://google.com/search?q=%@", @"Template for URL of search engine")
DEFINE_INT(autocompleteMaxOptions, 20, @"General: Number of autocomplete options to present (less than 100 recommended)")
DEFINE_BOOL(openFileInNewWindows, NO, @"General: Open files (like shell scripts opened from Finder) in new windows, not new tabs")
DEFINE_FLOAT(minRunningTime, 10, @"General: Automatic quit suspended for this manys seconds after startup (0 disables)")
DEFINE_FLOAT(updateScreenParamsDelay, 1, @"General: Delay after changing number of screens/resolution until refresh (seconds)")
DEFINE_INT(pasteHistoryMaxOptions, 20, @"General: Number of entires to show in Paste History (will not go below 2 or above 100)")
DEFINE_BOOL(debugKeyDown, NO, @"General: Log verbose debug info about key presses")
DEFINE_BOOL(growlOnForegroundTabs, NO, @"General: Enable Growl or Notification Center notifications for the foreground tab")
DEFINE_BOOL(logDrawingPerformance, NO, @"General: Log stats about text drawing performance to console")
DEFINE_BOOL(ignoreHardNewlinesInURLs, NO, @"General: Ignore hard newlines for the purposes of locating URLs for Cmd-click")
// Note: square brackets are included for ipv6 addresses like http://[2600:3c03::f03c:91ff:fe96:6a7a]/
DEFINE_STRING(URLCharacterSet, @".?\\/:;%=&_-,+~#@!*'()|[]", @"Non-alphanumeric characters considered part of a URL for Cmd-click")
DEFINE_STRING(URLCharacterSet, @".?\\/:;%=&_-,+~#@!*'()|[]", @"General: Non-alphanumeric characters considered part of a URL for Cmd-click")
#pragma mark Warnings
DEFINE_BOOL(neverWarnAboutMeta, NO, @"Warnings: Suppress a warning when Option Key Acts as Meta is enabled");
DEFINE_BOOL(neverWarnAboutSpaces, NO, @"Warnings: Suppress a warning about how to configure Spaces when setting a window's Space")
DEFINE_BOOL(neverWarnAboutOverrides, NO, @"Warnings: Suppress a warning about a change to a Profile key setting that overrides a global setting")
DEFINE_BOOL(neverWarnAboutPossibleOverrides, NO, @"Warnings: Suppress a warning about a change to a global key that's overridden by a Profile")
DEFINE_BOOL(noSyncNeverRemindPrefsChangesLostForUrl, NO, @"Warnings: Suppress changed-setting warning when prefs are loaded from a URL")
DEFINE_BOOL(noSyncNeverRemindPrefsChangesLostForFile, NO, @"Warnings: Suppress changed-setting warning when prefs are loaded from a custom folder")
#pragma mark Pasteboard
DEFINE_BOOL(trimWhitespaceOnCopy, YES, @"Pasteboard: Trim whitespace when copying to pasteboard")
DEFINE_INT(quickPasteBytesPerCall, 1024, @"Pasteboard: Bytes to paste in each chunk when pasting normally")
DEFINE_FLOAT(quickPasteDelayBetweenCalls, 0.01, @"Pasteboard: Delay in seconds between chunks when pasting normally")
DEFINE_INT(slowPasteBytesPerCall, 16, @"Pasteboard: Bytes to paste in each chunk when pasting slowly")
DEFINE_FLOAT(slowPasteDelayBetweenCalls, 0.125, @"Pasteboard: Delay in seconds between chunks when pasting slowly")
DEFINE_BOOL(copyWithStylesByDefault, NO, @"Pasteboard: Copy to pasteboard includes color and font style")
 
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment