From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7511 invoked by alias); 25 Feb 2014 14:07:30 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18511 Received: (qmail 366 invoked from network); 25 Feb 2014 14:07:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=GOYJu83j1aOu+6ptJcQftPtH9xX+sqgdaiTGcPos1RE=; b=OlQh7HQaJIj7pOzoT55OLLcodFkJq2PAxGQe56frLJHWCE0ZrDDs8QnO55OvBoyTX6 bLZA6xPhv+hiboLqOFFm1on6UedG2OQwF3c+tzpPrx1D2+8+haatbzwLgZaA6rhhFpEi iyqgYIcSg3WmJbV7UN10k+TTQo0AQlEyFvkX+YN/3Cee8m9c7X/ucmI5Re3SC0j5u4Qp wHN55Ga1IOWkRy0qQdKPqmcLRS4L4P7KtsE3AMN+AdwDAlT+JztFc2NFdV1KUT53WqNY DmIouk3WeHoBXU+8bSwv7yLKBA2YhKux8c8MdeppvU366e64M9BcOdhxxA9K20WwuTKt 706g== MIME-Version: 1.0 X-Received: by 10.220.99.7 with SMTP id s7mr1304831vcn.19.1393337241668; Tue, 25 Feb 2014 06:07:21 -0800 (PST) In-Reply-To: References: <140212214707.ZM25929@torch.brasslantern.com> <140213092531.ZM26966@torch.brasslantern.com> <140213223438.ZM27375@torch.brasslantern.com> <13128.1392379014@thecus.kiddle.eu> <13979.1392388765@thecus.kiddle.eu> <15748.1392413785@thecus.kiddle.eu> <12657.1392655814@thecus.kiddle.eu> <16810.1392737023@thecus.kiddle.eu> <19322.1392746842@thecus.kiddle.eu> Date: Tue, 25 Feb 2014 15:07:21 +0100 Message-ID: Subject: Re: widget special PREFIX variable and cursor position with complete_in_word From: =?ISO-8859-1?Q?Jesper_Nyg=E5rds?= To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a11c1def2578eee04f33b9b4e --001a11c1def2578eee04f33b9b4e Content-Type: text/plain; charset=ISO-8859-1 Yuri, Oliver, This thread has been very interesting, but also a bit hard to follow. Would any one of you care to share the final version of your solution, in a more concise form? The functionality seems very useful to me. On Tue, Feb 18, 2014 at 8:45 PM, Yuri D'Elia wrote: > On 02/18/2014 07:07 PM, Oliver Kiddle wrote: > > I intentionally prevented it from highlighting the first (or only) > > character. As I said in the first message, it seems fairly pointless. > > The underlining doesn't make the completion list easier to read quickly > > so it needs to be useful. It also isn't ideal when you get an underlined > > space as that looks like an underscore. > > Sorry, now the expression clicked for me. > It was failing for the following: > > touch 'file a' > touch 'file b' > ls file\ > > which made me disregard it too quickly. Interestingly it fails due to > the fact that $MATCH:q is translating ' ' to '\ ' (which should be > literal in this context). Same for the quotes. > > I'm not sure whether it would be more feasible to manually escape a > selected set of characters, or do something like the following: > > local lit=' \''"' > > ZLS_COLORS+=":=${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/${${MATCH:q}//\\[$lit]/$MATCH}|)}${${prefix[-1]:q}//\\[$lit]/$prefix[-1]}(#b)(?|)*==4" > > which will simply unescape what's needed. > > The choice of underscore is arbitrary. I was using bold before, but the > font I'm currently using has almost the same weight, which was difficult > to distinguish. Underline/underscore are different enough for me. > > > --001a11c1def2578eee04f33b9b4e--