mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: create new snap on replace
This commit is contained in:
parent
44755143db
commit
14f3ca55d2
1 changed files with 1 additions and 3 deletions
|
|
@ -14,8 +14,6 @@ impl Input {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: need to create a new snap for each replace operation, otherwise we
|
|
||||||
// can't undo/redo it with `u` and `Ctrl-r`
|
|
||||||
pub fn replace_str(&mut self, s: &str) {
|
pub fn replace_str(&mut self, s: &str) {
|
||||||
let snap = self.snap_mut();
|
let snap = self.snap_mut();
|
||||||
|
|
||||||
|
|
@ -25,7 +23,7 @@ impl Input {
|
||||||
snap.mode = InputMode::Normal;
|
snap.mode = InputMode::Normal;
|
||||||
snap.value.replace_range(start..end, s);
|
snap.value.replace_range(start..end, s);
|
||||||
|
|
||||||
self.flush_value();
|
self.snaps.tag(self.limit()).then(|| self.flush_value());
|
||||||
render!();
|
render!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue