about summary refs log tree commit diff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-01-15 10:44:14 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-01-15 10:44:14 +0000
commit4a39b5d9c5e21d100a778e94f6c2936528967210 (patch)
treeb6592eb905f31ecfdceb32f6ec935a8d345a1556 /Src/Zle/compresult.c
parent25900ecf28bb9da7fe5b3878f40e83388404f146 (diff)
downloadzsh-4a39b5d9c5e21d100a778e94f6c2936528967210.tar.gz
zsh-4a39b5d9c5e21d100a778e94f6c2936528967210.tar.xz
zsh-4a39b5d9c5e21d100a778e94f6c2936528967210.zip
two more fixes for completion matching and reporting interesting positions (13349)
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 55e37cd4a..f953e0f6b 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -249,7 +249,7 @@ cline_str(Cline l, int ins, int *csp, LinkList posl)
 	/* Remember the position if this is the first prefix with
 	 * missing characters. */
 	if ((l->flags & CLF_MISS) && !(l->flags & CLF_SUF)) {
-	    if (posl && l->min != l->max && (npos = cs + padd) != opos) {
+	    if (posl && (npos = cs + padd) != opos) {
 		opos = npos;
 		addlinknode(posl, (void *) ((long) npos));
 	    }
@@ -303,7 +303,7 @@ cline_str(Cline l, int ins, int *csp, LinkList posl)
 	    if (l->flags & CLF_MID)
 		mid = cs;
 	    else if (l->flags & CLF_SUF) {
-		if (posl && l->min != l->max && (npos = cs + padd) != opos) {
+		if (posl && (npos = cs + padd) != opos) {
 		    opos = npos;
 		    addlinknode(posl, (void *) ((long) npos));
 		}
@@ -414,7 +414,13 @@ cline_str(Cline l, int ins, int *csp, LinkList posl)
 	l = l->next;
     }
     if (posl && (npos = cs + padd) != opos)
+#if 0
+	/* This could be used to put an extra colon before the end-of-word
+	 * position if there is nothing missing. */
+	addlinknode(posl, (void *) ((long) -npos));
+#endif
 	addlinknode(posl, (void *) ((long) npos));
+
     if (ins) {
 	int ocs = cs;
 
@@ -483,9 +489,18 @@ build_pos_string(LinkList list)
     LinkNode node;
     int l;
     char buf[40], *s;
+    long p;
 
     for (node = firstnode(list), l = 0; node; incnode(node)) {
-	sprintf(buf, "%ld", (long) getdata(node));
+	p = (long) getdata(node);
+#if 0
+	/* This could be used to put an extra colon before the end-of-word
+	 * position if there is nothing missing. */
+	if (p < 0)
+	    sprintf(buf, ":%ld", -p);
+	else
+#endif
+	    sprintf(buf, "%ld", p);
 	setdata(node, dupstring(buf));
 	l += 1 + strlen(buf);
     }