From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27337 invoked from network); 26 Jan 2003 02:55:42 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Jan 2003 02:55:42 -0000 Received: (qmail 22368 invoked by alias); 26 Jan 2003 02:55:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5829 Received: (qmail 22358 invoked from network); 26 Jan 2003 02:55:09 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Jan 2003 02:55:09 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.46.181.248] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Jan 2003 2:55:8 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h0Q2t9V16717 for zsh-users@sunsite.dk; Sat, 25 Jan 2003 18:55:09 -0800 From: "Bart Schaefer" Message-Id: <1030126025509.ZM16716@candle.brasslantern.com> Date: Sun, 26 Jan 2003 02:55:09 +0000 In-Reply-To: <1030125205736.ZM16226@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "Re: Predict-on and colored/higlighted predicted text" (Jan 25, 8:57pm) References: <1030125205736.ZM16226@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Subject: Re: Predict-on and colored/higlighted predicted text MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I wrote: } Unfortunately the zsh line editor does not provide a way to insert } into the command line any characters that are not actually part of the } command. [...] So without some fairly large changes to ZLE, colorizing } parts of the command is not possible. I was thinking about this, and it turns out it's not *quite* impossible, but it does depend on redrawing behavior; so I'm not sure it will always work, and it'd be really unpleasant over a slow connection. Here's a small function that shows how to do it. It highlights from the cursor position to the end of the line, but it wouldn't be hard to adapt to highlight any given section. function hilite { setopt localoptions promptpercent local rbuffer="$RBUFFER" RBUFFER="" # Truncate the buffer zle -R # Redraw that much print -nP %U # Begin highlight RBUFFER="$rbuffer" # Restore the buffer zle -R # Redraw the rest print -nP %u # End highlight } However, as soon as you begin to edit the line, all bets are off as to where the highlight remains (or doesn't). __________ In that same message, I also wrote: } ... perhaps try these settings: I failed to cut'n'paste one that should have been included, to disable menu selection when autocompleting. If you don't have menu selection enabled, you don't need this. zstyle ':completion:predict:*' menu yes There's probably a more clever setting of that for zsh-4.1.x-dev now that menu selection has "interactive mode", but I haven't worked out what it is. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net