Maxim Kim wrote:
> Hi,
>
> In the following example <count> gives me 0 or current linenumber
> +number that I prepend ,ff (3,ff gives me lnum+3). Is it possible to
> have exactly what was prepended to a command?
>
> function! Hello(count)
> if a:count < 0
> let cnt = 0
> else
> let cnt = a:count
> endif
> echo cnt
> endfunction
>
> command! -count Hello call Hello(<count>-<line1>+1)
> map ,ff :Hello<CR>
>
>
I've taken a little liberty with the Hello command itself, but perhaps
you can modify this further to suit you:
function! Hello(count)
call Dfunc("Hello(count=".a:count.")")
if a:count < 0
let cnt = 0
else
let cnt = a:count
endif
echo cnt
call Dret("Hello : cnt=".cnt)
endfunction
command! -count=1 Hello call Hello(<count>)
map ,ff :<c-u>call Hello(v:count)<CR>
Regards,
Chip Campbell
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---