Wednesday, January 14, 2015

Problem with command on script

I'm using vim 7.4.580 on Windows 7. I have the following code to delete
a displaced range of lines on a text:

----------
function! Foobar(num) range
exe (a:firstline+a:num).','.(a:lastline+a:num).'d'
endfunc
com! -range -nargs=1 Foobar call Foobar(<q-args>)
----------

When I select a range of lines and run 'call Foobar(5)' it works,
but when I run 'Foobar 5' it doesn't work.

Where can be the error?


Many thanks in advance,

--
Cesar

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment