aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-03-19 11:00:42 +0100
committerGitHub <noreply@github.com>2025-03-19 10:00:42 +0000
commitd6653e1cc957ef39b397e073230da87ee9a5411d (patch)
tree7582389a62aaf0383fcf50e2ff9026398703e59a /src
parent5ff8a2fa8bd1644813c16d797d9101fece714365 (diff)
downloadrneovim-d6653e1cc957ef39b397e073230da87ee9a5411d.tar.gz
rneovim-d6653e1cc957ef39b397e073230da87ee9a5411d.tar.bz2
rneovim-d6653e1cc957ef39b397e073230da87ee9a5411d.zip
fix(marks): ensure decor is removed with proper range (#32973)
Problem: Paired mark whose end is in front of its start should not have its decor removed (as fixed by 72f630f9), but may still need to have its range redrawn. Solution: Still call `buf_decor_remove()` but ensure it is not called with an inverse range when `extmark_del()` is called on an end mark.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/extmark.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index cad0f71941..b981ffdaf9 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -180,11 +180,14 @@ void extmark_del(buf_T *buf, MarkTreeIter *itr, MTKey key, bool restore)
}
if (mt_decor_any(key)) {
- // If key is an end mark it has been found first while iterating the marktree,
- // indicating the decor is already invalid.
- if (mt_invalid(key) || mt_end(key)) {
+ if (mt_invalid(key)) {
decor_free(mt_decor(key));
} else {
+ if (mt_end(key)) {
+ MTKey k = key;
+ key = key2;
+ key2 = k;
+ }
buf_decor_remove(buf, key.pos.row, key2.pos.row, key.pos.col, mt_decor(key), true);
}
}