Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Prevent moving across excerpts on `Editor::delete`

Antonio Scandurra80323244707e
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 0eefa7e0985..9f2c0c86ff0 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;
}
})
});