about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2014-02-05 23:18:26 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2014-02-05 23:18:26 +0100
commit137b15a44704917ff2d765d574714accc7e3d5b1 (patch)
treefe8187d23eb385c7159eb0a50a7009e6e4b842ee /Test
parente1bc9d0a44da9c27c5558767cdb75da1a3424a4b (diff)
downloadzsh-137b15a44704917ff2d765d574714accc7e3d5b1.tar.gz
zsh-137b15a44704917ff2d765d574714accc7e3d5b1.tar.xz
zsh-137b15a44704917ff2d765d574714accc7e3d5b1.zip
32355: document and test vi mode undo changes
Diffstat (limited to 'Test')
-rw-r--r--Test/X02zlevi.ztst57
-rw-r--r--Test/comptest2
2 files changed, 58 insertions, 1 deletions
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index d4a125f21..fe55d8a26 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -10,6 +10,63 @@
 
 %test
 
+  zletest $'word\euaend'
+0:undo initial change
+>BUFFER: end
+>CURSOR: 3
+
+  zletest $'text\e.'
+0:repeat initial edit
+>BUFFER: text
+>text
+>CURSOR: 8
+
+  comptesteval 'print -z before'
+  zletest $'after\e.'
+0:repeat initial edit with non-blank starting line
+>BUFFER: beforeafterafter
+>CURSOR: 15
+
+  comptesteval 'setopt overstrike;print -z bung'
+  zletest $'ing\e2|.'
+0:repeat initial edit with overstrike set
+>BUFFER: binging
+>CURSOR: 3
+
+  comptesteval 'bindkey "^_" undo'
+  zletest $'undoc\037e'
+0:use of undo in vi insert mode
+>BUFFER: undoe
+>CURSOR: 5
+
+  zletest $'one\euatwo\e0clthree'
+0:vi mode undo of initial and subsequent change
+>BUFFER: threewo
+>CURSOR: 5
+
+  zletest $'xxx\euiyyy\euAz'
+0:undo invoked twice
+>BUFFER: z
+>CURSOR: 1
+
+  comptesteval 'bindkey -a "^R" redo'
+  zletest $'123\C-_\e\C-r'
+0:undo in insert mode, redo in command
+>BUFFER: 123
+>CURSOR: 2
+
+  comptesteval 'bindkey "^Y" redo'
+  zletest $'pre\eA123\C-_\C-y\eu'
+0:undo and redo in insert mode, undo in command
+>BUFFER: pre
+>CURSOR: 2
+
+  comptesteval 'bindkey "^Gu" split-undo'
+  zletest $'one\C-gutwo\eu'
+0:split the undo sequence
+>BUFFER: one
+>CURSOR: 2
+
   zletest $'one two\ebmt3|`tx``'
 0:setting mark and returning to original position
 >BUFFER: one wo
diff --git a/Test/comptest b/Test/comptest
index 10814d635..f1c5af01f 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -72,8 +72,8 @@ zle-finish () {
   print -lr "<WIDGET><finish>" "BUFFER: $BUFFER" "CURSOR: $CURSOR"
   (( region_active )) && print -lr "MARK: $MARK"
   zle -K main
-  zle kill-whole-line
   zle clear-screen
+  zle send-break
   zle -R
 }
 zle -N expand-or-complete-with-report