diff options
author | Michal Mieczkowski <mieczkowski@fastmail.com> | 2019-07-10 18:44:43 +0200 |
---|---|---|
committer | Michal Mieczkowski <mieczkowski@fastmail.com> | 2019-07-10 18:44:43 +0200 |
commit | 4c27e680e05256107f46d6e7ae57099fa5773521 (patch) | |
tree | 37040ac3fe30aa604d2c77fd576c758019c8ab37 /components/script/textinput.rs | |
parent | d0bd2d5e44d4006b00ef53f351945d01e1c8458d (diff) | |
download | servo-4c27e680e05256107f46d6e7ae57099fa5773521.tar.gz servo-4c27e680e05256107f46d6e7ae57099fa5773521.zip |
Add clipboard cut functionality
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r-- | components/script/textinput.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<T: ClipboardProvider> TextInput<T> { 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); |