Christian J. Robinson wrote:
> I have attached a demonstration script. If you edit then source it in a new
> Vim instance you will get "0 0" then "1 1" echoed into the message history,
> but it should be "1 1" then "2 2".
>
> If you change the \test mapping to have a preceding <c-c> in the rhs, you
> get the expected output, which is "1 1" then "2 2".
This is unlreated to using <ScriptCmd>. While Visual mode is active the
'< and '> marks are still set to the previously selected text. This is
mentioned at the help for these marks.
Instead of using that, you can use line('v'). The help for that:
v In Visual mode: the start of the Visual area (the
cursor is the end). When not in Visual mode
returns the cursor position. Differs from |'<| in
that it's updated right away.
--
Lower life forms have more fun!