vim: Fix readonly mode (#20264)
Closes #18854 Release Notes: - vim: Fixed `r`, `~` etc. appearing to modify readonly buffers
This commit is contained in:
parent
c10c35ffda
commit
803e5d4c9f
5 changed files with 14 additions and 37 deletions
|
@ -119,9 +119,7 @@ impl Vim {
|
|||
}
|
||||
}
|
||||
|
||||
editor.buffer().update(cx, |buffer, cx| {
|
||||
buffer.edit(edits, None, cx);
|
||||
});
|
||||
editor.edit(edits, cx);
|
||||
editor.set_clip_at_line_ends(true, cx);
|
||||
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
|
||||
if mode == Mode::VisualBlock {
|
||||
|
@ -220,9 +218,7 @@ impl Vim {
|
|||
s.select_ranges(anchors);
|
||||
});
|
||||
edits.sort_by_key(|(range, _)| range.start);
|
||||
editor.buffer().update(cx, |buffer, cx| {
|
||||
buffer.edit(edits, None, cx);
|
||||
});
|
||||
editor.edit(edits, cx);
|
||||
editor.set_clip_at_line_ends(true, cx);
|
||||
});
|
||||
});
|
||||
|
@ -320,9 +316,7 @@ impl Vim {
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
edits.sort_by_key(|(range, _)| range.start);
|
||||
editor.buffer().update(cx, |buffer, cx| {
|
||||
buffer.edit(edits, None, cx);
|
||||
});
|
||||
editor.edit(edits, cx);
|
||||
editor.set_clip_at_line_ends(true, cx);
|
||||
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
|
||||
s.select_anchor_ranges(stable_anchors);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue