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

Re: Identify "active" region?



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.



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