summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2011-11-15 15:08:56 +0000
committerBart Schaefer <barts@users.sourceforge.net>2011-11-15 15:08:56 +0000
commit7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4 (patch)
tree5f23ae03964c8a097739228a728711003f18cf01 /Src
parentc6722cf086b09ed63d1441986d0c7774a9280861 (diff)
downloadzsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.tar.gz
zsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.tar.xz
zsh-7c5173ba0fd41027ec32d4f7cf29deaaadbec1e4.zip
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.
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 41bf0b149..6c2ea98d5 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -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