diff options
author | _ <a@b.co> | 2020-08-31 21:37:40 +0530 |
---|---|---|
committer | _ <a@b.co> | 2020-08-31 21:54:06 +0530 |
commit | f73071b3ecf88166b669eebb13762131d63a169a (patch) | |
tree | 0c4ee16c0fd4e382e4fc40ea74a814c034032c17 /src/browser/browser_state.rs | |
parent | c3f4dd5362bd10b4e0aae26c66e77716f9bd773e (diff) |
Draft: Clipboard support, copy to 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 88f8e74..898f2b5 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -328,6 +328,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, |