Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Match to the end of string when using (S) flag



On Tue, Nov 1, 2016, at 02:23 PM, Bart Schaefer wrote:
> You can do this with just a counter, you don't need a math function:
> 
>   i=$#region_highlight
>   : ${text//(#mi)(${~colsearch_pattern})/
>       ${region_highlight[++i]=$((offset + MBEGIN))}
>       ${region_highlight[++i]=$((offset + MEND))}
>       ${region_highlight[++i]=${__hsmw_hl_color}}}

Couldn't get this to work, although $i before and after differs much,
however looked at contents and there are lines like:

193 -1 none
-1 -1 none
-1 -1 bg=17
-1 -1 none

so something doesn't append well.

> I have to give you credit for coming up with the idea of using a text
> replacement in the first place.  I had to re-read your first message
> on this thread about four times before I understood what it meant.

Well it comes directly from zsh-users/Zaw, I've even added Zaw license
to the project because of that single line, now I dropped it.

-- 
  Sebastian Gniazdowski
  psprint@xxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author