diff options
author | qkzk <qu3nt1n@gmail.com> | 2024-11-10 22:34:47 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2024-11-10 22:34:47 +0100 |
commit | 9b9322af9fe234ab228a075162dbc0ff382dd23f (patch) | |
tree | 905679260506471ce063c80c67b8613f6cd26849 | |
parent | 18bdd48e95a8fe779de3f0ddad6cc06ae3b7c8a8 (diff) |
FIX: leaving dual mode does't hide ueberzug
-rw-r--r-- | development.md | 4 | ||||
-rw-r--r-- | src/app/status.rs | 6 | ||||
-rw-r--r-- | src/event/event_action.rs | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/development.md b/development.md index be7230a5..c4e9c940 100644 --- a/development.md +++ b/development.md @@ -1462,8 +1462,6 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. % cargo rustdoc -- -D missing_docs 2>&1 | grep error | wc -l 492 ``` -- [ ] static lines (from display, menu, content per mode) can be cut out of the window. Should use the space on the right -- [ ] why have a bottom line in menu if the binds are always explained ? - [x] shell_command_parser refactor. Won't do. It's clean already. I need a lexer & a parser. I couldn't use pipes or redirections, now I can. - [x] new shell command expansion %c current clipboard - [ ] menu / rendering / widgets @@ -1518,6 +1516,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [ ] BUG: resize change dual / preview - first attempt didn't fix + - can't reproduce - [ ] Walkdir::new in tree building instead of exploring by hand - require to rewrite everything just to avoid testing depth myself. @@ -1526,6 +1525,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [x] caching video previews - [x] Case insensitive search - [x] FIX --keybinds has wrong display, keybinds should be shortened. +- [x] FIX: leaving dual mode does't hide ueberzug ## TODO diff --git a/src/app/status.rs b/src/app/status.rs index 79fde902..a97f9cd0 100644 --- a/src/app/status.rs +++ b/src/app/status.rs @@ -414,6 +414,12 @@ impl Status { self.term_size().0 } + pub fn clear_preview_right(&mut self) { + if self.session.dual() && self.session.preview() && !self.tabs[1].preview.is_empty() { + self.tabs[1].preview = PreviewBuilder::empty() + } + } + /// Refresh the current view, reloading the files. Move the selection to top. pub fn refresh_view(&mut self) -> Result<()> { self.refresh_status()?; diff --git a/src/event/event_action.rs b/src/event/event_action.rs index 0b9ac581..40259232 100644 --- a/src/event/event_action.rs +++ b/src/event/event_action.rs @@ -77,6 +77,7 @@ impl EventAction { /// Toggle between dualpane and single pane. Does nothing if the width /// is too low to display both panes. pub fn toggle_dualpane(status: &mut Status) -> Result<()> { + status.clear_preview_right(); status.session.toggle_dual(); status.select_left(); Ok(()) |