aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/keysets.h1
-rw-r--r--src/nvim/api/vim.c1
-rw-r--r--src/nvim/highlight_group.c3
3 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/api/keysets.h b/src/nvim/api/keysets.h
index 4e5e7af619..a98cbe276f 100644
--- a/src/nvim/api/keysets.h
+++ b/src/nvim/api/keysets.h
@@ -168,6 +168,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 916409b973..9d08e9b6c7 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;
}