On 4/28/06, Gerald Lai <[EMAIL PROTECTED]> wrote:
On Fri, 28 Apr 2006, Eric Arnold wrote:

> On 4/28/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
>> The end of the visual selection as gotten by    `>   seems to depend
>> on whether the cursor was  between the end_col - 1, and end_col,  or
>> between end_col, and end_col + 1.  The GUI gvim seems to have the
>> notion of the the cursor being between characters in visual mode.
>>
>> `> sometimes lands you on the character *after* the last col of the
>> visual selection.
>>
>> So, the question is, how do I get the real last column of the Visual 
selection?
>>
>
> Actually, this seems be inconsistent mostly when you start a
> visual-block selections from different corners.
>

It works as expected for me. For example,

   1. Start :new buffer.
   2. From Normal mode, type "iab".
   3. Hit <Enter>.
   4. Type "cd", and hit <Esc>. Then do "gg0". You should have:

            ab
            cd

      with the Normal cursor on "a".

   5. Start visual block with <C-v>, and hit "jl". Press <Esc>.

Now, from Insert mode, if you did

   6. <C-o> followed by `>

the Insert cursor will be between "c" and "d". If, instead, you hit
"j2l" in step 5, then (after step 6) the Insert cursor will appear after
"d".

Remember, visual modes are able to highlight _past_ the end-of-line,
unlike the Normal mode cursor.

Please provide an example if you still see a problem.

Ok, hopefully this will be the replication case that I've been working
toward with Bram.  It isn't a huge deal, but it's keeping me from
using the `< `> marks to reliably give me the selection area inside
scripts.

: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.

Reply via email to