Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Case-insensitive completion (Re: tab completion bug?)
- X-seq: zsh-workers 33526
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Case-insensitive completion (Re: tab completion bug?)
- Date: Fri, 24 Oct 2014 08:35:03 -0700
- Cc: TJ Luoma <luomat@xxxxxxxxx>
- In-reply-to: <141024082004.ZM20859@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CADjGqHubg=UK+0awfnrr48YFLRy1gPC+44q7GscMM0rADMm=cw@mail.gmail.com> <20141023133140.07d56359@pwslap01u.europe.root.pri> <CADjGqHueO7-=ty3f8FcUTZ_8ESTOwJCqgWe+ZfSqpRBf3gQ+4Q@mail.gmail.com> <20141023140616.456fa1f1@pwslap01u.europe.root.pri> <CADjGqHumk0T0c-FOa7at99t1bEh9qrd8rikZSa5ph=PNM4i0PQ@mail.gmail.com> <141023192353.ZM19606@torch.brasslantern.com> <CADjGqHtrkip-x82=zA7m0gE9R6zeN6VV3-fkpYUua4dt3KVemA@mail.gmail.com> <141024082004.ZM20859@torch.brasslantern.com>
On Oct 24, 8:20am, Bart Schaefer wrote:
}
} The actual culprit is the call to compadd at line 705, which adds the
} unexpanded variable as the "original string" but passes the expanded
} path prefix (with the inexact capitalization) as the -W option.
Aha, aha, aha ... if I try it with no_case_glob but use the exact
capitalization in $sites, it's revealed that prefix is supposed to be
removed at lines 612-613 but THAT match is case-sensitive, so we pass
full paths to compadd in the first place, which sets up the failure
of -W.
So this seems to fix it:
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index ed3f54d..c64ebf5 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -609,8 +609,15 @@ for prepath in "$prepaths[@]"; do
tmp3="$pre$suf"
tpre="$pre"
tsuf="$suf"
- [[ -n "${prepath}${realpath}${testpath}" ]] &&
+ if [[ -n "${prepath}${realpath}${testpath}" ]]
+ then
+ if [[ -o nocaseglob ]]
+ then
+ tmp1=( "${(@)tmp1#(#i)${prepath}${realpath}${testpath}}" )
+ else
tmp1=( "${(@)tmp1#${prepath}${realpath}${testpath}}" )
+ fi
+ fi
while true; do
Messages sorted by:
Reverse Date,
Date,
Thread,
Author