mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 15:44:31 +03:00
Retain selection's head (as opposed to its end) on insertion
This makes a difference when an edit spans two excerpts and the selection start won't necessarily be the same as the selection end after the edit.
This commit is contained in:
parent
23836eb251
commit
e46d1549d6
@ -2382,7 +2382,7 @@ impl Editor {
|
||||
old_selections
|
||||
.iter()
|
||||
.map(|s| {
|
||||
let anchor = snapshot.anchor_after(s.end);
|
||||
let anchor = snapshot.anchor_after(s.head());
|
||||
s.map(|_| anchor)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
|
Loading…
Reference in New Issue
Block a user