about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Core/_setup1
-rw-r--r--Src/Zle/complist.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/Completion/Core/_setup b/Completion/Core/_setup
index fa1495ced..4054f5ecc 100644
--- a/Completion/Core/_setup
+++ b/Completion/Core/_setup
@@ -3,6 +3,7 @@
 local val nm="$compstate[nmatches]"
 
 if zstyle -a ":completion${curcontext}:$1" list-colors val; then
+  zmodload -e zsh/complist || zmodload -i zsh/complist
   if [[ "$1" = default ]]; then
     ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}"
   else
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index ce00ed240..39eee8b85 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -453,13 +453,13 @@ initiscol(Listcols c)
     curisbeg = curisend = 0;
 
     for (i = nrefs;  i < MAX_POS; i++)
-	begpos[i] = -1, endpos[i] = 0xfffffff;
+	begpos[i] = endpos[i] = -1;
 }
 
 static void
 doiscol(Listcols c, int pos)
 {
-    if (pos > endpos[curisend]) {
+    if (endpos[curisend] >= 0 && pos > endpos[curisend]) {
 	curisend++;
 	if (curiscol) {
 	    zcputs(c, NULL, COL_NO);
@@ -700,7 +700,7 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width,
 	else if (mselect >= 0 && (m->flags & (CMF_MULT | CMF_FMULT)))
 	    zcputs(&mcolors, g->name, COL_DU);
 	else if (buf)
-	    subcols = putfilecol(&mcolors, g->name, path, buf->st_mode);
+	    subcols = putfilecol(&mcolors, g->name, m->str, buf->st_mode);
 	else
 	    subcols = putmatchcol(&mcolors, g->name, (m->disp ? m->disp : m->str));