mirror of
https://github.com/neovim/neovim.git
synced 2025-10-14 22:06:07 +00:00
feat(decorations): support more than one virt_lines block
This commit is contained in:
@@ -24,22 +24,34 @@ typedef enum {
|
||||
kHlModeBlend,
|
||||
} HlMode;
|
||||
|
||||
typedef kvec_t(VirtTextChunk) VirtText;
|
||||
#define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE)
|
||||
|
||||
|
||||
typedef kvec_t(struct virt_line { VirtText line; bool left_col; }) VirtLines;
|
||||
|
||||
|
||||
struct Decoration
|
||||
{
|
||||
VirtText virt_text;
|
||||
VirtLines virt_lines;
|
||||
|
||||
int hl_id; // highlight group
|
||||
VirtTextPos virt_text_pos;
|
||||
HlMode hl_mode;
|
||||
|
||||
// TODO(bfredl): at some point turn this into FLAGS
|
||||
bool virt_text_hide;
|
||||
bool hl_eol;
|
||||
bool shared; // shared decoration, don't free
|
||||
bool virt_lines_above;
|
||||
// TODO(bfredl): style, signs, etc
|
||||
DecorPriority priority;
|
||||
int col; // fixed col value, like win_col
|
||||
int virt_text_width; // width of virt_text
|
||||
};
|
||||
#define DECORATION_INIT { KV_INITIAL_VALUE, 0, kVTEndOfLine, kHlModeUnknown, \
|
||||
false, false, false, DECOR_PRIORITY_BASE, 0, 0 }
|
||||
#define DECORATION_INIT { KV_INITIAL_VALUE, KV_INITIAL_VALUE, 0, kVTEndOfLine, kHlModeUnknown, \
|
||||
false, false, false, false, DECOR_PRIORITY_BASE, 0, 0 }
|
||||
|
||||
typedef struct {
|
||||
int start_row;
|
||||
@@ -60,9 +72,7 @@ typedef struct {
|
||||
int row;
|
||||
int col_until;
|
||||
int current;
|
||||
|
||||
int eol_col;
|
||||
VirtText *virt_text;
|
||||
} DecorState;
|
||||
|
||||
typedef struct {
|
||||
|
Reference in New Issue
Block a user