diff options
Diffstat (limited to 'src/nvim/marktree.h')
-rw-r--r-- | src/nvim/marktree.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h index 79e8f8f50e..82cb95d8e3 100644 --- a/src/nvim/marktree.h +++ b/src/nvim/marktree.h @@ -78,17 +78,19 @@ typedef struct { #define MT_FLAG_ORPHANED (((uint16_t)1) << 3) #define MT_FLAG_HL_EOL (((uint16_t)1) << 4) #define MT_FLAG_NO_UNDO (((uint16_t)1) << 5) +#define MT_FLAG_INVALIDATE (((uint16_t)1) << 6) +#define MT_FLAG_INVALID (((uint16_t)1) << 7) #define DECOR_LEVELS 4 -#define MT_FLAG_DECOR_OFFSET 6 +#define MT_FLAG_DECOR_OFFSET 8 #define MT_FLAG_DECOR_MASK (((uint16_t)(DECOR_LEVELS - 1)) << MT_FLAG_DECOR_OFFSET) // These _must_ be last to preserve ordering of marks #define MT_FLAG_RIGHT_GRAVITY (((uint16_t)1) << 14) #define MT_FLAG_LAST (((uint16_t)1) << 15) -#define MT_FLAG_EXTERNAL_MASK (MT_FLAG_DECOR_MASK | MT_FLAG_RIGHT_GRAVITY | \ - MT_FLAG_NO_UNDO | MT_FLAG_HL_EOL) +#define MT_FLAG_EXTERNAL_MASK (MT_FLAG_DECOR_MASK | MT_FLAG_RIGHT_GRAVITY | MT_FLAG_HL_EOL \ + | MT_FLAG_NO_UNDO | MT_FLAG_INVALIDATE | MT_FLAG_INVALID) // this is defined so that start and end of the same range have adjacent ids #define MARKTREE_END_FLAG ((uint64_t)1) @@ -132,17 +134,30 @@ static inline bool mt_no_undo(MTKey key) return key.flags & MT_FLAG_NO_UNDO; } +static inline bool mt_invalidate(MTKey key) +{ + return key.flags & MT_FLAG_INVALIDATE; +} + +static inline bool mt_invalid(MTKey key) +{ + return key.flags & MT_FLAG_INVALID; +} + static inline uint8_t marktree_decor_level(MTKey key) { return (uint8_t)((key.flags&MT_FLAG_DECOR_MASK) >> MT_FLAG_DECOR_OFFSET); } -static inline uint16_t mt_flags(bool right_gravity, uint8_t decor_level, bool no_undo) +static inline uint16_t mt_flags(bool right_gravity, bool hl_eol, bool no_undo, bool invalidate, + uint8_t decor_level) { assert(decor_level < DECOR_LEVELS); return (uint16_t)((right_gravity ? MT_FLAG_RIGHT_GRAVITY : 0) - | (decor_level << MT_FLAG_DECOR_OFFSET) - | (no_undo ? MT_FLAG_NO_UNDO : 0)); + | (hl_eol ? MT_FLAG_HL_EOL : 0) + | (no_undo ? MT_FLAG_NO_UNDO : 0) + | (invalidate ? MT_FLAG_INVALIDATE : 0) + | (decor_level << MT_FLAG_DECOR_OFFSET)); } typedef kvec_withinit_t(uint64_t, 4) Intersection; |