fix(api): notify dict watchers on nvim_set_var and vim.g setter

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
This commit is contained in:
smolck
2021-08-14 12:19:05 -05:00
committed by bfredl
parent 1d337d4e2f
commit c7d30c152d
5 changed files with 103 additions and 7 deletions

View File

@@ -1348,12 +1348,8 @@ void set_var_const(const char *name, const size_t name_len, typval_T *const tv,
}
if (watched) {
if (oldtv.v_type == VAR_UNKNOWN) {
tv_dict_watcher_notify(dict, (char *)v->di_key, &v->di_tv, NULL);
} else {
tv_dict_watcher_notify(dict, (char *)v->di_key, &v->di_tv, &oldtv);
tv_clear(&oldtv);
}
tv_dict_watcher_notify(dict, (char *)v->di_key, &v->di_tv, &oldtv);
tv_clear(&oldtv);
}
if (is_const) {