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

Cast integers with vim_eval #557

Merged
merged 1 commit into from
Apr 8, 2016
Merged

Conversation

blueyed
Copy link
Collaborator

@blueyed blueyed commented Apr 7, 2016

Cast integers with vim_eval

This makes it clearer/more strict altogether and is future-proof in the
sense that vim.eval might return integers for ints in Vim after all.

See #553 for a very noisy discussion of what led to this.
Although it might be a regression in neovim-python after all it is good
to be on the save side.

The bonus here is that we get "notified" in case of a option that is
expected to be a int is a string - although that might also cause some
weird issues in case someone uses "yes" instead of 1 (?!).

Fixes #553.

@blueyed blueyed changed the title Map ints with vim_eval Cast integers with vim_eval Apr 7, 2016
@blueyed blueyed force-pushed the vim_eval-int branch 2 times, most recently from 7d7e70a to 4ddbabd Compare April 7, 2016 21:46
@davidhalter
Copy link
Owner

Why would people use yes and what is the issue with it (since we're not using bool conversions)?

This makes it clearer/more strict altogether and is future-proof in the
sense that `vim.eval` might return integers for numbers in Vim after all.

See davidhalter#553 for a very noisy discussion of what led to this.
Although it might be a regression in neovim-python after all it is good
to be on the safe side.

The bonus here is that we get "notified" in case of a option that is
expected to be an integer is a string instead.

Fixes davidhalter#553.
@blueyed
Copy link
Collaborator Author

blueyed commented Apr 8, 2016

Why would people use yes and what is the issue with it (since we're not using bool conversions)?

Removed that from the commit message.

@davidhalter
Copy link
Owner

Makes sense! Thanks!

@davidhalter davidhalter merged commit a0c3269 into davidhalter:master Apr 8, 2016
@blueyed blueyed deleted the vim_eval-int branch April 8, 2016 13:14
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

Successfully merging this pull request may close these issues.

2 participants