On Sun, Apr 30, 2006 at 08:36:14AM -0600, Eric Arnold wrote: > On 4/30/06, Benji Fisher <[EMAIL PROTECTED]> wrote: > >On Sat, Apr 29, 2006 at 04:11:21PM -0600, Eric Arnold wrote: > >> >> :set selection=exclusive > >> >> > >> >> Use this text: > >> >> > >> >> 123456 > >> >> 2abcde > >> >> 3abcde > >> >> 4abcde > >> >> 5abcde > >> >> > >> >> Go to line 4, col 2. Hit ^V or (^Q whichever works). Type kkll > >> >> until you've highlighted > >> >> abc > >> >> abc > >> >> abc > >> >> > >> >> Type <ESC> > >> >> > >> >> For me, now the cursor is on "c", and `< and `> go to "a" and "c". > >> >> > >> >> Now start at line 2, col 2 and highlight the same 3x3 square, and type > >> >> <ESC>. > >> >> > >> >> Now the cursor is on "d", and `< and `> go to "a" and "d". > >> >> > >> >> If it doesn't do this, try starting at the other corners. Sometimes I > >> >> *think* I've had it work differently, but I can't remember exactly > >> >> what the conditions were. > > > > If you want to determine the selected text from a script, I guess > >the answer is that you should exclude the character at `> if > > > >&selection == "exclusive" && col("'>") > col("'<") > > That's the problem, you don't know when to exclude the character, > because "exclusive" mode includes the character when selected from > certain directions.
That is my attempt at a *solution* to the problem. I guess you should also check visualmode(): the above conditional assumes you were using blockwise selection. HTH --Benji Fisher