zsh-workers
 help / color / mirror / code / Atom feed
From: Hugo Haas <hugo@larve.net>
To: Clint Adams <schizo@debian.org>
Cc: zsh-workers@sunsite.dk, 270632-quiet@bugs.debian.org
Subject: Re: Bug#270632: zsh: Completion and spaces
Date: Wed, 8 Sep 2004 23:22:49 +0200	[thread overview]
Message-ID: <20040908212249.GE2775@larve.net> (raw)
In-Reply-To: <20040908202633.GA3130@scowler.net>

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

* Clint Adams <schizo@debian.org> [2004-09-08 16:26-0400]
> > Oh, you're right. It's not insert-last-word which is the culprit, but
> > smart-insert-last-word.
> > 
> > I have done:
> > 
> >   autoload smart-insert-last-word
> >   zle -N insert-last-word smart-insert-last-word
> > 
> > With this, you should be able to witness the problem.
> 
> Is this the correct fix?
> 
> Index: Functions/Zle/smart-insert-last-word
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Functions/Zle/smart-insert-last-word,v
> retrieving revision 1.2
> diff -u -r1.2 smart-insert-last-word
> --- Functions/Zle/smart-insert-last-word	27 Jan 2003 16:41:17 -0000	1.2
> +++ Functions/Zle/smart-insert-last-word	8 Sep 2004 20:25:14 -0000
> @@ -86,5 +86,5 @@
>  	fi
>      done
>  fi
> -LBUFFER[lcursor+1,cursor+1]=$lastcmd[-NUMERIC]
> +LBUFFER[lcursor+1,cursor+1]=" $lastcmd[-NUMERIC]"
>  _ilw_cursor=$CURSOR

Your patch fixes the issue with a minor other issue, which is purely
cosmetic.

This always insert a space, whether it's needed or not. Basically,
with my original scenario:

  hugo@buena /tmp% touch test
  hugo@buena /tmp% alias myfoobarcat=cat
  hugo@buena /tmp% cat test

Then:

  hugo@buena /tmp% myfoob[]

Tab:

  hugo@buena /tmp% myfoobarcat []

smart-insert-last-word:

  hugo@buena /tmp% myfoobarcat test[]

smart-insert-last-word again:

  hugo@buena /tmp% myfoobarcattest  myfoobarcat=cat[]

So the first call to smart-insert-last-word did put a space between
myfoobarcat and test, but the second call added another leading space
between myfoobarcattest and myfoobarcat=cat. This extra space should
only be added if the previous word was generated by a completion
function, FWICT.

Again, this is purely cosmetic IMO.

Regards,

Hugo

-- 
Hugo Haas - http://larve.net/people/hugo/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

  reply	other threads:[~2004-09-08 21:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040908115321.GA2417@larve.net>
     [not found] ` <20040908180950.GC25987@scowler.net>
     [not found]   ` <20040908194101.GD2775@larve.net>
2004-09-08 20:26     ` Clint Adams
2004-09-08 21:22       ` Hugo Haas [this message]
2004-09-08 23:48       ` Bart Schaefer
2004-09-08 23:56         ` Clint Adams
2004-09-09 14:59           ` Bart Schaefer
2004-09-09 15:15             ` Clint Adams
2004-09-09 21:37               ` Bart Schaefer
2004-09-11  8:11                 ` Hugo Haas
2004-09-13 18:04                   ` Bart Schaefer

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=20040908212249.GE2775@larve.net \
    --to=hugo@larve.net \
    --cc=270632-quiet@bugs.debian.org \
    --cc=schizo@debian.org \
    --cc=zsh-workers@sunsite.dk \
    /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).