diff options
author | Canop <cano.petrole@gmail.com> | 2020-09-07 17:36:03 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-09-07 17:36:03 +0200 |
commit | 0335393a817285fe9ac42f18fe9a6f539c8a8d9e (patch) | |
tree | fbfe470f8a60bdd7a0c483bd3ffeb47a7339e6d4 /src/browser/browser_state.rs | |
parent | 91ace1c6d441be69220ffb687eb871f5b79cd606 (diff) | |
parent | f73071b3ecf88166b669eebb13762131d63a169a (diff) |
Merge branch 'clipboard' of https://github.com/asdf8dfafjk/broot into asdf8dfafjk-clipboard
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 9cd833b..3562fe5 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -331,6 +331,14 @@ impl AppState for BrowserState { AppStateCmdResult::PopState } } + Internal::copy_path => { + let path = &self.displayed_tree().selected_line().target(); + cli_clipboard::set_contents( path.to_string_lossy().into_owned() ) + .map_err( |_| ProgramError::ClipboardError )? + ; + + AppStateCmdResult::Keep + } Internal::focus => internal_focus::on_internal( internal_exec, input_invocation, |