mod behavior;
mod search;
mod semantic_history;
mod shell;
mod startup;
mod unicode;
use crate::SettingsUI;
use crate::section::section_matches;
use std::collections::HashSet;
pub fn show(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
let query = settings.search_query.trim().to_lowercase();
if section_matches(
&query,
"Behavior",
&[
"scrollback",
"exit",
"shell exit",
"jobs",
"confirm",
"confirm close",
"close",
"running jobs",
"process names",
"ignore",
"close tab",
],
) {
behavior::show_behavior_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Unicode",
&[
"unicode",
"width",
"answerback",
"ambiguous",
"normalization",
"nfc",
"nfd",
"emoji",
"east asian",
"cjk",
],
) {
unicode::show_unicode_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Shell",
&[
"shell",
"custom shell",
"shell args",
"working directory",
"login",
"startup",
"previous",
"home",
"directory mode",
"last working directory",
"custom directory",
],
) {
shell::show_shell_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Startup",
&[
"initial text",
"startup",
"delay",
"newline",
"restore",
"session",
"restore tabs",
"restore panes",
"session state",
"escape sequences",
"undo",
"undo close",
"reopen",
"reopen tab",
"closed tab",
],
) {
startup::show_startup_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Search",
&[
"search",
"highlight",
"case sensitive",
"regex",
"wrap",
"wrap around",
"current match",
],
) {
search::show_search_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Semantic History",
&[
"semantic",
"history",
"file",
"editor",
"path",
"click",
"vs code",
"sublime",
"vim",
"editor mode",
"system default",
],
) {
semantic_history::show_semantic_history_section(
ui,
settings,
changes_this_frame,
collapsed,
);
}
if section_matches(
&query,
"Command History",
&[
"command",
"history",
"fuzzy",
"search",
"entries",
"max entries",
],
) {
search::show_command_history_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Command Separators",
&[
"separator",
"command",
"line",
"divider",
"prompt",
"exit code",
"success",
"failure",
],
) {
search::show_command_separator_section(ui, settings, changes_this_frame, collapsed);
}
}
pub fn keywords() -> &'static [&'static str] {
&[
"shell",
"scrollback",
"scrollback lines",
"exit",
"shell exit",
"exit action",
"confirm",
"confirm close",
"running jobs",
"jobs",
"jobs to ignore",
"unicode",
"unicode version",
"width",
"ambiguous",
"ambiguous width",
"answerback",
"custom shell",
"shell args",
"login shell",
"login",
"working directory",
"startup directory",
"previous session",
"home",
"initial text",
"startup",
"delay",
"newline",
"undo",
"undo close",
"reopen",
"reopen tab",
"closed tab",
"preserve shell",
"preserve",
"hide tab",
"search",
"highlight",
"search highlight",
"case sensitive",
"regex",
"wrap",
"wrap around",
"semantic",
"semantic history",
"file path",
"click file",
"editor",
"editor mode",
"editor command",
"link handler",
"link highlight color",
"link highlight underline",
"link underline style",
"stipple",
"link color",
"url color",
"browser",
"open url",
"open links",
"url handler",
"normalization",
"text normalization",
"nfc",
"nfd",
"command history",
"history entries",
"max history",
"command separator",
"separator",
"separator line",
"separator thickness",
"separator opacity",
"exit code",
"restore session",
"undo timeout",
"undo entries",
]
}