provider: g:loaded_xx_provider=2 means "enabled and working"

Value of 1 cannot be used, because users might set that in their vimrc
to _disable_ a provider, which would confuse :checkhealth and has().
This commit is contained in:
Justin M. Keyes
2019-08-04 12:06:24 +02:00
parent 66938b928c
commit 241956720d
10 changed files with 23 additions and 21 deletions

View File

@@ -23996,7 +23996,9 @@ bool eval_has_provider(const char *provider)
}
}
return (tv.v_type == VAR_NUMBER) ? !!tv.vval.v_number : false;
return (tv.v_type == VAR_NUMBER)
? 2 == tv.vval.v_number // Value of 2 means "loaded and working".
: false;
}
/// Writes "<sourcing_name>:<sourcing_lnum>" to `buf[bufsize]`.