mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
refactor(decorations): unglobal decor_providers
Now all the decoration provider code is in one place, decor_providers no longer need to be global.
This commit is contained in:
@@ -9,6 +9,13 @@
|
|||||||
#include "nvim/highlight.h"
|
#include "nvim/highlight.h"
|
||||||
#include "nvim/lua/executor.h"
|
#include "nvim/lua/executor.h"
|
||||||
|
|
||||||
|
static kvec_t(DecorProvider) decor_providers = KV_INITIAL_VALUE;
|
||||||
|
|
||||||
|
#define DECORATION_PROVIDER_INIT(ns_id) (DecorProvider) \
|
||||||
|
{ ns_id, false, LUA_NOREF, LUA_NOREF, \
|
||||||
|
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
|
||||||
|
LUA_NOREF, -1 }
|
||||||
|
|
||||||
static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref,
|
static bool decor_provider_invoke(NS ns_id, const char *name, LuaRef ref,
|
||||||
Array args, bool default_true, char **perr)
|
Array args, bool default_true, char **perr)
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
#define NVIM_DECORATION_PROVIDER_H
|
#define NVIM_DECORATION_PROVIDER_H
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/extmark_defs.h"
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NS ns_id;
|
NS ns_id;
|
||||||
@@ -16,14 +15,8 @@ typedef struct {
|
|||||||
int hl_valid;
|
int hl_valid;
|
||||||
} DecorProvider;
|
} DecorProvider;
|
||||||
|
|
||||||
#define DECORATION_PROVIDER_INIT(ns_id) (DecorProvider) \
|
|
||||||
{ ns_id, false, LUA_NOREF, LUA_NOREF, \
|
|
||||||
LUA_NOREF, LUA_NOREF, LUA_NOREF, \
|
|
||||||
LUA_NOREF, -1 }
|
|
||||||
|
|
||||||
typedef kvec_withinit_t(DecorProvider *, 4) DecorProviders;
|
typedef kvec_withinit_t(DecorProvider *, 4) DecorProviders;
|
||||||
|
|
||||||
EXTERN kvec_t(DecorProvider) decor_providers INIT(= KV_INITIAL_VALUE);
|
|
||||||
EXTERN bool provider_active INIT(= false);
|
EXTERN bool provider_active INIT(= false);
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
Reference in New Issue
Block a user