aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/decoration.h
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-01-03 12:22:13 +0000
committerLewis Russell <lewis6991@gmail.com>2022-03-05 16:51:59 +0000
commit30e4cc3b3f2133e9a7170da9da8175832681f39a (patch)
tree76cca17f4b3389246743afc5febaeb11deeb20b1 /src/nvim/decoration.h
parent83fc914337100d03f2e41a3943ccf0107d893698 (diff)
downloadrneovim-30e4cc3b3f2133e9a7170da9da8175832681f39a.tar.gz
rneovim-30e4cc3b3f2133e9a7170da9da8175832681f39a.tar.bz2
rneovim-30e4cc3b3f2133e9a7170da9da8175832681f39a.zip
feat(decorations): support signs
Add the following options to extmarks: - sign_text - sign_hl_group - number_hl_group - line_hl_group - cursorline_hl_group Note: ranges are unsupported and decorations are only applied to start_row
Diffstat (limited to 'src/nvim/decoration.h')
-rw-r--r--src/nvim/decoration.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h
index 02472d09e4..7e6dbdf1a7 100644
--- a/src/nvim/decoration.h
+++ b/src/nvim/decoration.h
@@ -47,13 +47,18 @@ struct Decoration {
bool virt_text_hide;
bool hl_eol;
bool virt_lines_above;
- // TODO(bfredl): style, signs, etc
+ // TODO(bfredl): style, etc
DecorPriority priority;
int col; // fixed col value, like win_col
int virt_text_width; // width of virt_text
+ char_u *sign_text;
+ int sign_hl_id;
+ int number_hl_id;
+ int line_hl_id;
+ int cursorline_hl_id;
};
#define DECORATION_INIT { KV_INITIAL_VALUE, KV_INITIAL_VALUE, 0, kVTEndOfLine, kHlModeUnknown, \
- false, false, false, DECOR_PRIORITY_BASE, 0, 0 }
+ false, false, false, DECOR_PRIORITY_BASE, 0, 0, NULL, 0, 0, 0, 0 }
typedef struct {
int start_row;
@@ -75,6 +80,7 @@ typedef struct {
int col_until;
int current;
int eol_col;
+ bool has_sign_decor;
} DecorState;
typedef struct {
@@ -98,6 +104,15 @@ EXTERN bool provider_active INIT(= false);
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
LUA_NOREF, -1 }
+static inline bool decor_has_sign(Decoration *decor)
+{
+ return decor->sign_text
+ || decor->sign_hl_id
+ || decor->number_hl_id
+ || decor->line_hl_id
+ || decor->cursorline_hl_id;
+}
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "decoration.h.generated.h"
#endif