Merge pull request #268 from FabianLars/ctrl-del

implement ctrl + del on text-input
This commit is contained in:
Héctor Ramón 2020-04-07 04:39:16 +02:00 committed by GitHub
commit 703beae05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,6 +358,21 @@ where
messages.push(message); messages.push(message);
} }
keyboard::KeyCode::Delete => { 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 = let mut editor =
Editor::new(&mut self.value, &mut self.state.cursor); Editor::new(&mut self.value, &mut self.state.cursor);