On 13/04/11 17:09, Andy Wokula wrote:
Am 09.04.2011 13:22, schrieb Tony Mechelynck:
On 09/04/11 10:57, Andy Wokula wrote:
I'd appreciate a <range> argument that can be used like
<line1>,<line2>
but which is empty when no range was given.
I'm talking about
:h :command-range
Could you give a use case which would not work just as well with
either -range or -range=% ? You'd have to use that range somewhere.
Maybe you could use :0command for your special case? That range is
allowed, but for some commands it is not meaningful.
:com! -range TestZeroRange echo <line1> <line2>
:0TestZeroRange
1 1
Zero is converted to one.
Shouldn't that be regarded a bug?
I think it is. I have another command defined as follows:
command -nargs=0 -bar -bang -range -reg Put exe ((<q-bang> == '!') ?
<q-line1> : <q-line2>) . 'put' . <q-bang> <q-reg>
but
:0Put a
inserts register a _after_ line 1, and
:0Put /
returns
E488: Trailing characters
both of which I regard as bugs, since
:0put /
(without exclamation mark) inserts the search register before line 1
(which I regard as correct behaviour).
Best regards,
Tony.
--
Happiness is having a scratch for every itch.
-- Ogden Nash
--
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