mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
da57ddb7c8
The change in control required for sourcing the command file can confuse the simulated interactive input
77 lines
1.5 KiB
Text
77 lines
1.5 KiB
Text
# Tests of the vi mode of ZLE
|
|
|
|
%prep
|
|
if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
|
|
. $ZTST_srcdir/comptest
|
|
comptestinit -v -z $ZTST_testdir/../Src/zsh
|
|
else
|
|
ZTST_unimplemented="the zsh/zpty module is not available"
|
|
fi
|
|
|
|
%test
|
|
|
|
zletest $'word\euaend'
|
|
0:undo initial change
|
|
>BUFFER: end
|
|
>CURSOR: 3
|
|
|
|
zletest $'text\e.'
|
|
0:repeat initial edit
|
|
>BUFFER: text
|
|
>text
|
|
>CURSOR: 8
|
|
|
|
zpty_run 'print -z before'
|
|
zletest $'after\e.'
|
|
0:repeat initial edit with non-blank starting line
|
|
>BUFFER: beforeafterafter
|
|
>CURSOR: 15
|
|
|
|
zpty_run 'setopt overstrike;print -z bung'
|
|
zletest $'ing\e2|.'
|
|
0:repeat initial edit with overstrike set
|
|
>BUFFER: binging
|
|
>CURSOR: 3
|
|
|
|
zpty_run '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
|
|
|
|
zpty_run 'bindkey -a "^K" redo'
|
|
zletest $'123\C-_\e\C-k'
|
|
0:undo in insert mode, redo in command
|
|
>BUFFER: 123
|
|
>CURSOR: 2
|
|
|
|
zpty_run 'bindkey "^Y" redo'
|
|
zletest $'pre\eA123\C-_\C-y\eu'
|
|
0:undo and redo in insert mode, undo in command
|
|
>BUFFER: pre
|
|
>CURSOR: 2
|
|
|
|
zpty_run '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
|
|
>CURSOR: 2
|
|
|
|
%clean
|
|
|
|
zmodload -ui zsh/zpty
|