I want to know if I can use the
popup option for my
completeopt in the running version of vim/neovim. The example is just for clarity, I'm looking for a solution that is generic.
I know I can check
exists("&completeopt"), or check if a value already is set within it (
&completeopt ~=# 'popup').
What I don't know is how to check for valid values within an option like
guioptions, etc. if that option is not already set with that value.
I can't find any answer or help under
:h exists, or any of the other vi.stackexchange or stackoverflow answers using search terms "check valid values for option". I have read the suggestions on this webpage about graceful option degrading
I'm aware I could use a
try ... catch block, but would rather avoid that extra code and incompatibility with vim < 7 (for the purposes of completeness)
For this specific example, I could use
v:version > 802, but I'm interested in an approach targeted to a specific feature, so that I can re-use it for other options and so that it works for neovim.
Edit: Reading the online docs for version 8.2, I see it specifies the compile-requirement of
textprop, so I assume I could do
has('textprop'). However, I would still very much like to know if there is a more generic way to do it, to make doing the same for other options easier and more robust (in case of incorrect/missing documentation, or compile-invariant options)
textprop is present in versions prior to those that introduced
popup, so doesn't work.