From 0fcb0ced4310f7270f3b120e71da476d76b192a9 Mon Sep 17 00:00:00 2001 From: Innes Anderson-Morrison Date: Sun, 3 Nov 2024 09:33:51 +0000 Subject: [PATCH] feat: adding more built-in commands --- src/editor/built_in_commands.rs | 4 ++++ src/editor/commands.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/editor/built_in_commands.rs b/src/editor/built_in_commands.rs index 86c7d0d..3af0e91 100644 --- a/src/editor/built_in_commands.rs +++ b/src/editor/built_in_commands.rs @@ -48,6 +48,10 @@ pub fn built_in_commands() -> Vec<(Vec<&'static str>, &'static str)> { ), (vec!["new-window"], "clone the current window as a new window at the end of the focused column"), (vec!["new-column"], "clone the current window as a new column"), + (vec!["next-window"], "move focus to the next window in the current column"), + (vec!["next-column"], "move focus to the next column"), + (vec!["prev-window"], "move focus to the previous window in the current column"), + (vec!["prev-column"], "move focus to the previous column"), ( vec!["echo"], "display the given string in the status line ('echo hello, world!')", diff --git a/src/editor/commands.rs b/src/editor/commands.rs index 3caad13..08edea2 100644 --- a/src/editor/commands.rs +++ b/src/editor/commands.rs @@ -27,6 +27,10 @@ fn parse_command(input: &str, active_buffer_id: usize, cwd: &Path) -> Result Ok(Single(NextBuffer)), "bp" | "buffer-prev" => Ok(Single(PreviousBuffer)), + "next-column" => Ok(Single(NextColumn)), + "next-window" => Ok(Single(NextWindowInColumn)), + "prev-column" => Ok(Single(PreviousColumn)), + "prev-window" => Ok(Single(PreviousWindowInColumn)), "cd" | "change-directory" => { if args.is_empty() {