diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2024-01-26 15:40:00 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-01-26 15:06:25 +0000 |
commit | 65b1fd00a7aa9d88542a1daa84c26bc56962278f (patch) | |
tree | 8c288e55fe2fc62012a637028b2cb9e60a3c5960 /src | |
parent | eca72def1f08b3094e7e15c685b80108d441517c (diff) | |
download | rneovim-65b1fd00a7aa9d88542a1daa84c26bc56962278f.tar.gz rneovim-65b1fd00a7aa9d88542a1daa84c26bc56962278f.tar.bz2 rneovim-65b1fd00a7aa9d88542a1daa84c26bc56962278f.zip |
fix(extmarks): do not remove decor from invalid old marks
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/extmark.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index e4a3e79726..f7c16964b9 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -70,9 +70,10 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col extmark_del_id(buf, ns_id, id); } else { assert(marktree_itr_valid(itr)); + bool invalid = mt_invalid(old_mark); if (old_mark.pos.row == row && old_mark.pos.col == col) { // not paired: we can revise in place - if (mt_decor_any(old_mark)) { + if (!invalid && mt_decor_any(old_mark)) { mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_DECOR_SIGNTEXT; buf_decor_remove(buf, row, row, mt_decor(old_mark), true); } @@ -82,7 +83,9 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col goto revised; } marktree_del_itr(buf->b_marktree, itr, false); - buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, mt_decor(old_mark), true); + if (!invalid) { + buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, mt_decor(old_mark), true); + } } } else { *ns = MAX(*ns, id); |