If I have a function that takes a range, how can I echo the return value of the function?
For example, the following does not work:
:echo 2,8call MyFunction()
I looked into this, and I could not find a direct way of doing it. However, one possibility is to create an auxiliary function, that is:
function! Range() range abort return RangeAux(a:firstline, a:lastline) endfunction function! RangeAux(lnum1, lnum2) abort echo a:lnum1 echo a:lnum2 endfunction 1,3call Range() call RangeAux(1,3)