I get error 'E16: Invalid range' when I give large count
(larger than number of lines in current buffer) to the ':10000call X()'
where function is declared with 'range' attribute.

I think the error is illogical in this case. I think this error must not appear
when function has 'range' attribute. Count is not alway line numbers.

There are many examlpes of builtin commands where count is not
line numbers. These builtin commands correctly do not give error
when [count] is larger than num. of buffer lines. For example,
':20verb set' correctly does not give error in buffer with <20 lines.

Yakov

Here is testcase

:so x.vim   "see x.vim below
:5XXX         " this works since 5 is less than lines in buf
:10000XXX  "gives error  "E16: Invalid range"

------------ begin file x.vim --------------------
command! -range XXX  :<count>call XXX()

function! XXX() range
   echo a:firstline
   echo a:lastline
endfu
------------ end file x.vim --------------------

Reply via email to