diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-02 11:36:24 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-03-02 11:39:11 -0500 |
commit | fbf2f40d909a537b9c6e58926f03f648041d2c01 (patch) | |
tree | 9e79d64b705dd4dd79d01d4884760b9eb6ac1fa0 /src/commands/tab_switch.rs | |
parent | 18bcda1f84f91f59c0de62edf50c76f9ac32bf81 (diff) |
make sure preview panel reloads upon certain commands
Diffstat (limited to 'src/commands/tab_switch.rs')
-rw-r--r-- | src/commands/tab_switch.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/tab_switch.rs b/src/commands/tab_switch.rs index cf5131b..2929bd2 100644 --- a/src/commands/tab_switch.rs +++ b/src/commands/tab_switch.rs @@ -1,5 +1,6 @@ use crate::commands::{JoshutoCommand, JoshutoRunnable}; use crate::context::JoshutoContext; +use crate::preview; use crate::ui; #[derive(Clone, Debug)] @@ -27,10 +28,9 @@ impl TabSwitch { &context.hostname, ); } - ui::redraw_tab_view(&context.views.tab_win, &context); - - ncurses::doupdate(); + let curr_tab = &mut context.tabs[context.curr_tab_index]; + preview::preview_file(curr_tab, &context.views, &context.config_t); } } @@ -53,5 +53,6 @@ impl JoshutoRunnable for TabSwitch { new_index -= tab_len; } Self::tab_switch(new_index, context); + ncurses::doupdate(); } } |