diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/image/image_view.rs | 1 | ||||
-rw-r--r-- | src/task_sync.rs | 7 | ||||
-rw-r--r-- | src/verb/builtin.rs | 6 | ||||
-rw-r--r-- | website/docs/tricks.md | 6 |
5 files changed, 19 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index df48a3c..d27c986 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### next version - completion of the "client-server" feature (see client-server.md) - removing a filter using the esc key on a tree tries to keep the selection +- :focus now has a shortcut for when a file is selected too: ctrl-f <a name="v0.20.0"></a> ### v0.20.0 - 2020-08-16 diff --git a/src/image/image_view.rs b/src/image/image_view.rs index ce1968c..30b7c3d 100644 --- a/src/image/image_view.rs +++ b/src/image/image_view.rs @@ -35,6 +35,7 @@ impl ImageView { let img = time!( Debug, "decode image", + path, Reader::open(&path)?.decode()? ); let (width, height) = img.dimensions(); diff --git a/src/task_sync.rs b/src/task_sync.rs index fcd121d..5bef0f7 100644 --- a/src/task_sync.rs +++ b/src/task_sync.rs @@ -71,7 +71,12 @@ impl Dam { /// launch the computation on a new thread and return /// when it finishes or when a new event appears on - /// the channel + /// the channel. + /// Note that the task itself isn't interrupted so that + /// this should not be used when many tasks are expected + /// to be launched (or it would result in many working + /// threads uselessly working in the background) : use + /// dam.has_event from inside the task whenever possible. pub fn try_compute<V: Send + 'static, F: Send + 'static + FnOnce() -> ComputationResult<V>>( &mut self, f: F, diff --git a/src/verb/builtin.rs b/src/verb/builtin.rs index ead2e6e..294bb79 100644 --- a/src/verb/builtin.rs +++ b/src/verb/builtin.rs @@ -38,7 +38,11 @@ pub fn builtin_verbs() -> Vec<Verb> { ) .unwrap() .with_shortcut("cpp"), - Verb::internal(focus), // hardcoded Enter + // :focus is also hardcoded on Enter on directories + // but ctrl-f is useful for focusing on a file's parent + // (and keep the filter) + Verb::internal(focus) + .with_control_key('f'), Verb::internal(help).with_key(F1).with_shortcut("?"), Verb::internal(line_down).with_key(DOWN), Verb::internal(line_up).with_key(UP), diff --git a/website/docs/tricks.md b/website/docs/tricks.md index cc61263..e45577c 100644 --- a/website/docs/tricks.md +++ b/website/docs/tricks.md @@ -37,6 +37,12 @@ When you hit `enter` on a directory, it's focused and the filter is reset. If you want to keep the filter, for example to search deeper, you may use `:open_stay_filter` instead (or its shortcut `:osf` and you can bind it to a key shortcut). +## Go to the directory containing the selected file + +Suppose you filter to find a file, and it's in a deeper directory, you may want to see it "more closely", that is, keeping the filter, to make its parent directory the current root. + +This can be done with the `:focus` verb which can be called with <kbd>ctrl</kbd><kbd>f</kbd>. + ## Run a script or program from broot If your system is normally configured, doing `alt`-`enter` on an executable will close broot and executes the file. |