zsh-workers
 help / color / mirror / code / Atom feed
* Closing quotes in completion
@ 1999-04-26 12:52 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-04-26 12:52 UTC (permalink / raw)
  To: Zsh hackers list

I wrote the following completer called _closequotes to stick before
_complete; if it finds the completion is in quotes, it adds the appropriate
closing quote as an ignored suffix.  It works fine for simple cases, but
for anything more complicated (such as file paths with a slash) the closing
quote appears too far back in the string (and in that case you want to get
rid of it anyway).  Any ideas?  I suppose using a `compctl -M' doesn't work
because it doesn't match against $ISUFFIX anyway.


#autoload

# If the current completion is in quotes, add the closing quote.
# It's a bit brutal, since when completing in segments like file paths
# the quotes go in too early.  We really need some way of getting
# this removed automatically when there's other stuff to come.

if [[ -n $compstate[quote] ]]; then
  compstate[restore]=''
  ISUFFIX="$ISUFFIX$compstate[quote]"
fi

return 1

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

only message in thread, other threads:[~1999-04-26 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-26 12:52 Closing quotes in completion Peter Stephenson

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