summaryrefslogtreecommitdiffstats
path: root/src/verb
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-05-04 20:40:46 +0200
committerCanop <cano.petrole@gmail.com>2022-05-04 20:40:46 +0200
commitc76be097397df82ed62582546ef76bbbf5203819 (patch)
tree6cd7b03037e30b649a4e3be41d5ca5fe6935ca1f /src/verb
parente737f692ffaa4808813b37c6c51b06e6195cb875 (diff)
add the :stage_all_files internal
Default mapping: ctrl-a
Diffstat (limited to 'src/verb')
-rw-r--r--src/verb/builtin.rs11
-rw-r--r--src/verb/internal.rs1
-rw-r--r--src/verb/internal_focus.rs3
3 files changed, 10 insertions, 5 deletions
diff --git a/src/verb/builtin.rs b/src/verb/builtin.rs
index 69fc310..fbc9edf 100644
--- a/src/verb/builtin.rs
+++ b/src/verb/builtin.rs
@@ -91,9 +91,12 @@ pub fn builtin_verbs() -> Vec<Verb> {
internal(open_preview),
internal(close_preview),
internal(toggle_preview),
- internal(preview_image),
- internal(preview_text),
- internal(preview_binary),
+ internal(preview_image)
+ .with_shortcut("img"),
+ internal(preview_text)
+ .with_shortcut("txt"),
+ internal(preview_binary)
+ .with_shortcut("hex"),
internal(close_panel_ok),
internal(close_panel_cancel)
.with_key(key!(ctrl-w)),
@@ -206,6 +209,8 @@ pub fn builtin_verbs() -> Vec<Verb> {
.with_key(key!('+')),
internal(unstage)
.with_key(key!('-')),
+ internal(stage_all_files)
+ .with_key(key!(ctrl-a)),
internal(toggle_stage)
.with_key(key!(ctrl-g)),
internal(open_staging_area).with_shortcut("osa"),
diff --git a/src/verb/internal.rs b/src/verb/internal.rs
index a43591a..cfbfdf6 100644
--- a/src/verb/internal.rs
+++ b/src/verb/internal.rs
@@ -125,6 +125,7 @@ Internals! {
open_staging_area: "open the staging area" false,
close_staging_area: "close the staging area panel" false,
toggle_staging_area: "open/close the staging area panel" false,
+ stage_all_files: "stage all matching files" true,
toggle_stage: "add or remove selection to staging area" true,
toggle_counts: "toggle showing number of files in directories" false,
toggle_dates: "toggle showing last modified dates" false,
diff --git a/src/verb/internal_focus.rs b/src/verb/internal_focus.rs
index 9fbee13..c1e2028 100644
--- a/src/verb/internal_focus.rs
+++ b/src/verb/internal_focus.rs
@@ -67,12 +67,11 @@ pub fn new_panel_on_path(
} else {
let path = path::closest_dir(&path);
match BrowserState::new(path, tree_options, screen, con, &Dam::unlimited()) {
- Ok(Some(os)) => CmdResult::NewPanel {
+ Ok(os) => CmdResult::NewPanel {
state: Box::new(os),
purpose,
direction,
},
- Ok(None) => CmdResult::Keep, // this isn't supposed to happen
Err(e) => CmdResult::DisplayError(e.to_string()),
}
}