mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Add clipboard cut functionality
This commit is contained in:
parent
d0bd2d5e44
commit
4c27e680e0
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue