aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/extmark.h
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-10-24 13:32:00 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-11-08 02:53:49 +0100
commit4e6f559b8c5f77924fdbe2e5abd9c6aa8efad13f (patch)
tree758c87fba796537921e16c49bcd2c377e77e6506 /src/nvim/extmark.h
parent324fad1e88ba38c87db446418a96fd3170b7f392 (diff)
downloadrneovim-4e6f559b8c5f77924fdbe2e5abd9c6aa8efad13f.tar.gz
rneovim-4e6f559b8c5f77924fdbe2e5abd9c6aa8efad13f.tar.bz2
rneovim-4e6f559b8c5f77924fdbe2e5abd9c6aa8efad13f.zip
feat(extmarks): add 'invalidate' property to extmarks
Problem: No way to have extmarks automatically removed when the range it is attached to is deleted. Solution: Add new 'invalidate' property that will hide a mark when the entirety of its range is deleted. When "undo_restore" is set to false, delete the mark from the buffer instead.
Diffstat (limited to 'src/nvim/extmark.h')
-rw-r--r--src/nvim/extmark.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h
index 83c7a7cb69..6b7292465c 100644
--- a/src/nvim/extmark.h
+++ b/src/nvim/extmark.h
@@ -25,9 +25,13 @@ typedef struct {
colnr_T end_col;
bool right_gravity;
bool end_right_gravity;
+ bool invalidate;
+ bool invalid;
bool no_undo;
Decoration decor; // TODO(bfredl): CHONKY
} ExtmarkInfo;
+#define EXTMARKINFO_INIT { 0, 0, -1, -1, -1, -1, false, false, false, false, false, \
+ DECORATION_INIT };
typedef kvec_t(ExtmarkInfo) ExtmarkInfoArray;
@@ -67,6 +71,7 @@ typedef struct {
colnr_T old_col;
int row;
colnr_T col;
+ bool invalidated;
} ExtmarkSavePos;
typedef enum {