Skip to content

Commit

Permalink
Handle number pad del key correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
shartrec committed Jul 23, 2024
1 parent dcdf130 commit 979f04b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::core::clipboard::{self, Clipboard};
use crate::core::event::{self, Event};
use crate::core::keyboard;
use crate::core::keyboard::key;
use crate::core::keyboard::{key, Location};
use crate::core::layout::{self, Layout};
use crate::core::mouse;
use crate::core::renderer;
Expand Down Expand Up @@ -761,7 +761,7 @@ impl Update {
key,
modifiers,
text,
..
location,
} if state.is_focused => {
match key.as_ref() {
keyboard::Key::Named(key::Named::Enter) => {
Expand All @@ -770,7 +770,9 @@ impl Update {
keyboard::Key::Named(key::Named::Backspace) => {
return edit(Edit::Backspace);
}
keyboard::Key::Named(key::Named::Delete) => {
keyboard::Key::Named(key::Named::Delete) =>
if location != Location::Numpad || text == None
{
return edit(Edit::Delete);
}
keyboard::Key::Named(key::Named::Escape) => {
Expand Down

0 comments on commit 979f04b

Please sign in to comment.