Tuesday, May 5, 2015

How to determine whether an option is boolean?

Hi!

Some vim options are boolean, i.e. integers with the possible values 0 and 1. You can, e.g., set `ai` and `noai` or use `let &ai = 1`. Other options are numeric/integer or string values.

type(&option) can only be used to distinguish string from bool/int options. exist('&noai') returns 0, so it cannot be used to distinguish bool from int options. Is there another way to determine whether an option is a bool (an int that takes only the values 0 or 1) or an int?

Regards,
Tom

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment