about summary refs log tree commit diff
path: root/Src/Zle/zle_misc.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:14:01 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:14:01 +0000
commit850fb2e7f94b4e0e9fbf3538ad9e3c44c9fed74b (patch)
treea09f4376fe75073ed19fb5dd1de0fce4c898adb9 /Src/Zle/zle_misc.c
parent7a40d6c258ad87d147ee5d6839e746c33ebc0ac7 (diff)
downloadzsh-850fb2e7f94b4e0e9fbf3538ad9e3c44c9fed74b.tar.gz
zsh-850fb2e7f94b4e0e9fbf3538ad9e3c44c9fed74b.tar.xz
zsh-850fb2e7f94b4e0e9fbf3538ad9e3c44c9fed74b.zip
zsh-3.1.5-pws-7 zsh-3.1.5-pws-7
Diffstat (limited to 'Src/Zle/zle_misc.c')
-rw-r--r--Src/Zle/zle_misc.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 836ff09ae..4b5df9cde 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -612,6 +612,10 @@ executenamedcommand(char *prmt)
     char *ptr;
     char *okeymap = curkeymapname;
 
+    invalidatelist();
+    moveto(0, 0);
+    clearflag = 0;
+    resetneeded = 1; 
     cmdbuf = halloc(l + NAMLEN + 2);
     strcpy(cmdbuf, prmt);
     statusline = cmdbuf;
@@ -792,6 +796,49 @@ makeparamsuffix(int br, int n)
     }
 }
 
+/* Set up suffix given a string containing the characters on which to   *
+ * remove the suffix. */
+
+/**/
+void
+makesuffixstr(char *s, int n)
+{
+    if (s) {
+	int inv, i, v, z = 0;
+
+	if (*s == '^' || *s == '!') {
+	    inv = 1;
+	    s++;
+	} else
+	    inv = 0;
+	s = getkeystring(s, &i, 5, &z);
+	s = metafy(s, i, META_USEHEAP);
+
+	if (inv) {
+	    v = 0;
+	    for (i = 0; i < 257; i++)
+		 suffixlen[i] = n;
+	} else
+	    v = n;
+
+	if (z)
+	    suffixlen[256] = v;
+
+	while (*s) {
+	    if (s[1] == '-' && s[2]) {
+		int b = (int) *s, e = (int) s[2];
+
+		while (b <= e)
+		    suffixlen[b++] = v;
+		s += 2;
+	    } else
+		suffixlen[STOUC(*s)] = v;
+	    s++;
+	}
+    } else
+	makesuffix(n);
+}
+
 /* Remove suffix, if there is one, when inserting character c. */
 
 /**/