about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-14 08:59:18 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-14 08:59:18 +0000
commit8745c07794b021defc01b430d2540a4222f21d24 (patch)
tree727ed8ffc6b720b9939d43a18472c1b2fe6931a7
parentb55f434b3931e7abe24b961b230da886d49e1b06 (diff)
downloadzsh-8745c07794b021defc01b430d2540a4222f21d24.tar.gz
zsh-8745c07794b021defc01b430d2540a4222f21d24.tar.xz
zsh-8745c07794b021defc01b430d2540a4222f21d24.zip
zsh-workers/8247
-rw-r--r--Src/Zle/zle_tricky.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 66f4de33a..684e8e926 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -7801,7 +7801,7 @@ inststrlen(char *str, int move, int len)
 static Cline
 cut_cline(Cline l)
 {
-    Cline p, e = NULL, maxp = NULL;
+    Cline q, p, e = NULL, maxp = NULL;
     int sum = 0, max = 0, tmp, ls = 0;
 
     /* If no match was added with matching, we don't really know
@@ -7819,10 +7819,17 @@ cut_cline(Cline l)
     /* First, search the last struct for which we have something on
      * the line. Anything before that is kept. */
 
-    for (p = l; p; p = p->next)
+    for (q = NULL, p = l; p; p = p->next) {
 	if (p->orig || p->olen || !(p->flags & CLF_NEW))
 	    e = p->next;
-
+	if (!p->suffix && (p->wlen || p->llen || p->prefix))
+	    q = p;
+    }
+    if (!e && q && !q->orig && !q->olen && (q->flags & CLF_MISS) &&
+	(q->word ? q->wlen : q->llen) < 3) {
+	q->word = q->line = NULL;
+	q->wlen = q->llen = 0;
+    }
     /* Then keep all structs without missing characters. */
 
     while (e && !(e->flags & CLF_MISS))