1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 16:40:24 +02:00

39945: allow further tab presses to move on to menu completion even when compstate[insert] is emptied

This commit is contained in:
Oliver Kiddle 2016-11-16 09:42:49 +01:00
parent 98b7960c78
commit 7d2f805008
4 changed files with 70 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2016-11-16 Oliver Kiddle <opk@zsh.org>
* 39945: Src/Zle/compcore.c, Completion/Base/Core/_message,
Test/Y03arguments.ztst: allow further tab presses to move on
to menu completion even when compstate[insert] is emptied
2016-11-15 Peter Stephenson <p.stephenson@samsung.com>
* 39949: Src/subst.c, Src/utils.c, Test/B09hash.ztst: "-" is

View file

@ -18,7 +18,8 @@ if [[ "$1" = -e ]]; then
ret=0
done
(( $compstate[nmatches] )) || compstate[insert]=
(( ! $compstate[nmatches] )) && [[ $compstate[insert] = *unambiguous* ]] &&
compstate[insert]=
return ret
fi

View file

@ -425,6 +425,7 @@ do_completion(UNUSED(Hookdef dummy), Compldat dat)
}
} else {
invalidatelist();
lastambig = isset(BASHAUTOLIST);
if (forcelist)
clearlist = 1;
zlemetacs = 0;

View file

@ -243,6 +243,67 @@
>NO:{-a}
>NO:{-b}
tst_arguments --abc --aah :arg:
comptesteval 'setopt bashautolist automenu'
comptest $'tst --a\t\t\t'
0:with message and bashautolist, a third tab will get menu completion
>line: {tst --a}{}
>line: {tst --a}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
>line: {tst --aah}{}
tst_arguments --abc --aah :arg:
comptesteval 'setopt bashautolist noautomenu'
comptest $'tst --a\t\t\t'
0:with message and bashautolist, a third tab is needed to display the list
>line: {tst --a}{}
>line: {tst --a}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
>line: {tst --a}{}
tst_arguments --abc --aah :arg:
comptesteval 'setopt nobashautolist noautomenu'
comptest $'tst --\t\t'
0:with message and noautomenu second tab redisplays the list
>line: {tst --}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
>line: {tst --}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
tst_arguments --abc --aah :arg:
comptesteval 'setopt nobashautolist automenu'
comptest $'tst --\t\t'
0:with message two tabs will start menu completion
>line: {tst --}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
>line: {tst --aah}{}
tst_arguments --abc --aah :arg:
comptesteval 'zstyle ":completion:*::::" completer _oldlist _complete'
comptest $'tst --\t\t'
0:with message and _oldlist, two tabs will start menu completion
>line: {tst --}{}
>DESCRIPTION:{arg}
>DESCRIPTION:{option}
>NO:{--aah}
>NO:{--abc}
>line: {tst --aah}{}
%clean
zmodload -ui zsh/zpty