implement ctrl + del on text-input

This commit is contained in:
FabianLars 2020-04-06 15:22:52 +02:00
parent ad0a6c4c10
commit 6ca97788b2

View File

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