about summary refs log tree commit diff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-03-05 10:48:10 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-03-05 10:48:10 +0000
commiteb41692bc56f22c7587426c4e5fa3c75ea0dfeab (patch)
tree92f164f7f014503fe24f8b3ff65688c273c4e296 /Src/Zle/compmatch.c
parentd7e0081a67988fe139539d745a14dda4094e125a (diff)
downloadzsh-eb41692bc56f22c7587426c4e5fa3c75ea0dfeab.tar.gz
zsh-eb41692bc56f22c7587426c4e5fa3c75ea0dfeab.tar.xz
zsh-eb41692bc56f22c7587426c4e5fa3c75ea0dfeab.zip
fix for matching control, try harder to merge separately completed parts to avoid losing user-typed characters (13565)
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 0bd8e82f3..45220a298 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -2001,8 +2001,7 @@ join_clines(Cline o, Cline n)
 		    else
 			oo = to;
 		    o = to;
-		}
-		if (tn) {
+
 		    diff = sub_join(o, n, tn, 0);
 
 		    o->flags |= CLF_MISS;
@@ -2064,6 +2063,29 @@ join_clines(Cline o, Cline n)
 			    }
 			    continue;
 			} else {
+			    for (tn = n; tn; tn = tn->next)
+				if ((tn->flags & CLF_NEW) ==
+				    (o->flags & CLF_NEW) &&
+				    cmp_anchors(tn, o, 1)) break;
+
+			    if (tn) {
+				if ((diff = sub_join(o, n, tn, 0))) {
+				    if (po) {
+					po->flags |= CLF_MISS;
+					po->max += diff;
+				    }
+				    else {
+					o->flags |= CLF_MISS;
+					o->max += diff;
+				    }
+				}
+				n = tn;
+				po = o;
+				o = o->next;
+				pn = n;
+				n = n->next;
+				continue;
+			    }
 			    if (o->flags & CLF_SUF)
 				break;