diff --git a/config/keymap.toml b/config/keymap.toml index 1cb7783b..ebe84cfe 100644 --- a/config/keymap.toml +++ b/config/keymap.toml @@ -27,7 +27,7 @@ keymap = [ # Selection { on = [ "" ], exec = "select --state=none" }, { on = [ "v" ], exec = "visual_mode" }, - { on = [ "V" ], exec = "visual_mode --unselect" }, + { on = [ "V" ], exec = "visual_mode --unset" }, { on = [ "" ], exec = "select_all --state=true" }, { on = [ "" ], exec = "select_all --state=none" }, diff --git a/config/theme.toml b/config/theme.toml index 40539eaa..b2a25c77 100644 --- a/config/theme.toml +++ b/config/theme.toml @@ -3,15 +3,15 @@ active = { fg = "#1E2031", bg = "#80AEFA" } inactive = { fg = "#C8D3F8", bg = "#484D66" } [status] -primary = { normal = "#80AEFA", select = "#CD9EFC", unselect = "#FFA577" } -secondary = { normal = "#1E2031", select = "#23273B", unselect = "#23273B" } -tertiary = { normal = "#6D738F", select = "#6D738F", unselect = "#6D738F" } -body = { normal = "#484D66", select = "#484D66", unselect = "#484D66" } -emphasis = { normal = "#C8D3F8", select = "#C8D3F8", unselect = "#C8D3F8" } -info = { normal = "#7AD9E5", select = "#7AD9E5", unselect = "#7AD9E5" } -success = { normal = "#97DC8D", select = "#97DC8D", unselect = "#97DC8D" } -warning = { normal = "#F3D398", select = "#F3D398", unselect = "#F3D398" } -danger = { normal = "#FA7F94", select = "#FA7F94", unselect = "#FA7F94" } +primary = { normal = "#80AEFA", select = "#CD9EFC", unset = "#FFA577" } +secondary = { normal = "#1E2031", select = "#23273B", unset = "#23273B" } +tertiary = { normal = "#6D738F", select = "#6D738F", unset = "#6D738F" } +body = { normal = "#484D66", select = "#484D66", unset = "#484D66" } +emphasis = { normal = "#C8D3F8", select = "#C8D3F8", unset = "#C8D3F8" } +info = { normal = "#7AD9E5", select = "#7AD9E5", unset = "#7AD9E5" } +success = { normal = "#97DC8D", select = "#97DC8D", unset = "#97DC8D" } +warning = { normal = "#F3D398", select = "#F3D398", unset = "#F3D398" } +danger = { normal = "#FA7F94", select = "#FA7F94", unset = "#FA7F94" } [progress] gauge = { fg = "#FFA577", bg = "#484D66" } diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..e088f861 --- /dev/null +++ b/cspell.json @@ -0,0 +1 @@ +{"version":"0.2","flagWords":[],"words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","ffmpegthumbnailer","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize"],"language":"en"} diff --git a/docs/keymap.md b/docs/keymap.md index 9bcee8e1..85f7969e 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -27,7 +27,7 @@ - visual_mode: Enter visual mode (selection mode). - - `--unselect`: Enter visual mode (deselect mode). + - `--unset`: Enter visual mode (unset mode). - select_all diff --git a/src/config/theme/color.rs b/src/config/theme/color.rs index c9d58c0f..4b3dc32b 100644 --- a/src/config/theme/color.rs +++ b/src/config/theme/color.rs @@ -41,7 +41,7 @@ impl Color { #[derive(Deserialize)] pub struct ColorGroup { - pub normal: Color, - pub select: Color, - pub unselect: Color, + pub normal: Color, + pub select: Color, + pub unset: Color, } diff --git a/src/core/manager/mode.rs b/src/core/manager/mode.rs index c66a75ed..39d3b98d 100644 --- a/src/core/manager/mode.rs +++ b/src/core/manager/mode.rs @@ -7,7 +7,7 @@ pub enum Mode { #[default] Normal, Select(usize), - Unselect(usize), + Unset(usize), } impl Mode { @@ -16,7 +16,7 @@ impl Mode { match *self { Mode::Normal => &group.normal, Mode::Select(_) => &group.select, - Mode::Unselect(_) => &group.unselect, + Mode::Unset(_) => &group.unset, } } @@ -25,7 +25,7 @@ impl Mode { match self { Mode::Normal => None, Mode::Select(n) => Some(*n), - Mode::Unselect(n) => Some(*n), + Mode::Unset(n) => Some(*n), } } } @@ -35,7 +35,7 @@ impl Display for Mode { match *self { Mode::Normal => write!(f, "NORMAL"), Mode::Select(_) => write!(f, "SELECT"), - Mode::Unselect(_) => write!(f, "UN-SEL"), + Mode::Unset(_) => write!(f, "UN-SET"), } } } diff --git a/src/core/manager/tab.rs b/src/core/manager/tab.rs index e492ee1e..dd5c7433 100644 --- a/src/core/manager/tab.rs +++ b/src/core/manager/tab.rs @@ -32,7 +32,7 @@ impl Tab { } pub fn escape(&mut self) -> bool { - if matches!(self.mode, Mode::Select(_) | Mode::Unselect(_)) { + if matches!(self.mode, Mode::Select(_) | Mode::Unset(_)) { self.mode = Mode::Normal; return true; } @@ -250,11 +250,11 @@ impl Tab { pub fn select_all(&mut self, state: Option) -> bool { self.current.select(None, state) } - pub fn visual_mode(&mut self, unsel: bool) -> bool { + pub fn visual_mode(&mut self, unset: bool) -> bool { let idx = self.current.cursor(); - if unsel { - self.mode = Mode::Unselect(idx); + if unset { + self.mode = Mode::Unset(idx); self.current.select(Some(idx), Some(false)); } else { self.mode = Mode::Select(idx); diff --git a/src/core/tasks/scheduler.rs b/src/core/tasks/scheduler.rs index 3b8ca5bb..0ce07d0e 100644 --- a/src/core/tasks/scheduler.rs +++ b/src/core/tasks/scheduler.rs @@ -11,7 +11,7 @@ use crate::{config::open::Opener, emit, misc::unique_path}; #[derive(Default)] pub(super) struct Running { - incer: usize, + incr: usize, hooks: BTreeMap BoxFuture<'static, ()>) + Send + Sync>>, all: BTreeMap, @@ -19,9 +19,9 @@ pub(super) struct Running { impl Running { fn add(&mut self, name: String) -> usize { - self.incer += 1; - self.all.insert(self.incer, Task::new(self.incer, name)); - self.incer + self.incr += 1; + self.all.insert(self.incr, Task::new(self.incr, name)); + self.incr } #[inline] diff --git a/src/misc/fns.rs b/src/misc/fns.rs index 8cb708e4..86c98d02 100644 --- a/src/misc/fns.rs +++ b/src/misc/fns.rs @@ -59,7 +59,7 @@ pub async fn unique_path(mut p: PathBuf) -> PathBuf { } #[inline] -pub fn optinal_bool(s: &str) -> Option { +pub fn optional_bool(s: &str) -> Option { if s == "true" { Some(true) } else if s == "false" { diff --git a/src/ui/dispatcher.rs b/src/ui/dispatcher.rs index 6ce822db..19641445 100644 --- a/src/ui/dispatcher.rs +++ b/src/ui/dispatcher.rs @@ -69,12 +69,12 @@ impl Executor { // Selection "select" => { let state = exec.named.get("state").cloned().unwrap_or("none".to_string()); - cx.manager.active_mut().select(optinal_bool(&state)) + cx.manager.active_mut().select(optional_bool(&state)) } - "visual_mode" => cx.manager.active_mut().visual_mode(exec.named.contains_key("unselect")), + "visual_mode" => cx.manager.active_mut().visual_mode(exec.named.contains_key("unset")), "select_all" => { let state = exec.named.get("state").cloned().unwrap_or("none".to_string()); - cx.manager.active_mut().select_all(optinal_bool(&state)) + cx.manager.active_mut().select_all(optional_bool(&state)) } // Operation