zsh-users
 help / color / mirror / code / Atom feed
From: "Ebourne, Martin" <martin.ebourne@csfb.com>
To: "'zsh-users@sunsite.dk'" <zsh-users@sunsite.dk>
Subject: How to get prefix with quotes in completion widgets?
Date: Mon, 15 Apr 2002 14:53:34 +0100	[thread overview]
Message-ID: <39E723A47AE4D211A9E800A0C9DEB9F605B0E910@slon11308.csfp.co.uk> (raw)

Hi,

How do I get access to a version of $PREFIX which includes the quotes within a completion widget?

eg. If I have a completion widget for example which prints the following:

	echo "il:$words:"
	echo "ll:$words[1,CURRENT-1]:"
	echo "pr:$PREFIX:"
	echo "ip:$IPREFIX:"
	echo "qi:$QIPREFIX:"
	echo "aq:$compstate[all_quotes]:"

And then I enter the line:

example insert ( 'foo', 'bar' )
                        ^^^
                        123

And complete on the three successive characters shown, I get:

1:
	il:example insert ( 'foo', 'bar' ):
	ll:example insert:
	pr:(\ foo,\ :
	ip::
	qi::
	aq:\:
2:
	il:example insert ( 'foo', 'bar' ):
	ll:example insert:
	pr:(\ foo,\ :
	ip::
	qi::
	aq:\:
3:
	il:example insert ( 'foo', 'bar' ):
	ll:example insert:
	pr:(\ foo,\ b:
	ip::
	qi::
	aq:\:

Here PREFIX has lost the ' which are present in words[CURRENT]. Is there a way to access a version of PREFIX which has not been so altered? Or alternatively, is there a way of getting the character position of the cursor inside words[CURRENT] so that I could use that?

I note especially that although the cursor is in a different position for 1 & 2 (1: outside the quote, 2: inside the quote), there is no difference in the information available at completion time that I can see.

Cheers,

Martin.

This message is for the named person's use only. It may contain sensitive and private proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. CREDIT SUISSE GROUP and each legal entity in the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT business units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as  preliminary only and subject to our formal written confirmation.



             reply	other threads:[~2002-04-15 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-15 13:53 Ebourne, Martin [this message]
2002-04-16  8:11 ` Sven Wischnowsky
2002-04-16 10:26 Ebourne, Martin
2002-04-16 16:17 ` Bart Schaefer
2002-04-16 11:13 Ebourne, Martin
2002-04-18  8:33 Ebourne, Martin

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=39E723A47AE4D211A9E800A0C9DEB9F605B0E910@slon11308.csfp.co.uk \
    --to=martin.ebourne@csfb.com \
    --cc=zsh-users@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).