aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval.c28
-rw-r--r--src/nvim/version.c40
-rw-r--r--test/functional/provider/python3_spec.lua4
-rw-r--r--test/functional/provider/python_spec.lua4
4 files changed, 45 insertions, 31 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 0aa0e8c165..b067e03c2f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -24133,24 +24133,30 @@ typval_T eval_call_provider(char *provider, char *method, list_T *arguments)
return rettv;
}
-/// Checks if a named provider is enabled.
-bool eval_has_provider(const char *name)
-{
- if (!strequal(name, "clipboard")
- && !strequal(name, "python")
- && !strequal(name, "python3")
- && !strequal(name, "ruby")
- && !strequal(name, "node")) {
+/// Checks if provider for feature `feat` is enabled.
+bool eval_has_provider(const char *feat)
+{
+ if (!strequal(feat, "clipboard")
+ && !strequal(feat, "python")
+ && !strequal(feat, "python3")
+ && !strequal(feat, "python_compiled")
+ && !strequal(feat, "python_dynamic")
+ && !strequal(feat, "python3_compiled")
+ && !strequal(feat, "python3_dynamic")
+ && !strequal(feat, "ruby")
+ && !strequal(feat, "node")) {
// Avoid autoload for non-provider has() features.
return false;
}
+ char name[32]; // Normalized: "python_compiled" => "python".
+ snprintf(name, sizeof(name), "%s", feat);
+ strchrsub(name, '_', '\0'); // Chop any "_xx" suffix.
+
char buf[256];
- int len;
typval_T tv;
-
// Get the g:loaded_xx_provider variable.
- len = snprintf(buf, sizeof(buf), "g:loaded_%s_provider", name);
+ int len = snprintf(buf, sizeof(buf), "g:loaded_%s_provider", name);
if (get_var_tv(buf, len, &tv, NULL, false, true) == FAIL) {
// Trigger autoload once.
len = snprintf(buf, sizeof(buf), "provider#%s#bogus", name);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index a40c0aacac..b0619d6273 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -76,7 +76,7 @@ static const int included_patches[] = {
1845,
1844,
1843,
- // 1842,
+ 1842,
1841,
1840,
1839,
@@ -103,12 +103,12 @@ static const int included_patches[] = {
1818,
// 1817,
1816,
- // 1815,
+ 1815,
1814,
1813,
// 1812,
1811,
- // 1810,
+ 1810,
1809,
1808,
1807,
@@ -368,7 +368,7 @@ static const int included_patches[] = {
1553,
1552,
1551,
- // 1550,
+ 1550,
1549,
1548,
1547,
@@ -572,7 +572,7 @@ static const int included_patches[] = {
1349,
1348,
1347,
- // 1346,
+ 1346,
// 1345,
1344,
1343,
@@ -588,7 +588,7 @@ static const int included_patches[] = {
1333,
1332,
1331,
- // 1330,
+ 1330,
1329,
1328,
1327,
@@ -597,19 +597,19 @@ static const int included_patches[] = {
1324,
1323,
1322,
- // 1321,
- // 1320,
+ 1321,
+ 1320,
1319,
- // 1318,
+ 1318,
1317,
1316,
1315,
1314,
1313,
- // 1312,
+ 1312,
1311,
1310,
- // 1309,
+ 1309,
1308,
// 1307,
1306,
@@ -625,7 +625,7 @@ static const int included_patches[] = {
1296,
1295,
1294,
- // 1293,
+ 1293,
// 1292,
1291,
1290,
@@ -816,13 +816,13 @@ static const int included_patches[] = {
1105,
1104,
1103,
- // 1102,
+ 1102,
1101,
1100,
1099,
1098,
- // 1097,
- // 1096,
+ 1097,
+ 1096,
1095,
1094,
1093,
@@ -916,7 +916,7 @@ static const int included_patches[] = {
1005,
1004,
1003,
- // 1002,
+ 1002,
1001,
1000,
999,
@@ -942,7 +942,7 @@ static const int included_patches[] = {
979,
978,
977,
- // 976,
+ 976,
975,
974,
973,
@@ -962,7 +962,7 @@ static const int included_patches[] = {
959,
958,
957,
- // 956,
+ 956,
955,
954,
953,
@@ -986,7 +986,7 @@ static const int included_patches[] = {
935,
// 934,
933,
- // 932,
+ 932,
931,
930,
929,
@@ -1522,7 +1522,7 @@ static const int included_patches[] = {
399,
398,
397,
- // 396,
+ 396,
395,
394,
393,
diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua
index d7ca0bd420..b319d5e948 100644
--- a/test/functional/provider/python3_spec.lua
+++ b/test/functional/provider/python3_spec.lua
@@ -29,6 +29,10 @@ describe('python3 provider', function()
it('feature test', function()
eq(1, eval('has("python3")'))
+ eq(1, eval('has("python3_compiled")'))
+ eq(1, eval('has("python3_dynamic")'))
+ eq(0, eval('has("python3_dynamic_")'))
+ eq(0, eval('has("python3_")'))
end)
it('python3_execute', function()
diff --git a/test/functional/provider/python_spec.lua b/test/functional/provider/python_spec.lua
index eab4b29d3a..986f10b2e9 100644
--- a/test/functional/provider/python_spec.lua
+++ b/test/functional/provider/python_spec.lua
@@ -37,6 +37,10 @@ end)
describe('python feature test', function()
it('works', function()
eq(1, funcs.has('python'))
+ eq(1, funcs.has('python_compiled'))
+ eq(1, funcs.has('python_dynamic'))
+ eq(0, funcs.has('python_dynamic_'))
+ eq(0, funcs.has('python_'))
end)
end)