mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 17:10:59 +01:00
make _tags use C-code for braces in tag-order values; and misc. stuff (10775)
This commit is contained in:
parent
8c474bbcd4
commit
cd45aa331d
5 changed files with 56 additions and 31 deletions
|
|
@ -1,5 +1,9 @@
|
|||
2000-04-17 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
|
||||
|
||||
* 10775: Completion/Core/_description, Completion/Core/_path_files,
|
||||
Completion/Core/_tags, Src/Zle/computil.c: make _tags use C-code
|
||||
for braces in tag-order values; and misc. stuff
|
||||
|
||||
* 10774: Src/Zle/compmatch.c: fix for partial word completion with
|
||||
empty parts and common suffix
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ name="$2"
|
|||
zstyle -s ":completion:${curcontext}:$1" format format ||
|
||||
zstyle -s ":completion:${curcontext}:descriptions" format format
|
||||
|
||||
zstyle -s ":completion:${curcontext}:$1" hidden hidden
|
||||
if [[ "$hidden" = (all|yes|true|1|on) ]]; then
|
||||
if zstyle -s ":completion:${curcontext}:$1" hidden hidden &&
|
||||
[[ "$hidden" = (all|yes|true|1|on) ]]; then
|
||||
[[ "$hidden" = all ]] && format=''
|
||||
opts=(-n)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ else
|
|||
realpath=''
|
||||
|
||||
if [[ "$pre[1]" = / ]]; then
|
||||
# If it is a absolut path name, we remove the first slash and put it in
|
||||
# If it is a absolute path name, we remove the first slash and put it in
|
||||
# `donepath' meaning that we treat it as the path that was already handled.
|
||||
# Also, we don't use the paths from `-W'.
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,7 @@ if (( $# )); then
|
|||
fi
|
||||
;;
|
||||
\!*) comptry "${(@)argv:#(${(j:|:)~${=~tag[2,-1]}})}";;
|
||||
?*) eval "tag=( ${${tag:s/\\:/\\\\\\\\\\\\:}//(#b)([][()|*?^#~<>])/\\${match[1]}} )"
|
||||
comptry -m "${${(@)tag// /\\ }}";;
|
||||
?*) comptry -m "$tag";;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
|||
|
|
@ -2425,15 +2425,36 @@ bin_comptry(char *nam, char **args, char *ops, int func)
|
|||
s++;
|
||||
*p = '\0';
|
||||
if (*q) {
|
||||
char *qq = dupstring(q);
|
||||
char *qq, *qqq;
|
||||
|
||||
if (c)
|
||||
*c = '\0';
|
||||
|
||||
qqq = qq = dupstring(q);
|
||||
while (*qqq) {
|
||||
if (qqq == qq || qqq[-1] != '\\') {
|
||||
if (*qqq == '{')
|
||||
*qqq = Inbrace;
|
||||
else if (*qqq == '}')
|
||||
*qqq = Outbrace;
|
||||
else if (*qqq == ',')
|
||||
*qqq = Comma;
|
||||
}
|
||||
qqq++;
|
||||
}
|
||||
tokenize(qq);
|
||||
if (haswilds(qq)) {
|
||||
if (haswilds(qq) || hasbraces(qq)) {
|
||||
Patprog prog;
|
||||
LinkNode node;
|
||||
LinkNode bnode, node;
|
||||
LinkList blist = newlinklist();
|
||||
|
||||
addlinknode(blist, qq);
|
||||
for (bnode = firstnode(blist); bnode; incnode(bnode))
|
||||
while (hasbraces(getdata(bnode)))
|
||||
xpandbraces(blist, &bnode);
|
||||
|
||||
for (bnode = firstnode(blist); bnode; incnode(bnode)) {
|
||||
qq = (char *) getdata(bnode);
|
||||
if ((prog = patcompile(qq, PAT_STATIC, NULL))) {
|
||||
char **a, *n;
|
||||
int l = (c ? strlen(c + 1) + 2 : 1), al;
|
||||
|
|
@ -2464,6 +2485,7 @@ bin_comptry(char *nam, char **args, char *ops, int func)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (arrcontains(all, q, 0)) {
|
||||
for (set = comptags[lasttaglevel]->sets; set;
|
||||
set = set->next)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue