Re: [BUG?] 'rubydo', 'luado', etc won't get current line number
- On Wed, Mar 28, 2012 at 01:57:16PM -0400, Luis Carvalho wrote:
> > It'll be convenient to be able to get the line number in these commands,Thanks, using another parameter is better than vim.eval. But is there
> > but it seems that inside none of these VIM::evaluate('line(".")') or
> > vim.eval('line(".")') will get that number.
> That's true. One option -- at least for Lua -- would be to have an extra
> parameter "linenr" for the line number in the function called by luado:
> :luado return line .. ("[%d]"):format(linenr) -- line and linenr are params
> I can come up with a simple patch for this feature. Meanwhile, you can have a
> workaround by using a global variable:
> :lua linenr = nil -- initialize counter
> :luado if linenr==nil then linenr = vim.firstline - 1 end linenr = linenr + 1
> return line .. ("[%d]"):format(linenr)
anyone going to patch for perldo and rubydo? They look more powerful to
Linux Vim Python 我的博客:
A: Because it obfuscates the reading.
Q: Why is top posting so bad?
You received this message from the "vim_dev" 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