Add clipboard cut functionality

This commit is contained in:
Michal Mieczkowski 2019-07-10 18:44:43 +02:00
parent d0bd2d5e44
commit 4c27e680e0

View file

@ -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);