diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-12 21:24:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 21:24:28 +0800 |
commit | 2d9e063a63f8af7eb9e8321c4845ec4f077ccf58 (patch) | |
tree | fb83cdefeccd710ae3545053fe59ffee430556c2 /src/nvim/extmark.c | |
parent | 597ecf751603cde2d5f58021d503ae20a12eb2f2 (diff) | |
download | rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.tar.gz rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.tar.bz2 rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.zip |
fix(extmarks): redraw pre-undo position (#27437)
Problem:
Virtual text not redrawn properly after undo moves its extmark.
Solution:
Redraw the moved extmark's pre-undo position.
Diffstat (limited to 'src/nvim/extmark.c')
-rw-r--r-- | src/nvim/extmark.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index 0f9e7749f1..e753ad199a 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -116,6 +116,12 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool return; } + // Only the position before undo needs to be redrawn here, + // as the position after undo should be marked as changed. + if (!invalid && mt_decor_any(key) && key.pos.row != row) { + decor_redraw(buf, key.pos.row, key.pos.row, key.pos.col, mt_decor(key)); + } + int row1 = 0; int row2 = 0; if (invalid) { |