Merge pull request #14403 from seandewar/vim-8.2.1933

vim-patch:8.2.{0174,1933,1935,1946,2286,2287}
This commit is contained in:
Jan Edmund Lazo
2021-05-09 17:08:21 -04:00
committed by GitHub
20 changed files with 551 additions and 22 deletions

View File

@@ -9154,6 +9154,7 @@ static void f_sockconnect(typval_T *argvars, typval_T *rettv, FunPtr fptr)
/// struct storing information about current sort
typedef struct {
int item_compare_ic;
bool item_compare_lc;
bool item_compare_numeric;
bool item_compare_numbers;
bool item_compare_float;
@@ -9228,10 +9229,10 @@ static int item_compare(const void *s1, const void *s2, bool keep_zero)
p2 = "";
}
if (!sortinfo->item_compare_numeric) {
if (sortinfo->item_compare_ic) {
res = STRICMP(p1, p2);
if (sortinfo->item_compare_lc) {
res = strcoll(p1, p2);
} else {
res = STRCMP(p1, p2);
res = sortinfo->item_compare_ic ? STRICMP(p1, p2): STRCMP(p1, p2);
}
} else {
double n1, n2;
@@ -9366,6 +9367,7 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, bool sort)
}
info.item_compare_ic = false;
info.item_compare_lc = false;
info.item_compare_numeric = false;
info.item_compare_numbers = false;
info.item_compare_float = false;
@@ -9410,6 +9412,9 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, bool sort)
} else if (strcmp(info.item_compare_func, "i") == 0) {
info.item_compare_func = NULL;
info.item_compare_ic = true;
} else if (strcmp(info.item_compare_func, "l") == 0) {
info.item_compare_func = NULL;
info.item_compare_lc = true;
}
}
}