1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-01 20:11:06 +01:00

users/20034: adjust PREFIX and SUFFIX for unambiguous_cursor on second completion attempt with GLOB_COMPLETE

This commit is contained in:
Barton E. Schaefer 2015-03-21 09:29:52 -07:00
parent a74fe69d05
commit 8254c9c071
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2015-03-21 Barton E. Schaefer <schaefer@zsh.org>
* users/20034: Completion/Base/Core/_main_complete: adjust
PREFIX and SUFFIX for unambiguous_cursor on second completion
attempt with GLOB_COMPLETE
2015-03-20 Peter Stephenson <p.stephenson@samsung.com>
* 34753 / 34754: Test/C02cond.ztst: work around lack

View file

@ -68,6 +68,16 @@ if [[ "$compstate[insert]" = tab* ]]; then
compstate[insert]="${compstate[insert]//tab /}"
fi
# Second attempt at GLOB_COMPLETE
if [[ "$compstate[pattern_match]" = "*" &&
"$_lastcomp[unambiguous]" = "$PREFIX" &&
-n "$_lastcomp[unambiguous_cursor]" ]]; then
integer upos="$_lastcomp[unambiguous_cursor]"
SUFFIX="$PREFIX[upos,-1]$SUFFIX"
PREFIX="$PREFIX[1,upos-1]"
fi
# Special completion contexts after `~' and `='.
if [[ -z "$compstate[quote]" ]]; then