From 6ca97788b2b7c1b24c7371e1e0c8bcef505bcf60 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Mon, 6 Apr 2020 15:22:52 +0200 Subject: [PATCH] implement ctrl + del on text-input --- native/src/widget/text_input.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 1c07e25246..ae3d74ae65 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -358,6 +358,21 @@ where messages.push(message); } keyboard::KeyCode::Delete => { + if platform::is_jump_modifier_pressed(modifiers) + && self.state.cursor.selection().is_none() + { + if self.is_secure { + let cursor_pos = self.state.cursor.end(&self.value); + self.state + .cursor + .select_range(cursor_pos, self.value.len()); + } else { + self.state + .cursor + .select_right_by_words(&self.value); + } + } + let mut editor = Editor::new(&mut self.value, &mut self.state.cursor);