diff options
Diffstat (limited to 'src/nvim/sign_defs.h')
-rw-r--r-- | src/nvim/sign_defs.h | 64 |
1 files changed, 16 insertions, 48 deletions
diff --git a/src/nvim/sign_defs.h b/src/nvim/sign_defs.h index 16e783aab7..79d21585fc 100644 --- a/src/nvim/sign_defs.h +++ b/src/nvim/sign_defs.h @@ -1,54 +1,22 @@ -#ifndef NVIM_SIGN_DEFS_H -#define NVIM_SIGN_DEFS_H - -#include <stdbool.h> - -#include "nvim/pos.h" -#include "nvim/types.h" - -// signs: line annotations - -// Sign group -typedef struct signgroup_S { - uint16_t sg_refcount; // number of signs in this group - int sg_next_sign_id; // next sign id for this group - char sg_name[1]; // sign group name -} signgroup_T; - -// Macros to get the sign group structure from the group name -#define SGN_KEY_OFF offsetof(signgroup_T, sg_name) -#define HI2SG(hi) ((signgroup_T *)((hi)->hi_key - SGN_KEY_OFF)) - -typedef struct sign_entry sign_entry_T; - -struct sign_entry { - int se_id; // unique identifier for each placed sign - int se_typenr; // typenr of sign - int se_priority; // priority for highlighting - bool se_has_text_or_icon; // has text or icon - linenr_T se_lnum; // line number which has this sign - signgroup_T *se_group; // sign group - sign_entry_T *se_next; // next entry in a list of signs - sign_entry_T *se_prev; // previous entry -- for easy reordering -}; +#pragma once /// Sign attributes. Used by the screen refresh routines. typedef struct { char *text; - int hl_attr_id; - int priority; + int hl_id; } SignTextAttrs; -#define SIGN_SHOW_MAX 9 - -// Default sign priority for highlighting -#define SIGN_DEF_PRIO 10 - -// type argument for sign_get_attr() -typedef enum { - SIGN_LINEHL, - SIGN_NUMHL, - SIGN_TEXT, -} SignType; - -#endif // NVIM_SIGN_DEFS_H +/// Struct to hold the sign properties. +typedef struct sign { + char *sn_name; // name of sign + char *sn_icon; // name of pixmap + char *sn_text; // text used instead of pixmap + int sn_line_hl; // highlight ID for line + int sn_text_hl; // highlight ID for text + int sn_cul_hl; // highlight ID for text on current line when 'cursorline' is set + int sn_num_hl; // highlight ID for line number +} sign_T; + +enum { SIGN_WIDTH = 2, }; ///< Number of display cells for a sign in the signcolumn +enum { SIGN_SHOW_MAX = 9, }; ///< Maximum number of signs shown on a single line +enum { SIGN_DEF_PRIO = 10, }; ///< Default sign highlight priority |