decoration: split out "decoration" from "extmark" module

Decorations will only grow more complex. move the to a separate
file, so that extmark.c remains about extmarks.
This commit is contained in:
Björn Linse
2020-11-07 09:24:00 +01:00
parent da134270d3
commit 8497d4b3ea
15 changed files with 471 additions and 428 deletions

View File

@@ -4,21 +4,7 @@
#include "nvim/types.h"
#include "nvim/lib/kvec.h"
typedef struct {
char *text;
int hl_id;
} VirtTextChunk;
typedef kvec_t(VirtTextChunk) VirtText;
#define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE)
typedef struct
{
int hl_id; // highlight group
VirtText virt_text;
// TODO(bfredl): style, signs, etc
bool shared; // shared decoration, don't free
} Decoration;
typedef struct Decoration Decoration;
typedef struct
{
@@ -42,21 +28,4 @@ typedef enum {
kExtmarkUndoNoRedo, // Operation should be undoable, but not redoable
} ExtmarkOp;
typedef struct {
NS ns_id;
bool active;
LuaRef redraw_start;
LuaRef redraw_buf;
LuaRef redraw_win;
LuaRef redraw_line;
LuaRef redraw_end;
LuaRef hl_def;
int hl_valid;
} DecorationProvider;
#define DECORATION_PROVIDER_INIT(ns_id) (DecorationProvider) \
{ ns_id, false, LUA_NOREF, LUA_NOREF, \
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
LUA_NOREF, -1 }
#endif // NVIM_EXTMARK_DEFS_H