zsh-workers
 help / color / mirror / code / Atom feed
* vi-backward-kill-word fix
@ 1995-07-23  4:44 Zefram
  0 siblings, 0 replies; only message in thread
From: Zefram @ 1995-07-23  4:44 UTC (permalink / raw)
  To: Z Shell workers mailing list

-----BEGIN PGP SIGNED MESSAGE-----

The patch below fixes a bug in vi-backward-kill-word, that it would
delete past the beginning of the line, which it shouldn't.

 -zefram

      *** 1.1	1995/07/21 20:20:54
      --- Src/zle_word.c	1995/07/23 04:41:44
      ***************
      *** 248,254 ****
        void
        vibackwardkillword(void)
        {
      !     int x = cs;
        
            if (mult < 0) {
        	feep();
      --- 248,254 ----
        void
        vibackwardkillword(void)
        {
      !     int x = cs, lim = (viinsbegin > findbol()) ? viinsbegin : findbol();
        
            if (mult < 0) {
        	feep();
      ***************
      *** 256,276 ****
            }
        /* this taken from "vibackwardword" */
            while (mult--) {
      ! 	while ((x > viinsbegin) && iblank(line[x - 1]))
        	    x--;
        	if (iident(line[x - 1]))
      ! 	    while ((x > viinsbegin) && iident(line[x - 1]))
        		x--;
        	else
      ! 	    while ((x > viinsbegin) && !iident(line[x - 1]) && !iblank(line[x - 1]))
        		x--;
            }
      - /*
      -         while (mult--) {
      -                 while ( (x > viinsbegin) && (iwordsep(line[x-1]))) x--;
      -                 while ( (x > viinsbegin) && (!iwordsep(line[x-1]))) x--;
      -         }
      -         */
            backkill(cs - x, 1);
        }
        
      --- 256,270 ----
            }
        /* this taken from "vibackwardword" */
            while (mult--) {
      ! 	while ((x > lim) && iblank(line[x - 1]))
        	    x--;
        	if (iident(line[x - 1]))
      ! 	    while ((x > lim) && iident(line[x - 1]))
        		x--;
        	else
      ! 	    while ((x > lim) && !iident(line[x - 1]) && !iblank(line[x - 1]))
        		x--;
            }
            backkill(cs - x, 1);
        }
        

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQBVAgUBMBHTnGWJ8JfKi+e9AQH/hQH/V1o8c8pALz43MtG2LG+pPwBiaNzUA0lE
V0+YKymLQqDBvWsdsxFaFwu54RG06QjqKt2DmO1OcoF7NGOp96BkqQ==
=DVBV
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-07-23  4:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-07-23  4:44 vi-backward-kill-word fix Zefram

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).