@@ -900,6 +900,7 @@ eval_init()
900900 set_vim_var_nr(VV_SEARCHFORWARD, 1L);
901901 set_vim_var_nr(VV_HLSEARCH, 1L);
902902 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
903+ set_vim_var_list(VV_ERRORS, list_alloc());
903904 set_reg_var(0); /* default for v:register is not 0 but '"' */
904905
905906#ifdef EBCDIC
@@ -8749,7 +8750,9 @@ call_func(funcname, len, rettv, argcount, argvars, firstline, lastline,
87498750 * redo buffer.
87508751 */
87518752 save_search_patterns();
8753+ #ifdef FEAT_INS_EXPAND
87528754 if (!ins_compl_active())
8755+ #endif
87538756 {
87548757 saveRedobuff();
87558758 did_save_redo = TRUE;
@@ -17953,6 +17956,7 @@ typedef struct
1795317956
1795417957static int item_compare_ic;
1795517958static int item_compare_numeric;
17959+ static int item_compare_numbers;
1795617960static char_u *item_compare_func;
1795717961static dict_T *item_compare_selfdict;
1795817962static int item_compare_func_err;
@@ -17983,6 +17987,15 @@ item_compare(s1, s2)
1798317987 si2 = (sortItem_T *)s2;
1798417988 tv1 = &si1->item->li_tv;
1798517989 tv2 = &si2->item->li_tv;
17990+
17991+ if (item_compare_numbers)
17992+ {
17993+ long v1 = get_tv_number(tv1);
17994+ long v2 = get_tv_number(tv2);
17995+
17996+ return v1 == v2 ? 0 : v1 > v2 ? 1 : -1;
17997+ }
17998+
1798617999 /* tv2string() puts quotes around a string and allocates memory. Don't do
1798718000 * that for string variables. Use a single quote when comparing with a
1798818001 * non-string to do what the docs promise. */
@@ -18116,6 +18129,7 @@ do_sort_uniq(argvars, rettv, sort)
1811618129
1811718130 item_compare_ic = FALSE;
1811818131 item_compare_numeric = FALSE;
18132+ item_compare_numbers = FALSE;
1811918133 item_compare_func = NULL;
1812018134 item_compare_selfdict = NULL;
1812118135 if (argvars[1].v_type != VAR_UNKNOWN)
@@ -18141,6 +18155,11 @@ do_sort_uniq(argvars, rettv, sort)
1814118155 item_compare_func = NULL;
1814218156 item_compare_numeric = TRUE;
1814318157 }
18158+ else if (STRCMP(item_compare_func, "N") == 0)
18159+ {
18160+ item_compare_func = NULL;
18161+ item_compare_numbers = TRUE;
18162+ }
1814418163 else if (STRCMP(item_compare_func, "i") == 0)
1814518164 {
1814618165 item_compare_func = NULL;
0 commit comments