refactor(decorations): merge the two different code paths for virt_text

test(bufhl): CHANGE of tested behaviour (inb4 a proper priority mechanism)
test(decoration): change of test; previous behavior was buggy (ghost
buffer text)
This commit is contained in:
Björn Linse
2021-07-25 14:33:28 +02:00
parent 1495d36d63
commit a4d81a8002
7 changed files with 78 additions and 117 deletions

View File

@@ -34,19 +34,20 @@ typedef enum {
struct Decoration
{
int hl_id; // highlight group
VirtText virt_text;
int hl_id; // highlight group
VirtTextPos virt_text_pos;
bool virt_text_hide;
HlMode hl_mode;
bool virt_text_hide;
bool hl_eol;
bool shared; // shared decoration, don't free
// TODO(bfredl): style, signs, etc
DecorPriority priority;
bool shared; // shared decoration, don't free
int col; // fixed col value, like win_col
int virt_text_width; // width of virt_text
};
#define DECORATION_INIT { 0, KV_INITIAL_VALUE, kVTEndOfLine, false, \
kHlModeUnknown, false, DECOR_PRIORITY_BASE, false, 0 }
#define DECORATION_INIT { KV_INITIAL_VALUE, 0, kVTEndOfLine, kHlModeUnknown, \
false, false, false, DECOR_PRIORITY_BASE, 0, 0 }
typedef struct {
int start_row;
@@ -67,6 +68,8 @@ typedef struct {
int row;
int col_until;
int current;
int eol_col;
VirtText *virt_text;
} DecorState;