mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
free_buffer: rework b:changedtick handling #9163
- Re-enable Test_BufLeave_Wipe. 66f5e5c7d7
This is my (probably-wrong) application of Zyx's suggestion in #9163:
> free_buffer_stuff() already removes changedtick. It is better to
> make `free_options` a flag variable and avoid calling
> buf_init_changedtick() based on some flag there: current workflow
> looks weird as it first removes `b:changedtick`, then re-adds it
> by calling buf_init_changedtick(), then remove again.
> Also based on my understanding it looks logical to not remove
> `b:changedtick`, but to *replace* it with something allocated if
> needed based on examining reference count before calling
> `unref_var_dict`. Because now you have key disappearing from
> dictionary for no good reason.
Patch-By: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
This commit is contained in:
@@ -1272,7 +1272,7 @@ void tv_dict_item_free(dictitem_T *const item)
|
||||
/// @param[in] di Item to copy.
|
||||
///
|
||||
/// @return [allocated] new dictionary item.
|
||||
static dictitem_T *tv_dict_item_copy(dictitem_T *const di)
|
||||
dictitem_T *tv_dict_item_copy(dictitem_T *const di)
|
||||
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
dictitem_T *const new_di = tv_dict_item_alloc((const char *)di->di_key);
|
||||
|
Reference in New Issue
Block a user