Merge pull request #13340 from janlazo/vim-8.2.2025

vim-patch:8.1.1749,8.2.{579,2025,2027,2028,2029}
This commit is contained in:
Jan Edmund Lazo 2020-11-21 18:20:44 -05:00 committed by GitHub
commit 185732a1f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 19 deletions

View File

@ -1971,7 +1971,7 @@ char_u *get_lval(char_u *const name, typval_T *const rettv,
typval_T var2; typval_T var2;
int empty1 = FALSE; int empty1 = FALSE;
listitem_T *ni; listitem_T *ni;
hashtab_T *ht; hashtab_T *ht = NULL;
int quiet = flags & GLV_QUIET; int quiet = flags & GLV_QUIET;
// Clear everything in "lp". // Clear everything in "lp".
@ -2441,7 +2441,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv,
tv_copy(rettv, lp->ll_tv); tv_copy(rettv, lp->ll_tv);
} else { } else {
*lp->ll_tv = *rettv; *lp->ll_tv = *rettv;
lp->ll_tv->v_lock = 0; lp->ll_tv->v_lock = VAR_UNLOCKED;
tv_init(rettv); tv_init(rettv);
} }
@ -5458,7 +5458,7 @@ static int dict_get_tv(char_u **arg, typval_T *rettv, int evaluate,
} }
item = tv_dict_item_alloc((const char *)key); item = tv_dict_item_alloc((const char *)key);
item->di_tv = tv; item->di_tv = tv;
item->di_tv.v_lock = 0; item->di_tv.v_lock = VAR_UNLOCKED;
if (tv_dict_add(d, item) == FAIL) { if (tv_dict_add(d, item) == FAIL) {
tv_dict_item_free(item); tv_dict_item_free(item);
} }
@ -6128,7 +6128,7 @@ static int filter_map_one(typval_T *tv, typval_T *expr, int map, int *remp)
if (map) { if (map) {
// map(): replace the list item value. // map(): replace the list item value.
tv_clear(tv); tv_clear(tv);
rettv.v_lock = 0; rettv.v_lock = VAR_UNLOCKED;
*tv = rettv; *tv = rettv;
} else { } else {
bool error = false; bool error = false;
@ -9078,7 +9078,7 @@ static void set_var_const(const char *name, const size_t name_len,
tv_copy(tv, &v->di_tv); tv_copy(tv, &v->di_tv);
} else { } else {
v->di_tv = *tv; v->di_tv = *tv;
v->di_tv.v_lock = 0; v->di_tv.v_lock = VAR_UNLOCKED;
tv_init(tv); tv_init(tv);
} }
@ -9275,7 +9275,7 @@ int var_item_copy(const vimconv_T *const conv,
tv_copy(from, to); tv_copy(from, to);
} else { } else {
to->v_type = VAR_STRING; to->v_type = VAR_STRING;
to->v_lock = 0; to->v_lock = VAR_UNLOCKED;
if ((to->vval.v_string = string_convert((vimconv_T *)conv, if ((to->vval.v_string = string_convert((vimconv_T *)conv,
from->vval.v_string, from->vval.v_string,
NULL)) NULL))
@ -9286,7 +9286,7 @@ int var_item_copy(const vimconv_T *const conv,
break; break;
case VAR_LIST: case VAR_LIST:
to->v_type = VAR_LIST; to->v_type = VAR_LIST;
to->v_lock = 0; to->v_lock = VAR_UNLOCKED;
if (from->vval.v_list == NULL) { if (from->vval.v_list == NULL) {
to->vval.v_list = NULL; to->vval.v_list = NULL;
} else if (copyID != 0 && tv_list_copyid(from->vval.v_list) == copyID) { } else if (copyID != 0 && tv_list_copyid(from->vval.v_list) == copyID) {
@ -9302,7 +9302,7 @@ int var_item_copy(const vimconv_T *const conv,
break; break;
case VAR_DICT: case VAR_DICT:
to->v_type = VAR_DICT; to->v_type = VAR_DICT;
to->v_lock = 0; to->v_lock = VAR_UNLOCKED;
if (from->vval.v_dict == NULL) { if (from->vval.v_dict == NULL) {
to->vval.v_dict = NULL; to->vval.v_dict = NULL;
} else if (copyID != 0 && from->vval.v_dict->dv_copyID == copyID) { } else if (copyID != 0 && from->vval.v_dict->dv_copyID == copyID) {
@ -10466,9 +10466,10 @@ typval_T eval_call_provider(char *provider, char *method, list_T *arguments,
provider_call_nesting++; provider_call_nesting++;
typval_T argvars[3] = { typval_T argvars[3] = {
{.v_type = VAR_STRING, .vval.v_string = (uint8_t *)method, .v_lock = 0}, { .v_type = VAR_STRING, .vval.v_string = (char_u *)method,
{.v_type = VAR_LIST, .vval.v_list = arguments, .v_lock = 0}, .v_lock = VAR_UNLOCKED },
{.v_type = VAR_UNKNOWN} { .v_type = VAR_LIST, .vval.v_list = arguments, .v_lock = VAR_UNLOCKED },
{ .v_type = VAR_UNKNOWN }
}; };
typval_T rettv = { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED }; typval_T rettv = { .v_type = VAR_UNKNOWN, .v_lock = VAR_UNLOCKED };
tv_list_ref(arguments); tv_list_ref(arguments);

View File

@ -725,7 +725,7 @@ int tv_list_concat(list_T *const l1, list_T *const l2, typval_T *const tv)
list_T *l; list_T *l;
tv->v_type = VAR_LIST; tv->v_type = VAR_LIST;
tv->v_lock = VAR_UNLOCKED;
if (l1 == NULL && l2 == NULL) { if (l1 == NULL && l2 == NULL) {
l = NULL; l = NULL;
} else if (l1 == NULL) { } else if (l1 == NULL) {

View File

@ -851,7 +851,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars,
v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
tv_dict_add(&fc->l_vars, v); tv_dict_add(&fc->l_vars, v);
v->di_tv.v_type = VAR_DICT; v->di_tv.v_type = VAR_DICT;
v->di_tv.v_lock = 0; v->di_tv.v_lock = VAR_UNLOCKED;
v->di_tv.vval.v_dict = selfdict; v->di_tv.vval.v_dict = selfdict;
++selfdict->dv_refcount; ++selfdict->dv_refcount;
} }

View File

@ -1847,13 +1847,12 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
CancelRedo(); CancelRedo();
} else { } else {
(void)op_delete(oap); (void)op_delete(oap);
if (oap->motion_type == kMTLineWise && has_format_option(FO_AUTO)) { // save cursor line for undo if it wasn't saved yet
// cursor line wasn't saved yet if (oap->motion_type == kMTLineWise
if (u_save_cursor() == FAIL) { && has_format_option(FO_AUTO)
break; && u_save_cursor() == OK) {
} auto_format(false, true);
} }
auto_format(false, true);
} }
break; break;