Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: key delays in zle tests (was fix vi-indent and vi-swap-case)
- X-seq: zsh-workers 33699
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: key delays in zle tests (was fix vi-indent and vi-swap-case)
- Date: Mon, 17 Nov 2014 01:24:59 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1416183900; bh=sDJQAYiF+yOc+2ZJpCRIpqrPhHk4NxhqGWjXpKonasU=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=IMLfGqEBmj30fYL/8vEjSbSH3rKwzxC2wFJdh+aw3dLD1CWbFEefrTEmgoYPXFtkBObYTKZIzPQ5tqxKP/w6esAW8kUxXrdN9JQ46g4LBACjSPXoUSe4Z6QcV5aea19DE8GflZvGVLNf6KQfZZvDXPsiwmIykkVD/oQleuUjQagVKjFz1HUFaTYRNVv5yfoBzr1C8VhHUW7wwvoPSpAlRVk4UGX97yUIzAVah+J71bvKcsk8OhRqLJOsBL33YDVHC9XfOdLXjEox7Es6myyaBuTEWjnmKmbyWZZtGhFVpaQaygndAQeJ+6sH3rbkmnr9/FYJNu7dWufxmdzd0hLJqQ==
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=pkKf6EQp2pwmNtreLFU2++PhFgG37RkZ0/Qvfm4MovNeNuRmEWAzgLOZImH9xsB3oQQlc1zdinBBdZMX0IVRF3pyz9Xa27xnEt/ppePAN9U/ItHrfuEhfikVR38SDzvZ50nx9BP6L+tAZYjHDUsmJ3eRv4Cz0Ff8Ap9xRBdzx9yfhcwLPBBGyycug7hYAKpExnvGQwLYiR3g9ygm4w5wJdUeWbEVT1jT2+FQt0nNiM6bosDruC2u/Jvm69Khh5Phx81nXEIVGosd1fmq4mPAB6hUWb/KzP+9mcsfELJieEPP6E1dYGvh63LC3+rjx555k6+NU1ht7cMkyBMMKI+daQ==;
- In-reply-to: <4968.1416034252@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <4968.1416034252@thecus.kiddle.eu>
I wrote:
> No test for vi-swap-case because _bash_completions is getting in
> the way to do username completion on \e~. Any idea how we can get
> zletest to sleep for a $KEYTIMEOUT delay?
This allows zletest to take multiple arguments and it puts a delay
between each argument. I set KEYTIMEOUT to 1 to avoid slowing the tests
needlessly. We can always increase it if necessary.
For the delay, I've had to use read because sleep with a fraction
argument is not portable. Maybe we should make it a loadable builtin.
On the subject of KEYTIMEOUT, any thoughts on perhaps adding a separate
ESCTIMEOUT to set a different timeout specifically for an Escape (or
some other variable name)? Do you emacs mode users type Escape then Key or is
it mostly Alt/Meta? We could perhaps use different defaults for vi and
emacs mode.
Oliver
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 4210a72..297fb9ae 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -37,6 +37,12 @@
>3
>CURSOR: 5
+ zletest $'\e' $'~aI\e' $'~o\e' \~
+0:swap case on a blank line
+>BUFFER: i
+>
+>CURSOR: 2
+
zletest $' four\eO\C-v\tthree\eO two\eOone\e3J'
0:join lines with line count
>BUFFER: one two three
diff --git a/Test/comptest b/Test/comptest
index 96072fd..654c0f1 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -36,6 +36,7 @@ comptestinit () {
'LISTMAX=10000000
stty 38400 columns 80 rows 24 werase undef
TERM=vt100
+KEYTIMEOUT=1
setopt zle
autoload -U compinit
compinit -u
@@ -159,9 +160,14 @@ comptest () {
}
zletest () {
- input="$*"
- # zpty_flush Before zletest
- zpty -n -w zsh "$input"$'\C-X'
+ local first=0
+ for input; do
+ # sleep for $KEYTIMEOUT
+ (( first++ )) && read -t 0.011 -k 1 < /dev/null
+ # zpty_flush Before zletest
+ zpty -n -w zsh "$input"
+ done
+ zpty -n -w zsh $'\C-X'
zpty -r -m zsh log "*<WIDGET><finish>*<PROMPT>*" || {
print "failed to invoke finish widget."
return 1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author