summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-06-02 12:48:10 +0200
committerOliver Kiddle <opk@zsh.org>2016-06-02 12:48:10 +0200
commit3fdf1f16e34d22ebdb40bd411467f7b977ec8bb6 (patch)
treed8ca2020aadf115c206cbaf28cc862874a1bb60b /Src/Zle
parent8cf68f05ab1b13f147521ad64df34dae256e09fb (diff)
downloadzsh-3fdf1f16e34d22ebdb40bd411467f7b977ec8bb6.tar.gz
zsh-3fdf1f16e34d22ebdb40bd411467f7b977ec8bb6.tar.xz
zsh-3fdf1f16e34d22ebdb40bd411467f7b977ec8bb6.zip
38540: fix undo problem by not moving the current change when only undoing a history line change
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 68794c66a..80219a441 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -1589,9 +1589,14 @@ undo(char **args)
 	    break;
 	if (prev->changeno <= undo_limitno && !*args)
 	    return 1;
-	if (!unapplychange(prev) && last_change >= 0)
-	    unapplychange(prev);
-	curchange = prev;
+	if (!unapplychange(prev)) {
+	    if (last_change >= 0) {
+		unapplychange(prev);
+		curchange = prev;
+	    }
+	} else {
+	    curchange = prev;
+	}
     } while (last_change >= (zlong)0 || (curchange->flags & CH_PREV));
     setlastline();
     return 0;