Am 29.11.2012 18:40, schrieb Roland Eggner:
:h cmdline-ranges
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16*
Some Ex commands accept a line range in front of them. This is noted as
[range]. It consists of one or more line specifiers, separated with ',' or
';'.
The basics are explained in section |10.3| of the user manual.
*:,* *:;*
When separated with ';' the cursor position will be set to that line
before interpreting the next line specifier. This doesn't happen for ','.
Why not reusing or enhancing already established commandline syntax?
If “,” and “;” are not sufficient for all desired features of range
specifications, why not just introducing a new separator between line
specifications? E.g. two adjacent commas “,,”, or a caret character
“^” would not clash with current commandline syntax AFAICS. This
would be easier to learn from a user POV. Implementation might
require more effort, though.
AISI ...
`,' versus `;' is a matter of how to get to the range boundaries. The
option to not move the cursor should work together with both of them.
To "not move the cursor" can (or should) mean two things:
- don't move the cursor initially (demand from function definition):
:func! MyFunc1() stay
- make sure the function call doesn't move the cursor at all (demand
from caller):
:KeepView [range]call MyFunc2() or
:[range]callkeepview MyFunc2() ...
--
Andy
--
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