Answer by HanleyLee for passing command-range to a function
If you want use the range of currently selected line in visual mode, you can use the below:command! -range PassRange '<,'> call PrintGivenRange()'<: the first line of the current selected...
View ArticleAnswer by Raimondi for passing command-range to a function
You need to explicitly pass the range, try with:command! -range PassRange <line1>,<line2>call PrintGivenRange()
View Articlepassing command-range to a function
I'm trying to define a command that can take a range and pass it to a function. This is what I thought I should have:function! PrintGivenRange() range echo "firstline ".a:firstline." lastline...
View Article
More Pages to Explore .....