diff options
author | DLFW <daniel@llin.info> | 2022-08-30 19:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 13:46:22 -0400 |
commit | 826e24eaf4a10921bdd087079c4d7330896b79c2 (patch) | |
tree | ecce44e4243f7b58d110e071759a5ec32c6be2fb /src/context | |
parent | edf620b4aceaaadffedd14d85d120d485a6ad8f3 (diff) |
Add "Visual-Mode" (#192)
* Add "Visual-Mode"
This adds a "visual-mode" file selection feature where a range-selection follows the file-cursor.
Description of usage is added to the docs.
Also, the "normal" and the new "visual-mode-selection" are now preserved
when a `DirList` is reloaded.
Wrap-up of changes:
* Add command `toggle_visual`, mapped to `V`
* Add command `escape`, mapped to `ESCAPE`
* Add style `[visual_mode_selection]` for file entries which are
"temporarily" selected by visual-mode
* For `JoshutoDirEntry`, the attribute `selected` has been renamed to
`permanent_selected`, and a second selection-attribute
`visual_mode_selected` has been added. "Setters" and "getters" have
been adapted/added accordingly. The former "getter" for the `selecetd`
attribute still exists and returns `True` for an entry which is
"permanant selected" _or_ "visual-mode selected". So any higher logic
which acts on selected files does not need to care about "how" and
entry is selected.
* Each `JoshutoDirList` has an optional index of the file where
visual-mode has been entered and re-calculates the "visual-mode
selecetd" status for each entry any time the cursor-index changes.
* The footer has been extended so it shows a "VIS" marker when the user
is in visual-mode.
This implementation of visual-mode is a bit different from the ranger
one, where the visual-selection is turned into a "normal selection" when
a command (like `copy-files`) is issued. This implementation keeps
both selections separate until the user toggles back to "normal mode".
Only then the visual-selection is taken over to the "normal selection".
The user also can withdraw the visual-selection with `escape`.
The `escape` command may be used also for other "reset"-actions in the
future.
* fix syntax for Rust stable
* cargo clippy
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/app_context.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/context/app_context.rs b/src/context/app_context.rs index 364b5b1..66ffbc6 100644 --- a/src/context/app_context.rs +++ b/src/context/app_context.rs @@ -17,7 +17,7 @@ use crate::Args; use notify::{RecursiveMode, Watcher}; use std::path; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct UiContext { pub layout: Vec<Rect>, } |