Loading ...
Sorry, an error occurred while loading the content.

Re: [BUG?] 'rubydo', 'luado', etc won't get current line number

Expand Messages
  • lilydjwg
    ... Thanks, using another parameter is better than vim.eval. But is there anyone going to patch for perldo and rubydo? They look more powerful to me. -- Best
    Message 1 of 3 , Mar 29, 2012
    • 0 Attachment
      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,
      > > 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)

      Thanks, using another parameter is better than vim.eval. But is there
      anyone going to patch for perldo and rubydo? They look more powerful to
      me.

      --
      Best regards,
      lilydjwg

      Linux Vim Python 我的博客:
      http://lilydjwg.is-programmer.com/
      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.