diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/keysets.h | 1 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 1 | ||||
-rw-r--r-- | src/nvim/highlight_group.c | 3 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/api/keysets.h b/src/nvim/api/keysets.h index 736ca9ce07..236e75983e 100644 --- a/src/nvim/api/keysets.h +++ b/src/nvim/api/keysets.h @@ -169,6 +169,7 @@ typedef struct { Integer blend; Boolean fg_indexed; Boolean bg_indexed; + Boolean force; } Dict(highlight); typedef struct { diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 78396edef5..00641c633d 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -151,6 +151,7 @@ Dictionary nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena *arena, E /// - cterm: cterm attribute map, like |highlight-args|. If not set, /// cterm attributes will match those from the attribute map /// documented above. +/// - force: if true force update the highlight group when it exists. /// @param[out] err Error details, if any /// // TODO(bfredl): val should take update vs reset flag diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index 84cf19ba69..eeed58a9ab 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -799,11 +799,10 @@ int lookup_color(const int idx, const bool foreground, TriState *const boldp) void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id) { int idx = id - 1; // Index is ID minus one. - bool is_default = attrs.rgb_ae_attr & HL_DEFAULT; // Return if "default" was used and the group already has settings - if (is_default && hl_has_settings(idx, true)) { + if (is_default && hl_has_settings(idx, true) && !dict->force) { return; } |