luke-gru / riml

Riml is a subset of VimL with some nice added features. It compiles to plain VimL.
MIT License
224 stars 6 forks source link

Functions that handle range #28

Closed dsawardekar closed 11 years ago

dsawardekar commented 11 years ago

I have a function that filters lines based on the current range. The range typically corresponds to a visual mode selection but could be a manual one. To create such a filter function I need a viml function such as below,

function! MyFilter() range
endfunction

Is there a riml equivalent of the same?

luke-gru commented 11 years ago

Ranges are supported for function definitions. To get this exact viml output, you could do

def n:MyFilter() range
end

or even:

function! n:MyFilter() range
endfunction

Thanks!

dsawardekar commented 11 years ago

Hah, should have tested that! Thanks.