From 4c27e680e05256107f46d6e7ae57099fa5773521 Mon Sep 17 00:00:00 2001 From: Michal Mieczkowski Date: Wed, 10 Jul 2019 18:44:43 +0200 Subject: Add clipboard cut functionality --- components/script/textinput.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'components/script/textinput.rs') diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 1817667aa88..c2a5575e9ec 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -877,6 +877,13 @@ impl TextInput { self.select_all(); KeyReaction::RedrawSelection }) + .shortcut(CMD_OR_CONTROL, 'X', || { + if let Some(text) = self.get_selection_text() { + self.clipboard_provider.set_clipboard_contents(text); + self.delete_char(Direction::Backward); + } + KeyReaction::DispatchInput + }) .shortcut(CMD_OR_CONTROL, 'C', || { if let Some(text) = self.get_selection_text() { self.clipboard_provider.set_clipboard_contents(text); -- cgit v1.2.3