Somehow I missed that, and I apologize. This solves my problem.

On Tue, Feb 1, 2022 at 9:04 AM Bram Moolenaar <b...@moolenaar.net> wrote:

>
> 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!
>
>  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net
>  \\\
> ///
> \\\
> \\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org
> ///
>


-- 
Christian J. Robinson <hept...@gmail.com>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAK14FZ%2B7W8RBa8VHf5uTwQ9o_y18fS8pSefGL7pO8ni5XAFHXg%40mail.gmail.com.

Raspunde prin e-mail lui