I am trying to capture the result returned from a function implementing range
as an argument but apparently I get a comparison.
With the following code:
function! GetNumber() range
return 4
endfunction
function! GetString() range
return ""
endfunction
function! GetList() range
echo a:firstline
echo a:lastline
return []
endfunction
After having selected some lines, I do the following operations:
echo '<,'>GetNumber()
orlet a = <,'>GetNumber()
: returns 0echo '<,'>GetList()
orlet a = <,'>GetString()
: returns 1echo '<,'>GetList()
orlet a = <,'>GetList()
:Error E691: Can only compare List with List
E15: Invalid expression: '<,'>GetList()
.
Yet, I can access to the variables a:firstline
and a:lastline
in the functions. I would like to know where could be my error and also where comes this comparison?
Does the same thing on Vim 7.4 and Vim 8.