A.J.Mechelynck wrote:
Bill McCarthy wrote:
On Mon 27-Nov-06 9:39pm -0600, A.J.Mechelynck wrote:

[EMAIL PROTECTED] wrote:
For example, the word

Cat

When the cursor is on C, and I press vta, the cursor doesn't move.
However, if I press
vtt, it moves two characters to the right. Is this an intentional design
decision or a bug?

I've tried this in both vim 6.4 and the latest version of vim 7.0 on the download page.

Works for me with gvim 7.0.168 with Gnome2 GUI on SuSE Linux 9.3, both in GUI
mode and in console mode

With the cursor on the C of Cat in Normal mode

after vta the cursor is on the C (i.e., one character left of the a), one character is visually highlighted as shown at bottom right of the screen. (In console mode the highlight color is not noticeable because the only character
of the Visual selection is at the cursor position.)

after (Esc to clear Visual mode, then) vtt the cursor is on the a (i.e., one
character left of the t), two characters (Ca) are visually highlighted.

With typical windows settings, select=exclusive (from
:behave mswin).  With that, vta leaves the cursor to the
left of C and zero is shown in the lower right (vfC produces
identical results).  However vtt highlights Ca and two is
shown in the lower right (vta produces identical results).


IIUC, vf or vt create the visual areas inclusively (to the looked-up character or the one before it respectively), but then "selection=exclusive" interprets any selection as exclusive (the last character of the visually highlighted area is not included in the selection).

If this is true, I might venture that the behaviour is correct in the case of vta (cursor ends up on the left of a, sel=exclusive interprets the selection as zero-length) and incorrect (or not as advertised) in all other cases (vf and vt produce identical results, instead of vt selecting one less character than vf).

It seems that my choice of options, i.e.
    " don't use mswin.vim
    set selectmode=mouse,key
    set mousemodel=popup
    set keymodel=startsel
    set selection=inclusive
(which is neither ":behave mswin" nor ":behave xterm" but some kind of compromise between the two), was a lucky one.


Best regards,
Tony.


However, when selection=exclusive, vfa selects two characters, and vta selects zero characters. I still can't understand this behavior despite that vt is just to select one less character than vf.

Reply via email to