Skip to content

Commit

Permalink
feat: adding more built-in commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sminez committed Nov 3, 2024
1 parent dba6493 commit 0fcb0ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/editor/built_in_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!')",
Expand Down
4 changes: 4 additions & 0 deletions src/editor/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ fn parse_command(input: &str, active_buffer_id: usize, cwd: &Path) -> Result<Act
},
"bn" | "buffer-next" => 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() {
Expand Down

0 comments on commit 0fcb0ce

Please sign in to comment.