On Sun, Sep 15, 2019 at 8:55 AM Shidong Wang <wsd...@outlook.com> wrote: > > Hello, I am not sure if it is a bug, but it always make me confuses: > > here is a exmaple: > > func Test() > let c = 'sss' > let a = 1 > let b = 2 > echo c[a:b] > endf > > then call Test(), you will get error, Undefined variable: a:b > > of cause this can be avoided by changing the last line to echo c[a : b]
Hm, the help defines an expr8 of that type as expr8[expr1a : expr1b] (with spaces around the colon) then proceeds to give examples, all of which have only empty or numeric indices without spaces around the colon. Looks like spaces are better (less confusing for the Vim parser, maybe) whenever the index is _other_ than empty or purely numeric. Bram: Bug or feature? Best regards, Tony. -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAJkCKXsuLmkGRk6X%2BVJ8cD0bUdH%3DqrYs7Y%3DE4d2s1uoGWXjz5A%40mail.gmail.com.