summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_utils.c6
-rw-r--r--Src/Zle/zle_vi.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 741f119d2..e95a34b95 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -1395,7 +1395,8 @@ static struct change *nextchanges, *endnextchanges;
 
 /* incremented to provide a unique change number */
 
-static zlong undo_changeno;
+/**/
+zlong undo_changeno;
 
 /* If non-zero, the last increment to undo_changeno was for the variable */
 
@@ -1668,8 +1669,7 @@ splitundo(char **args)
 {
     if (vistartchange >= 0) {
 	mergeundo();
-	vistartchange = (curchange && curchange->prev) ?
-	    curchange->prev->changeno : 0;
+	vistartchange = undo_changeno;
     }
     handleundo();
     return 0;
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 18c76f917..d74b40d62 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -109,7 +109,7 @@ startvitext(int im)
 {
     startvichange(im);
     selectkeymap("main", 1);
-    vistartchange = (curchange && curchange->prev) ? curchange->prev->changeno : 0;
+    vistartchange = undo_changeno;
     viinsbegin = zlecs;
 }
 
@@ -403,7 +403,7 @@ vichange(UNUSED(char **args))
 	forekill(c2 - zlecs, CUT_RAW);
 	selectkeymap("main", 1);
 	viinsbegin = zlecs;
-	vistartchange = (curchange && curchange->prev) ? curchange->prev->changeno : 0;
+	vistartchange = undo_changeno;
     }
     return ret;
 }