On 13-Apr-2011 17:07, Andy Wokula wrote:
> It's more about consistency:
>
> When you define a mapping, you can check if a count was given or not
> (check v:count >= 1).
>
> When you define a command with -range, you cannot check if a range was
> given or not.
A purist would argue that this information is not necessary, because the
defaults (-range and -range=%) handle that for you, and you could only use this
information to make the command behave in unexpected ways. But then, as a
Vimscripter, I love more power!
> Here is another example:
>
> DrChip's AsNeeded script comes with an ANX command:
> :ANX {cmd}
Uh, hasn't AsNeeded been obsoleted by Vim 7's autoload functionality? Anyway, it
probably could be worked around with dedicated :ANXRangeLine and :ANXRangeAll
commands, but I agree, for this particular case, using <range> would be far more
elegant. I still doubt that there are many more use cases, though.
-- regards, ingo
--
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