diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9a86c5765c..47d44b148a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10782,6 +10782,7 @@ static void f_has(typval_T *argvars, typval_T *rettv) "mouse", "multi_byte", "multi_lang", + "packages", "path_extra", "persistent_undo", "postscript", @@ -20168,11 +20169,15 @@ theend: */ static int eval_fname_script(char_u *p) { - if (p[0] == '<' && (STRNICMP(p + 1, "SID>", 4) == 0 - || STRNICMP(p + 1, "SNR>", 4) == 0)) + // Use mb_stricmp() because in Turkish comparing the "I" may not work with + // the standard library function. + if (p[0] == '<' && (mb_strnicmp(p + 1, (char_u *)"SID>", 4) == 0 + || mb_strnicmp(p + 1, (char_u *)"SNR>", 4) == 0)) { return 5; - if (p[0] == 's' && p[1] == ':') + } + if (p[0] == 's' && p[1] == ':') { return 2; + } return 0; } @@ -20497,9 +20502,10 @@ script_autoload ( tofree = NULL; } - /* Try loading the package from $VIMRUNTIME/autoload/<name>.vim */ - if (source_runtime(scriptname, FALSE) == OK) - ret = TRUE; + // Try loading the package from $VIMRUNTIME/autoload/<name>.vim + if (source_runtime(scriptname, 0) == OK) { + ret = true; + } } xfree(tofree); @@ -22338,7 +22344,10 @@ bool eval_has_provider(char *name) } \ } - static int has_clipboard = -1, has_python = -1, has_python3 = -1; + static int has_clipboard = -1; + static int has_python = -1; + static int has_python3 = -1; + static int has_ruby = -1; if (!strcmp(name, "clipboard")) { check_provider(clipboard); @@ -22349,6 +22358,9 @@ bool eval_has_provider(char *name) } else if (!strcmp(name, "python")) { check_provider(python); return has_python; + } else if (!strcmp(name, "ruby")) { + check_provider(ruby); + return has_ruby; } return false; |