summaryrefslogtreecommitdiff
path: root/Test/Y01completion.ztst
diff options
context:
space:
mode:
authorMarlon Richert <marlon.richert@gmail.com>2023-05-05 14:41:59 +0300
committerOliver Kiddle <opk@zsh.org>2023-05-21 03:24:17 +0200
commitcaa1c38c6f0000b6ed6a6a50e8dca037ad82308a (patch)
tree9411a7ecde6c7ee999a83cea7d73216339d61739 /Test/Y01completion.ztst
parent9a5f213573fbda6a6d23e985113eaeb849d4ee6d (diff)
downloadzsh-caa1c38c6f0000b6ed6a6a50e8dca037ad82308a.tar.gz
zsh-caa1c38c6f0000b6ed6a6a50e8dca037ad82308a.zip
51348: Fix subscript completion bugs inside ~[...]
When completing inside ~[...] (_with_ the trailing `]` present), the following bugs occured: - Subscript completion was skipped entirely when there were one or more slashes ('/') in the subscript, which is incorrect, since slashes are allowed there. - Instead of going through _complete, $_comps[-subscript-] was called immediately, causing _setup to be skipped. - If succesful, _main_complete was exited right after, causing menu-style, comppostfuncs and other essential completion features to be skipped.
Diffstat (limited to 'Test/Y01completion.ztst')
-rw-r--r--Test/Y01completion.ztst16
1 files changed, 13 insertions, 3 deletions
diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index b3ec12e52..a4060e9a4 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -75,17 +75,27 @@
>line: {: ~user2}{}
>line: {: ~user1}{}
- comptesteval 'zsh_directory_name() { compadd "$expl[@]" -- name1 name2 }'
+ comptesteval 'zsh_directory_name() { compadd "$expl[@]" -- name/1 name2 }'
comptest $': ~[\t\t\t\t'
0:dynamic directory names after ~[
>line: {: ~[name}{}
>line: {: ~[name}{}
>DESCRIPTION:{dynamically named directory}
->NO:{name1}
+>NO:{name/1}
>NO:{name2}
->line: {: ~[name1]}{}
+>line: {: ~[name/1]}{}
>line: {: ~[name2]}{}
+ comptest $': ~[]\C-b\t\t\t\t'
+0:dynamic directory names inside ~[...]
+>line: {: ~[name}{]}
+>line: {: ~[name}{]}
+>DESCRIPTION:{dynamically named directory}
+>NO:{name/1}
+>NO:{name2}
+>line: {: ~[name/1}{]}
+>line: {: ~[name2}{]}
+
comptest $'echo ;:\C-b\C-b\t'
0:directories and files before separator
>line: {echo }{;:}