zsh-workers
 help / color / mirror / code / Atom feed
From: greg@alphatech.com (Greg Klanderman)
To: zsh-workers@math.gatech.edu (Zsh list)
Subject: [patch] deltochar
Date: Thu, 5 Nov 1998 12:34:03 -0500 (EST)	[thread overview]
Message-ID: <13889.57739.993748.165972@catbus.alphatech.com> (raw)


Reverse kills were not handled correctly.  Also, kill the text so it
can be yanked, like emacs does.

There is still a minor bug in that consecutive reverse deltochar's do
not accumulate into a single kill.  They do going forwards.

Can someone tell me what the ZLE_KILL does in the call to
addzlefunction, and if it's needed?

greg
(please copy me on replies)


1998-11-05  Greg Klanderman  <greg@alphatech.com>

	* Src/Zle/deltochar.c (deltochar): kill (saving in kill ring)
	instead of deleting.  properly handle reverse kills.


--- Src/Zle/deltochar.c.orig	Thu Nov  5 11:21:36 1998
+++ Src/Zle/deltochar.c	Thu Nov  5 12:23:28 1998
@@ -45,7 +45,7 @@
 	    if (dest != ll) {
 		dest++;
 		if (!n) {
-		    foredel(dest - cs);
+		    forekill(dest - cs, 0);
 		    ok++;
 		}
 	    }
@@ -58,9 +58,13 @@
 	    while (dest != 0 && line[dest] != c)
 		dest--;
 	    if (line[dest] == c && !n) {
-		backdel(cs - dest);
+		backkill(cs - dest, 1);
 		ok++;
 	    }
+            else if (dest)
+              dest--;
+            else
+              n = 0;
 	}
     }
     if (!ok)
@@ -71,7 +75,8 @@
 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'",


             reply	other threads:[~1998-11-05 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-05 17:34 Greg Klanderman [this message]
1998-11-06  7:13 ` PATCH: 3.1.5 - cumulative reverse-kills (Re: [patch] deltochar) Bart Schaefer
1998-11-06 14:10   ` Greg Klanderman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13889.57739.993748.165972@catbus.alphatech.com \
    --to=greg@alphatech.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).