about summary refs log tree commit diff
path: root/Functions/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Zle')
-rw-r--r--Functions/Zle/replace-string9
1 files changed, 9 insertions, 0 deletions
diff --git a/Functions/Zle/replace-string b/Functions/Zle/replace-string
index a3416a403..68aac28d2 100644
--- a/Functions/Zle/replace-string
+++ b/Functions/Zle/replace-string
@@ -4,6 +4,9 @@ setopt extendedglob
 autoload -Uz read-from-minibuffer replace-string-again
 
 local p1  p2
+integer changeno=$UNDO_CHANGE_NO
+
+{
 
 if [[ -n $_replace_string_src ]]; then
   p1="[$_replace_string_src -> $_replace_string_rep]"$'\n'
@@ -30,4 +33,10 @@ if [[ -n $REPLY ]]; then
   typeset -g _replace_string_rep=$REPLY
 fi
 
+} always {
+  # Undo back to the original line; we don't want the
+  # undo history of editing the strings left.
+  zle undo $changeno
+}
+
 replace-string-again $curwidget