about summary refs log tree commit diff
path: root/Src/Zle/deltochar.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:06:33 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:06:33 +0000
commita61dc2074ae6cd00f1c166dc0102c491db056060 (patch)
treeb5661a235ec55353b97c617554baf14158c91ea8 /Src/Zle/deltochar.c
parent32c2ebbaa5d7927f33ee0ecf98472a71cf902cf3 (diff)
downloadzsh-a61dc2074ae6cd00f1c166dc0102c491db056060.tar.gz
zsh-a61dc2074ae6cd00f1c166dc0102c491db056060.tar.xz
zsh-a61dc2074ae6cd00f1c166dc0102c491db056060.zip
zsh-3.1.5-pws-1 zsh-3.1.5-pws-1
Diffstat (limited to 'Src/Zle/deltochar.c')
-rw-r--r--Src/Zle/deltochar.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c
index 87f8593b8..8869eb147 100644
--- a/Src/Zle/deltochar.c
+++ b/Src/Zle/deltochar.c
@@ -45,7 +45,7 @@ deltochar(void)
 	    if (dest != ll) {
 		dest++;
 		if (!n) {
-		    foredel(dest - cs);
+		    forekill(dest - cs, 0);
 		    ok++;
 		}
 	    }
@@ -57,9 +57,13 @@ deltochar(void)
 	while (n++ && dest != 0) {
 	    while (dest != 0 && line[dest] != c)
 		dest--;
-	    if (line[dest] == c && !n) {
-		backdel(cs - dest);
-		ok++;
+	    if (line[dest] == c) {
+		if (!n) {
+		    backkill(cs - dest, 1);
+		    ok++;
+		}
+		if (dest)
+		    dest--;
 	    }
 	}
     }
@@ -71,7 +75,8 @@ deltochar(void)
 int
 boot_deltochar(Module m)
 {
-    w_deletetochar = addzlefunction("delete-to-char", deltochar, ZLE_KEEPSUFFIX);
+    w_deletetochar = addzlefunction("delete-to-char", deltochar,
+                                    ZLE_KILL | ZLE_KEEPSUFFIX);
     if (w_deletetochar)
 	return 0;
     zwarnnam(m->nam, "name clash when adding ZLE function `delete-to-char'",