mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
two completion matching fixes; wrong (path) prefix matching (removed path components) and reverse order of sub-strings in match-strings (12995)
This commit is contained in:
parent
f23b23e8a3
commit
bb1fabf3ff
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2000-10-13 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
|
* 12995: Src/Zle/compmatch.c: two completion matching fixes; wrong
|
||||||
|
(path) prefix matching (removed path components) and reverse order
|
||||||
|
of sub-strings in match-strings
|
||||||
|
|
||||||
2000-10-12 Sven Wischnowsky <wischnow@zsh.org>
|
2000-10-12 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
* 12974: Completion/Core/_tags, Completion/Core/_sort_tags,
|
* 12974: Completion/Core/_tags, Completion/Core/_sort_tags,
|
||||||
|
|
|
@ -498,7 +498,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bslash = 0;
|
bslash = 0;
|
||||||
if (!sfx && lw &&
|
if (!sfx && lw && (!part || test) &&
|
||||||
(l[ind] == w[ind] ||
|
(l[ind] == w[ind] ||
|
||||||
(bslash = (lw > 1 && w[ind] == '\\' &&
|
(bslash = (lw > 1 && w[ind] == '\\' &&
|
||||||
(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {
|
(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {
|
||||||
|
@ -784,10 +784,10 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
/* Probably add the matched strings. */
|
/* Probably add the matched strings. */
|
||||||
if (!test) {
|
if (!test) {
|
||||||
if (sfx)
|
if (sfx)
|
||||||
add_match_str(NULL, NULL, w, ow - w, 0);
|
add_match_str(NULL, NULL, w, ow - w, sfx);
|
||||||
else
|
else
|
||||||
add_match_str(NULL, NULL, ow, w - ow, 0);
|
add_match_str(NULL, NULL, ow, w - ow, sfx);
|
||||||
add_match_str(mp, tl, tw, mp->wlen, 0);
|
add_match_str(mp, tl, tw, mp->wlen, sfx);
|
||||||
if (sfx)
|
if (sfx)
|
||||||
add_match_sub(NULL, NULL, 0, w, ow - w);
|
add_match_sub(NULL, NULL, 0, w, ow - w);
|
||||||
else
|
else
|
||||||
|
@ -846,7 +846,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
|
||||||
if (!lw)
|
if (!lw)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (exact) {
|
if (exact && !part) {
|
||||||
/* If we just accepted some characters directly (at the
|
/* If we just accepted some characters directly (at the
|
||||||
* beginning of the loop) and now can't match any further,
|
* beginning of the loop) and now can't match any further,
|
||||||
* we go back to before those characters and try again,
|
* we go back to before those characters and try again,
|
||||||
|
|
Loading…
Reference in a new issue