From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.dk
Cc: 270632-submitter@bugs.debian.org
Subject: Re: Bug#270632: zsh: Completion and spaces
Date: Thu, 9 Sep 2004 11:15:52 -0400 [thread overview]
Message-ID: <20040909151552.GA21470@scowler.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0409090754020.4924@toltec.zanshin.com>
> Only that it always disables auto-suffix-removal. E.g., if $LBUFFER ends
> in a slash which was added as a completion suffix, and the first character
> of the word to be inserted is also a slash, then normally the suffix would
> be deleted in order that the slash not become doubled; but with the work-
> around, you get the double slash.
That sounds like it's a purely cosmetic problem, but how about this for
the zsh/parameter solution?
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 9 Sep 2004 15:14:21 -0000
@@ -35,13 +35,14 @@
# bindkey '\e=' insert-last-assignment
emulate -L zsh
+zmodload -i zsh/parameter || return 1
setopt extendedglob
# Not strictly necessary:
# (($+_ilw_hist)) || integer -g _ilw_hist _ilw_count _ilw_cursor _ilw_lcursor
integer cursor=$CURSOR lcursor=$CURSOR
-local lastcmd pattern numeric=$NUMERIC
+local lastc lastcmd pattern numeric=$NUMERIC
# Save state for repeated calls
if (( HISTNO == _ilw_hist && cursor == _ilw_cursor )); then
@@ -64,10 +65,8 @@
_ilw_hist=$HISTNO
_ilw_count=$NUMERIC
-zle .up-history || return 1 # Retrieve previous command
-lastcmd=( ${${(z)BUFFER}:#\;} ) # Split into shell words
-zle .down-history # Return to current command
-CURSOR=$cursor # Restore cursor position
+lastc="$history[$#history]" # Retrieve previous command
+lastcmd=( ${${(z)lastc}:#\;} ) # Split into shell words
NUMERIC=${numeric:-1} # In case of fall through
(( NUMERIC > $#lastcmd )) && return 1
next prev parent reply other threads:[~2004-09-09 15:17 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
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 [this message]
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=20040909151552.GA21470@scowler.net \
--to=schizo@debian.org \
--cc=270632-submitter@bugs.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).