diff --git a/yazi-core/src/input/commands/replace.rs b/yazi-core/src/input/commands/replace.rs index 20b77c08..20bc708a 100644 --- a/yazi-core/src/input/commands/replace.rs +++ b/yazi-core/src/input/commands/replace.rs @@ -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) { let snap = self.snap_mut(); @@ -25,7 +23,7 @@ impl Input { snap.mode = InputMode::Normal; snap.value.replace_range(start..end, s); - self.flush_value(); + self.snaps.tag(self.limit()).then(|| self.flush_value()); render!(); } }