luochen1990 / rainbow

Rainbow Parentheses Improved, shorter code, no level limit, smooth and fast, powerful configuration.
Apache License 2.0
1.78k stars 95 forks source link

Errors on loading #125

Closed me-and closed 5 years ago

me-and commented 5 years ago

Describe the bug

On opening a file with Vim, I get a long series of errors (I've only copied the first few lines here.

Error detected while processing function rainbow_main#load..rainbow#syn..<SNR>24_resolve_parenthesis_from_config:
line    1:
E121: Undefined variable: v:false
E116: Invalid arguments for function s:resolve_parenthesis_with(['', v:false, '', 'TOP', a:config.operators], a:config.parentheses_options)
E15: Invalid expression: s:resolve_parenthesis_with(['', v:false, '', 'TOP', a:config.operators], a:config.parentheses_options)
Error detected while processing function rainbow_main#load..rainbow#syn..<SNR>24_resolve_parenthesis_with:
line    1:
E714: List required
line   16:
E121: Undefined variable: paren
E121: Undefined variable: paren
E121: Undefined variable: paren
line   20:
E121: Undefined variable: paren
E15: Invalid expression: [paren, contained, containedin, contains, op]
Error detected while processing function rainbow_main#load..rainbow#syn:
line   10:
E714: List required
line   15:
E121: Undefined variable: op
E116: Invalid arguments for function len(op) > 2
E15: Invalid expression: len(op) > 2

To Reproduce

Expected behavior

The file opens without a stack of errors appearing.

Additional context

I'm seeing this on Vim 7.4 on CentOS 7.6.1810. Per the repro instructions above, I see this problem with only the base CentOS Vim configuration.

Testing with git bisect, the problem is introduced by 62454f1 ("feat: support parentheses_options & contained").

luochen1990 commented 5 years ago

It seems that v:false is the cause. This new feature is not supported by vim 7 (Vim < 7.4.1154 ?). I will change it back to 0

luochen1990 commented 5 years ago

@me-and this should have been fixed now, please help to confirm this.

Since I'm using NeoVim / VIm8 now, Vim7 compatibility is not tested. It is suggested to use Vim8 / NeoVim instead of Vim7 if possible.

me-and commented 5 years ago

I'll not be able to confirm the fix until Tuesday, but I should be able to look at it then, thank you!

Sadly I suspect I'm not going to be able to upgrade Vim in at least some of my environments any time soon, and I'm reluctant to start going down the road of compiling Vim myself unless I really need to, so I suspect I'll be on Vim7 for a while yet. If that means I'm likely to hit these bugs more, or need to peg my install of this package to a known good version, that's irritating but so be it.

me-and commented 5 years ago

Confirmed, that's fixed things. Thank you!