1 #ifndef NVIM_SIGN_DEFS_H 2 #define NVIM_SIGN_DEFS_H 3 4 #include <stdbool.h> 5 6 #include "nvim/pos.h" 7 #include "nvim/types.h" 8 9 // signs: line annotations 10 11 // Sign group 12 typedef struct signgroup_S { 13 uint16_t sg_refcount; // number of signs in this group 14 int sg_next_sign_id; // next sign id for this group 15 char_u sg_name[1]; // sign group name 16 } signgroup_T; 17 18 // Macros to get the sign group structure from the group name 19 #define SGN_KEY_OFF offsetof(signgroup_T, sg_name) 20 #define HI2SG(hi) ((signgroup_T *)((hi)->hi_key - SGN_KEY_OFF)) 21 22 typedef struct sign_entry sign_entry_T; 23 24 struct sign_entry { 25 int se_id; // unique identifier for each placed sign 26 int se_typenr; // typenr of sign 27 int se_priority; // priority for highlighting 28 bool se_has_text_or_icon; // has text or icon 29 linenr_T se_lnum; // line number which has this sign 30 signgroup_T *se_group; // sign group 31 sign_entry_T *se_next; // next entry in a list of signs 32 sign_entry_T *se_prev; // previous entry -- for easy reordering 33 }; 34 35 /// Sign attributes. Used by the screen refresh routines. 36 typedef struct sign_attrs_S { 37 int sat_typenr; 38 char_u *sat_text; 39 int sat_texthl; 40 int sat_linehl; 41 int sat_numhl; 42 } sign_attrs_T; 43 44 #define SIGN_SHOW_MAX 9 45 46 // Default sign priority for highlighting 47 #define SIGN_DEF_PRIO 10 48 49 // type argument for sign_get_attr() 50 typedef enum { 51 SIGN_LINEHL, 52 SIGN_NUMHL, 53 SIGN_TEXT, 54 } SignType; 55 56 57 #endif // NVIM_SIGN_DEFS_H 58