Commit Graph

6 Commits

Author SHA1 Message Date
Shougo
f195345c93
[RFC] fix: has('python') error (#17252)
* fix: has('python') error

* fix: functional tests
2022-01-31 15:06:46 +01:00
Justin M. Keyes
7e1c959861 test: Eliminate expect_err
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
2019-09-06 17:19:07 -07:00
Justin M. Keyes
2141dc2262 provider: check #Call() if g:loaded_xx_provider=2 2019-08-04 13:23:46 +02:00
Justin M. Keyes
5e6a08f2e6 provider: skip non-provider has() feature-names
We don't want to retry autoload sourcing (slow) for every random has()
query that finds it way to eval_call_provider().
2019-08-04 13:23:46 +02:00
Justin M. Keyes
66938b928c provider: decide status by g:loaded_xx_provider 2019-08-04 13:23:46 +02:00
Rui Abreu Ferreira
2cfe4748e5 provider: let providers decide their status
Instead of deciding provider status in eval_has_provider, move the
decision to the provider Vim scripts.

Previously, provider loading worked as follows:

1. eval_has_provider() verified provider availability by searching for
   the provider#providername#Call function and cached this verificaion as a static
   variable for some providers
2. providers short-circuited on loading to prevent the definition of the
   Call function (with the exception of the node provider that did not)

This commit changes the expected interface between nvim and its
providers to facilitate provider reloading, by splitting the
verification of the provider from the availability of the Call function.

eval_has_provider() now checks for a provider#providername#enabled
variable. It is up to the provider script to set this to 0 or 1
accordingly. eval_call_provider() remains unchanged.

All providers hosting a Call function were updated to respect this.

The clipboard provider now has a Reload function to reload the
provider.
2019-08-04 13:23:46 +02:00