diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-03-25 15:30:26 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-03-25 15:30:26 +0100 |
commit | ab5cdc72a1160aff1743d809c674c362399b3e9a (patch) | |
tree | 3c6d6c4b76e14647a35da170060068f059435f4c /src/event_exec.rs | |
parent | 923de5895cb78e847e72acc4c2f3286c7281adb8 (diff) |
refactor jump to flagged file
Diffstat (limited to 'src/event_exec.rs')
-rw-r--r-- | src/event_exec.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index 7fe1610..47609ed 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -307,15 +307,9 @@ impl EventExec { Some(parent) => parent, None => &jump_target, }; - let tab = status.selected(); - tab.input.clear(); - tab.history.push(target_dir); - tab.path_content - .change_directory(target_dir, &tab.filter, tab.show_hidden)?; - let index = tab.find_jump_index(&jump_target).unwrap_or_default(); - tab.path_content.select_index(index); - tab.set_window(); - tab.scroll_to(index); + status.selected().set_pathcontent(target_dir)?; + let index = status.selected().path_content.select_file(&jump_target); + status.selected().scroll_to(index); Ok(()) } @@ -327,7 +321,7 @@ impl EventExec { colors: &Colors, ) -> Result<()> { Self::_exec_confirmed_action(status, confirmed_action, colors)?; - status.selected().set_mode(Mode::Normal); + status.selected().reset_mode(); Ok(()) } |