Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Identify "active" region?
- X-seq: zsh-workers 24913
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Identify "active" region?
- Date: Sun, 4 May 2008 19:52:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=c5SOW/1x1/F5BKUh48mhycOdL48+CGizD/iyclLG79Q=; b=K3cXMtsaOtFoahWiw41Ta6UnYEW6xzqr/fpBLYgWhfiexIc+gPkk/51AVyHVMW/HagyEcyDltFhfejkXYrqn/g6oVZELiFxPvdLXLIpzIYjPU4DI+s3YT3bpFOYtac71+03K1bZgnQ37vMDaqUP5naBM7BpmJf6OFxe4QUhehAg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pF1mmrfA1IuBYTBBjd0P3UwPYy8XgnjcDhDppOoNNIWYbVPj+ZL0JHLzeyBSrM7aPTmx2dZ8NcW+i63w1JTXDx13qDhLY24szmMKiqHrA9gnTQgCLBR1uveyKpw46cLxb4nPTPn7Ys4SfK9tDqsJjJTqffcRjqKSTfXYzjh1xfE=
- In-reply-to: <080504093852.ZM3575@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <080503175219.ZM11801@xxxxxxxxxxxxxxxxxxxxxx> <20080504132102.076669ed@pws-pc> <237967ef0805040533x699fcf37p2ea24d2abe38d3df@xxxxxxxxxxxxxx> <237967ef0805040535y2f4343eds5b42adf9bc3075a6@xxxxxxxxxxxxxx> <080504093852.ZM3575@xxxxxxxxxxxxxxxxxxxxxx>
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