diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-11-01 16:39:32 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-11-01 16:39:32 +0100 |
commit | 6b1d5d4d204f11204fca02b2678c96fa3aacbf91 (patch) | |
tree | 380b3c08492602a89788ff3a6a4ca6fd4822e77a | |
parent | 2abff6a9486dbd2b300729c7fe0a7c91c24d60da (diff) |
FIX: couldn't reset view after exiting preview second window
-rw-r--r-- | src/event_exec.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index e22f2f8..0c48fd8 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -979,7 +979,13 @@ impl EventAction { /// Toggle the second pane between preview & normal mode (files). pub fn toggle_preview_second(status: &mut Status) -> Result<()> { status.preview_second = !status.preview_second; - status.update_second_pane_for_preview() + if status.preview_second { + status.set_second_pane_for_preview()?; + } else { + status.tabs[1].reset_mode(); + status.tabs[1].refresh_view()?; + } + Ok(()) } /// Set the current selected file as wallpaper with `nitrogen`. |