diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-08-05 14:08:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-05 14:08:28 +0200 |
commit | fd1d84c705128372dc25e3a833e9a1dc6b9e81e0 (patch) | |
tree | cd42ac3b29c6b2ac214bd81c3d11ece9dbd406c9 /src/nvim/ops.c | |
parent | c7b100630ae65b904a722c57f1fde1d9669cc643 (diff) | |
parent | 1247684ae14e83c5b742be390de8dee00fd4e241 (diff) | |
download | rneovim-fd1d84c705128372dc25e3a833e9a1dc6b9e81e0.tar.gz rneovim-fd1d84c705128372dc25e3a833e9a1dc6b9e81e0.tar.bz2 rneovim-fd1d84c705128372dc25e3a833e9a1dc6b9e81e0.zip |
Merge pull request #29540 from bfredl/neoshada
refactor(shada): rework msgpack decoding without msgpack-c
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index e418635d37..05b9db474e 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -930,16 +930,6 @@ int do_record(int c) return retval; } -static void set_yreg_additional_data(yankreg_T *reg, dict_T *additional_data) - FUNC_ATTR_NONNULL_ARG(1) -{ - if (reg->additional_data == additional_data) { - return; - } - tv_dict_unref(reg->additional_data); - reg->additional_data = additional_data; -} - /// Stuff string "p" into yank register "regname" as a single line (append if /// uppercase). "p" must have been allocated. /// @@ -969,7 +959,7 @@ static int stuff_yank(int regname, char *p) *pp = lp; } else { free_register(reg); - set_yreg_additional_data(reg, NULL); + reg->additional_data = NULL; reg->y_array = xmalloc(sizeof(char *)); reg->y_array[0] = p; reg->y_size = 1; @@ -2507,7 +2497,7 @@ void clear_registers(void) void free_register(yankreg_T *reg) FUNC_ATTR_NONNULL_ALL { - set_yreg_additional_data(reg, NULL); + XFREE_CLEAR(reg->additional_data); if (reg->y_array == NULL) { return; } @@ -5144,7 +5134,7 @@ static void str_to_reg(yankreg_T *y_ptr, MotionType yank_type, const char *str, } y_ptr->y_type = yank_type; y_ptr->y_size = lnum; - set_yreg_additional_data(y_ptr, NULL); + XFREE_CLEAR(y_ptr->additional_data); y_ptr->timestamp = os_time(); if (yank_type == kMTBlockWise) { y_ptr->y_width = (blocklen == -1 ? (colnr_T)maxlen - 1 : blocklen); |