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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220201160437.4055A1C1775%40moolenaar.net.