diff options
author | Canop <cano.petrole@gmail.com> | 2020-06-23 18:19:14 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-06-23 18:19:14 +0200 |
commit | ed69d7b084788907d015332397cdb4c8e238f30c (patch) | |
tree | 359ed0a7ea4d3817df6976d0784af68a0bdb5f96 /src/browser/browser_state.rs | |
parent | 440c136f1f7e029720b68769c2569785fd52d41a (diff) |
restore broot on return from an application launched in terminal
This might
fix #38
fix #144
fix #158
but more tests would be needed and some applications might have
problems.
I mostly tested by launching vi from broot with
`leave_broot = false`: vi runs correctly and broot is OK when
I quit broot.
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 9fedacd..d46b8e9 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -156,6 +156,7 @@ impl BrowserState { pub fn open_selection_quit_broot( &mut self, + w: &mut W, con: &AppContext, ) -> Result<AppStateCmdResult, ProgramError> { let tree = self.displayed_tree(); @@ -164,7 +165,7 @@ impl BrowserState { TreeLineType::File => make_opener(line.path.clone(), line.is_exe(), con), TreeLineType::Dir | TreeLineType::SymLinkToDir(_) => { Ok(if con.launch_args.cmd_export_path.is_some() { - CD.to_cmd_result(&line.target(), &None, &None, con)? + CD.to_cmd_result(w, &line.target(), &None, &None, con)? } else { AppStateCmdResult::DisplayError( "This feature needs broot to be launched with the `br` script".to_owned(), @@ -368,6 +369,7 @@ impl AppState for BrowserState { fn on_internal( &mut self, + w: &mut W, internal_exec: &InternalExecution, input_invocation: Option<&VerbInvocation>, trigger_type: TriggerType, @@ -429,7 +431,7 @@ impl AppState for BrowserState { } Internal::open_stay => self.open_selection_stay_in_broot(screen, con, bang, false)?, Internal::open_stay_filter => self.open_selection_stay_in_broot(screen, con, bang, true)?, - Internal::open_leave => self.open_selection_quit_broot(con)?, + Internal::open_leave => self.open_selection_quit_broot(w, con)?, Internal::line_down => { self.displayed_tree_mut().move_selection(1, page_height); AppStateCmdResult::Keep |