On 13/04/11 21:00, Tony Mechelynck wrote:
On 13/04/11 20:45, Bram Moolenaar wrote:

ZyX wrote:

:com! -range TestZeroRange echo<line1> <line2>
:0TestZeroRange

1 1

Zero is converted to one.

Shouldn't that be regarded a bug?
1. It is not a bug because first line has number `1', not `0'.
2. `:0read!echo "abc"' and `:1read!echo "abc"' are different, so you
may want to
punish Bram for having yet another hack for built-in commands.

You can use -range=1 to allow for a zero line number.


Oh, oh. I don't see that documented at ":help :command-range". Is it a
new attribute?

Best regards,
Tony.

Ah, oops, there is -range=N but then N is the default. What if I want to do like the :put and :read commands: allow a range defaulting to the current line, but also allow line zero?

Best regards,
Tony.
--
ERROR 047: Keyboard not found.  Press RETURN to continue.

--
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

Raspunde prin e-mail lui