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

Re: Identify "active" region?



2008/5/4 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>:
> On May 4,  2:35pm, Mikael Magnusson wrote:
>  }
>  } I realize two things just after hitting send, 1) the variable should
>  } probably be called something like REGIONACTIVE, and 2) I didn't write
>  } any documentation for it.
>
>  Or it could be slightly more complicated and be an associative array
>  with fields active, start, and end.  Then one could write
>
>    (( $REGION[active] )) && BUFFER[$REGION[start],$REGION[end]]=...
>
>  instead of
>
>    if (( $REGIONACTIVE ))
>    then
>      integer start=$MARK end=$CURSOR
>      if (( MARK > CURSOR ))
>        start=$CURSOR
>        end=$MARK
>      fi
>      BUFFER[$start,$end]=...
>    fi
>
>  However, $REGIONACTIVE is much better than nothing; thanks.

Hm, that might be nicer. But I see there are no zle variables that are
associative arrays, so I don't really know how to do that. (Actually
the two that are normal arrays look a bit scary too :).

-- 
Mikael Magnusson



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