Mercurial > vim
diff src/vim9execute.c @ 27394:69a48bcd1d80 v8.2.4225
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Commit: https://github.com/vim/vim/commit/70c43d84be98ab54d3723155dcc4232dc5a5f081
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 26 21:01:15 2022 +0000
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Problem: Vim9: depth argument of :lockvar not parsed in :def function.
Solution: Parse the optional depth argument. (closes https://github.com/vim/vim/issues/9629)
Fix that locking doesn't work for a non-materialize list.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 Jan 2022 22:15:03 +0100 |
parents | 1a6421c5be20 |
children | f00a7a2bee21 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1754,7 +1754,8 @@ execute_storeindex(isn_T *iptr, ectx_T * { listitem_T *li = list_find(list, lidx); - if (error_if_locked(li->li_tv.v_lock, e_cannot_change_list_item)) + if (error_if_locked(li->li_tv.v_lock, + e_cannot_change_locked_list_item)) return FAIL; // overwrite existing list item clear_tv(&li->li_tv); @@ -1762,7 +1763,7 @@ execute_storeindex(isn_T *iptr, ectx_T * } else { - if (error_if_locked(list->lv_lock, e_cannot_change_list)) + if (error_if_locked(list->lv_lock, e_cannot_change_locked_list)) return FAIL; // append to list, only fails when out of memory if (list_append_tv(list, tv) == FAIL)