Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim patch 8.2.1506 breaks plugin: "using number as bool" #27

Closed
atweiden opened this issue Sep 22, 2020 · 5 comments
Closed

vim patch 8.2.1506 breaks plugin: "using number as bool" #27

atweiden opened this issue Sep 22, 2020 · 5 comments

Comments

@atweiden
Copy link

Breaks sexp#leaf_flow on occasion. May break other things.

see: vim/vim@d70840e

@bpstahlman
Copy link
Collaborator

bpstahlman commented Sep 23, 2020 via email

@bpstahlman
Copy link
Collaborator

bpstahlman commented Sep 25, 2020 via email

atweiden referenced this issue in vim/vim Sep 26, 2020
…as bool

Problem:    Vim9: no error when using a number other than 0 or 1 as bool.
Solution:   Check the number is 0 or 1.
@atweiden
Copy link
Author

Dunno if Bram is correct there. Unless src/typval.c only applies to vim9script, the patch makes it an error to use numbers besides 0 and 1 as booleans.

case VAR_NUMBER:
    if (want_bool && varp->vval.v_number != 0
                  && varp->vval.v_number != 1)

@atweiden
Copy link
Author

Fixed in vim/vim@bade44e

@bpstahlman
Copy link
Collaborator

So IIUC, the Vim bug never made it into an official Vim release and would affect only those who built from git source or downloaded from a site that regularly generates binaries from master. I still might fix at some point. Actually, I may look at the list of Vim9 changes to see what it would take to make the whole plugin Vim9-safe to benefit from the increased speed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants