1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

users/16581: skip correction shortcut based on command table search when

the word is not in command position; on rejected command correction,
reset incremental path hashing.
This commit is contained in:
Bart Schaefer 2011-11-15 15:08:56 +00:00
parent c6722cf086
commit 7c5173ba0f
2 changed files with 22 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2011-11-15 Barton E. Schaefer <schaefer@zsh.org>
* users/16581: Src/utils.c: it seems wrong to shortcut correction
of words not in command position by comparing them to the command
tables, so don't; if a command correction is rejected, reset the
incremental path hashing so the new command can be "learned".
2011-11-14 Peter Stephenson <pws@csr.com>
* gi1242: users/16578: Completion/Unix/Command/_lp: lpadmin,
@ -117,7 +124,7 @@
* 29815: Doc/Makefile.in: include mod_langinfo in documentation.
2011-09-25 Barton E. Schaefer <schaefer@brasslantern.com>
2011-09-25 Barton E. Schaefer <schaefer@zsh.org>
* 29799: Src/utils.c: swap order of RESET_PROMPT / REFRESH in
adjustwinsize() so that the cursor is moved to the start of a
@ -15570,5 +15577,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5498 $
* $Revision: 1.5499 $
*****************************************************

View file

@ -2498,16 +2498,18 @@ spckword(char **s, int hist, int cmd, int ask)
return;
if (!(*s)[0] || !(*s)[1])
return;
if (shfunctab->getnode(shfunctab, *s) ||
builtintab->getnode(builtintab, *s) ||
cmdnamtab->getnode(cmdnamtab, *s) ||
aliastab->getnode(aliastab, *s) ||
reswdtab->getnode(reswdtab, *s))
return;
else if (isset(HASHLISTALL)) {
cmdnamtab->filltable(cmdnamtab);
if (cmdnamtab->getnode(cmdnamtab, *s))
if (cmd) {
if (shfunctab->getnode(shfunctab, *s) ||
builtintab->getnode(builtintab, *s) ||
cmdnamtab->getnode(cmdnamtab, *s) ||
aliastab->getnode(aliastab, *s) ||
reswdtab->getnode(reswdtab, *s))
return;
else if (isset(HASHLISTALL)) {
cmdnamtab->filltable(cmdnamtab);
if (cmdnamtab->getnode(cmdnamtab, *s))
return;
}
}
t = *s;
if (*t == Tilde || *t == Equals || *t == String)
@ -2621,6 +2623,8 @@ spckword(char **s, int hist, int cmd, int ask)
fflush(shout);
zbeep();
x = getquery("nyae \t", 0);
if (cmd && x == 'n')
pathchecked = path;
} else
x = 'n';
} else