I think I found a bug with lambda expressions.

I was looking into writing some automated tests and was trying to use 
the new lambda expressions. However this does not work as expected:

Here is an example:
  let a = ['FOOBAR    "word"', 'FOOBAR    "word2"']
  let pat='^FOOBAR\s\+\zs"[^"]\+"'
  let pat2='^FOOBAR\s\+\("[^"]\+"\)'
  :echo map(copy(a), 'matchstr(v:val, g:pat)')
  -> result ['"word"', '"word2"']
  :echo map(copy(a), {val -> matchstr(val, g:pat)})
  -> BUG: result ['""', '""'], expected ['"word"', '"word2"']
  :echo map(copy(a), 'substitute(v:val, g:pat2, ''\=submatch(1)'',"")')
  -> result ['"word"', '"word2"']
  :echo map(copy(a), {val -> substitute(val, g:pat2, '\=submatch(1)', '')})
  -> BUG: result ['0', '1'], expected ['"word", '"word2"']

In den ersten Lebensjahren eines Kindes bringen ihm die Eltern Gehen
und Sprechen bei, in den späteren verlangen sie dann, daß es
stillsitzt und den Mund hält.
                -- Johann Nepomuk Nestroy

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

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

Raspunde prin e-mail lui