zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: A.Main@dcs.warwick.ac.uk (Zefram)
Cc: zsh-workers@math.gatech.edu
Subject: Re: fix for completing to NULs
Date: Thu, 23 May 1996 22:13:30 +0200 (MET DST)	[thread overview]
Message-ID: <199605232013.WAA04943@bolyai.cs.elte.hu> (raw)
In-Reply-To: <19843.199605231452@stone.dcs.warwick.ac.uk> from Zefram at "May 23, 96 03:52:48 pm"

Zefram wrote:
> If completing to a string ending in NUL, the completion code thinks
> that the space of the metafied NUL is a suffix, and so puts the
> cursor in the wrong place.  This fixes it.

Partly.  There are some other places where this should be fixed.  The patch
below fixes that.  As a side note, I do not think that anyone ever want to
complete strings with null characters.  Filenames do not have null
characters and it cannot be used in arguments to external commands as well.

Zoltan

 *** Src/zle_tricky.c	1996/05/23 17:14:24	2.38
 --- Src/zle_tricky.c	1996/05/23 20:05:03
 ***************
 *** 5,11 ****
    *
    * This file is part of zsh, the Z shell.
    *
 !  * Copyright (c) 1992-1995 Paul Falstad
    * All rights reserved.
    *
    * Permission is hereby granted, without written agreement and without
 --- 5,11 ----
    *
    * This file is part of zsh, the Z shell.
    *
 !  * Copyright (c) 1992-1996 Paul Falstad
    * All rights reserved.
    *
    * Permission is hereby granted, without written agreement and without
 ***************
 *** 577,583 ****
       noerrs = ne;
       /* When completing between words, the contents *
        * of wb and we may be garbled.                */
 !     if (we > wb && iblank(line[we - 1]) && (we < 2 || line[we - 2] != '\\'))
   	we--;
       /* For vi mode, reset the start-of-insertion pointer to the beginning *
        * of the word being completed, if it is currently later.  Vi itself  *
 --- 577,584 ----
       noerrs = ne;
       /* When completing between words, the contents *
        * of wb and we may be garbled.                */
 !     if (we > wb && iblank(line[we - 1]) && 
 ! 	(we < 2 || (line[we - 2] != '\\' && line[we - 2] != STOUC(Meta))))
   	we--;
       /* For vi mode, reset the start-of-insertion pointer to the beginning *
        * of the word being completed, if it is currently later.  Vi itself  *
 ***************
 *** 1008,1014 ****
   	/* Sometimes the lexer gives us token strings ending with spaces: *
   	 * we delete the spaces.                                          */
   	while (sl && clwords[i][sl - 1] == ' ' &&
 ! 	       (sl < 2 || clwords[i][sl - 2] != Bnull))
   	    clwords[i][--sl] = '\0';
   	/* If this is the word the cursor is in and we added a `x', *
   	 * remove it.                                               */
 --- 1009,1016 ----
   	/* Sometimes the lexer gives us token strings ending with spaces: *
   	 * we delete the spaces.                                          */
   	while (sl && clwords[i][sl - 1] == ' ' &&
 ! 	       (sl < 2 || (clwords[i][sl - 2] != Bnull &&
 ! 			   clwords[i][sl - 2] != Meta)))
   	    clwords[i][--sl] = '\0';
   	/* If this is the word the cursor is in and we added a `x', *
   	 * remove it.                                               */



      reply	other threads:[~1996-05-23 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-23 14:52 Zefram
1996-05-23 20:13 ` Zoltan Hidvegi [this message]

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=199605232013.WAA04943@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=A.Main@dcs.warwick.ac.uk \
    --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).