Merge branch 'preserve-clipboard' into feature-clipboard-saving

This commit is contained in:
Federico Terzi 2019-12-13 23:00:24 +01:00
commit fc532d1a9c

View File

@ -205,8 +205,10 @@ impl <'a, S: KeyboardManager, C: ClipboardManager, M: ConfigManager<'a>, U: UIMa
} }
}, },
BackendType::Clipboard => { BackendType::Clipboard => {
let previous_clipboard_content = self.clipboard_manager.get_clipboard().unwrap_or(String::from(""));
self.clipboard_manager.set_clipboard(&target_string); self.clipboard_manager.set_clipboard(&target_string);
self.keyboard_manager.trigger_paste(&config.paste_shortcut); self.keyboard_manager.trigger_paste(&config.paste_shortcut);
self.clipboard_manager.set_clipboard(&previous_clipboard_content);
}, },
} }