aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-26 21:34:18 +0800
committerGitHub <noreply@github.com>2022-10-26 21:34:18 +0800
commitc00e711d5a860fb019f594d164b4327d942313f8 (patch)
tree6b88d5ab645201a103cad3a67a98eadb07e6e5b4 /src/nvim/eval
parentd60fa43466eaf59999e39860ce6d0ce2fa2cfb36 (diff)
parent46a54dd6a03f51ba08142abe0aa5710705917987 (diff)
downloadrneovim-c00e711d5a860fb019f594d164b4327d942313f8.tar.gz
rneovim-c00e711d5a860fb019f594d164b4327d942313f8.tar.bz2
rneovim-c00e711d5a860fb019f594d164b4327d942313f8.zip
Merge pull request #20814 from zeertzjq/vim-8.2.0610
vim-patch:8.2.{0610,0619,1852}
Diffstat (limited to 'src/nvim/eval')
-rw-r--r--src/nvim/eval/typval.c12
-rw-r--r--src/nvim/eval/userfunc.c4
2 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index 6bb390d793..3b513bfafb 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -1094,7 +1094,9 @@ static int item_compare2(const void *s1, const void *s2, bool keep_zero)
tv_clear(&argv[1]);
if (res == FAIL) {
+ // XXX: ITEM_COMPARE_FAIL is unused
res = ITEM_COMPARE_FAIL;
+ sortinfo->item_compare_func_err = true;
} else {
res = (int)tv_get_number_chk(&rettv, &sortinfo->item_compare_func_err);
if (res > 0) {
@@ -1257,7 +1259,7 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, bool sort)
} else {
li = TV_LIST_ITEM_NEXT(l, li);
}
- if (info.item_compare_func_err) { // -V547
+ if (info.item_compare_func_err) {
emsg(_("E882: Uniq compare function failed"));
break;
}
@@ -2488,10 +2490,14 @@ bool tv_dict_equal(dict_T *const d1, dict_T *const d2, const bool ic, const bool
if (d1 == d2) {
return true;
}
- if (d1 == NULL || d2 == NULL) {
+ if (tv_dict_len(d1) != tv_dict_len(d2)) {
return false;
}
- if (tv_dict_len(d1) != tv_dict_len(d2)) {
+ if (tv_dict_len(d1) == 0) {
+ // empty and NULL dicts are considered equal
+ return true;
+ }
+ if (d1 == NULL || d2 == NULL) {
return false;
}
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 4a62b4bf8d..7440044e52 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -1335,10 +1335,10 @@ void free_all_functions(void)
/// @param[in] len length of "name", or -1 for NUL terminated.
///
/// @return true if "name" looks like a builtin function name: starts with a
-/// lower case letter and doesn't contain AUTOLOAD_CHAR.
+/// lower case letter and doesn't contain AUTOLOAD_CHAR or ':'.
static bool builtin_function(const char *name, int len)
{
- if (!ASCII_ISLOWER(name[0])) {
+ if (!ASCII_ISLOWER(name[0]) || name[1] == ':') {
return false;
}