mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-04 08:30:54 +02:00
32303: simplistic completion after $x:
This commit is contained in:
parent
c56f5aed59
commit
584ea88811
4 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2014-01-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 32303: Src/Zle/compcore.c, Completion/Zsh/Type/_parameters,
|
||||
Completion/Zsh/Context/_brace_parameter: allow completion
|
||||
of modifiers for parameters in a fairly simplistic way.
|
||||
|
||||
2014-01-28 Peter Stephenson <p.stephenson@samsung.com>
|
||||
|
||||
* 32308 (slightly modified to use "a" as the vi command at start
|
||||
|
|
|
@ -185,6 +185,9 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
|
|||
)
|
||||
_describe -t flags "parameter flag" flags -Q -S ''
|
||||
return
|
||||
elif compset -P '*:'; then
|
||||
_history_modifiers p
|
||||
return
|
||||
fi
|
||||
|
||||
_parameters -e
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
|
||||
local expl pattern fakes faked tmp pfilt
|
||||
|
||||
if compset -P '*:'; then
|
||||
_history_modifiers p
|
||||
return
|
||||
fi
|
||||
|
||||
pattern=(-g \*)
|
||||
zparseopts -D -K -E g:=pattern
|
||||
|
||||
|
|
|
@ -1260,6 +1260,20 @@ check_param(char *s, int set, int test)
|
|||
ispar = (br >= 2 ? 2 : 1);
|
||||
b[we-wb] = '\0';
|
||||
return b;
|
||||
} else if (offs > e - s && *e == ':') {
|
||||
/*
|
||||
* Guess whether we are in modifiers.
|
||||
* If the name is followed by a : and the stuff after
|
||||
* that is either colons or alphanumerics we probably are.
|
||||
* This is a very rough guess.
|
||||
*/
|
||||
char *offsptr = s + offs;
|
||||
for (; e < offsptr; e++) {
|
||||
if (*e != ':' && !ialnum(*e))
|
||||
break;
|
||||
}
|
||||
ispar = (br >= 2 ? 2 : 1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue