Skip to content

Commit

Permalink
Merge pull request #268 from FabianLars/ctrl-del
Browse files Browse the repository at this point in the history
implement ctrl + del on text-input
  • Loading branch information
hecrj authored Apr 7, 2020
2 parents 6e38631 + 6ca9778 commit 703beae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions native/src/widget/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 703beae

Please sign in to comment.