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.