From 80323244707e3d934cd4d04f9074ee9618e0cd28 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 6 Jun 2023 10:13:45 +0200 Subject: [PATCH] Prevent moving across excerpts on `Editor::delete` --- crates/editor/src/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 0eefa7e0985890dc75a7f060a440d26a4922cec1..9f2c0c86ff0a962c339423dd70204fb02e5df317 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -3557,7 +3557,9 @@ impl Editor { s.move_with(|map, selection| { if selection.is_empty() && !line_mode { let cursor = movement::right(map, selection.head()); - selection.set_head(cursor, SelectionGoal::None); + selection.end = cursor; + selection.reversed = true; + selection.goal = SelectionGoal::None; } }) });