summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-05-25 20:36:37 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-05-25 21:11:20 +0900
commite5f356a95e3c867e1f554e1b77dd6b463566107a (patch)
tree07958f0b63bda4e8714a1de50374530e6127b973
parent5e2d3d1e15e94e3d727e7393cbce2667a93f2fd4 (diff)
downloadzsh-e5f356a95e3c867e1f554e1b77dd6b463566107a.tar.gz
zsh-e5f356a95e3c867e1f554e1b77dd6b463566107a.zip
42809: slightly improve 'compset -q'
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/compcore.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index dda1c6b22..3f7e95417 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+ * 42809: Src/Zle/compcore.c: slightly improve 'compset -q'
+
2018-05-19 Oliver Kiddle <okiddle@yahoo.co.uk>
* 42806: Completion/Unix/Command/_shutdown: fix where options
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index c3b971e0d..f733e0ee5 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -1638,7 +1638,7 @@ set_comp_sep(void)
p[-1] = '\0';
}
}
- if (tok == ENDINPUT || tok == LEXERR)
+ if (tok == ENDINPUT)
break;
if (tokstr && *tokstr) {
for (p = tokstr; dq && *p; p++) {
@@ -1667,7 +1667,7 @@ set_comp_sep(void)
if (!got && !lexflags) {
DPUTS(!p, "no current word in substr");
got = 1;
- cur = i;
+ cur = countlinknodes(foo) - 1; /* cur is 0 offset */
swb = wb - 1 - dq - sq - dolq;
swe = we - 1 - dq - sq - dolq;
sqq = lsq;
@@ -1902,7 +1902,10 @@ set_comp_sep(void)
untokenize(p);
}
/* The current position shouldn't exceed the new word count */
- compcurrent = cur + 1 > i ? i : cur + 1;
+ if ((compcurrent = cur + 1) > i) {
+ DPUTS2(1, "compcurrent=%d > number_of_words=%d", compcurrent, i);
+ compcurrent = i;
+ }
compwords[i] = NULL;
}
instring = ois;