diff options
author | Canop <cano.petrole@gmail.com> | 2020-11-13 13:26:23 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-11-13 13:26:23 +0100 |
commit | 2fce268388ea71d8b4ed98facde6ce6c6b1d6a09 (patch) | |
tree | a8408e9d5ddfe308a32525b6cbf35c59ed6cf67b /src/browser/browser_state.rs | |
parent | 15c74c836b6b6e2a06d71358cca39bdb758148b0 (diff) |
`:line_up` and `:line_down` accept an optional count as argument
This allows verbs like this:
[[verbs]]
key = "ctrl-u"
invocation = "up4"
execution = ":line_up 4"
leave_broot = false
Fix #301
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 080452e..8e9d3f8 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -285,11 +285,13 @@ impl AppState for BrowserState { Internal::open_stay => self.open_selection_stay_in_broot(screen, con, bang, false)?, Internal::open_stay_filter => self.open_selection_stay_in_broot(screen, con, bang, true)?, Internal::line_down => { - self.displayed_tree_mut().move_selection(1, page_height); + let count = get_arg(input_invocation, internal_exec, 1); + self.displayed_tree_mut().move_selection(count, page_height); AppStateCmdResult::Keep } Internal::line_up => { - self.displayed_tree_mut().move_selection(-1, page_height); + let count = get_arg(input_invocation, internal_exec, 1); + self.displayed_tree_mut().move_selection(-count, page_height); AppStateCmdResult::Keep } Internal::previous_match => { |