diff --git a/egui/src/widgets/text_edit.rs b/egui/src/widgets/text_edit.rs index da8e6e5c..6f00003f 100644 --- a/egui/src/widgets/text_edit.rs +++ b/egui/src/widgets/text_edit.rs @@ -1135,6 +1135,15 @@ fn on_key_press( Some(CCursorPair::one(ccursor)) } + Key::ArrowLeft | Key::ArrowRight if modifiers.is_none() && !cursorp.is_empty() => { + if key == Key::ArrowLeft { + *cursorp = CursorPair::one(cursorp.sorted()[0]); + } else { + *cursorp = CursorPair::one(cursorp.sorted()[1]); + } + None + } + Key::ArrowLeft | Key::ArrowRight | Key::ArrowUp | Key::ArrowDown | Key::Home | Key::End => { move_single_cursor(&mut cursorp.primary, galley, key, modifiers); if !modifiers.shift {