aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-02-17 19:37:45 +0100
committerGitHub <noreply@github.com>2022-02-17 19:37:45 +0100
commit3b5d456d3c8a46d9247041947fec710afe3ca8d4 (patch)
tree4a57eb61d3af92791f89428422f3f55623077bda /src
parentf4e24f1eabfac439ac09d9646582f682c02cfe3f (diff)
parente35a2d86fc2a8ed19aef00af9f35991385e833f1 (diff)
downloadrneovim-3b5d456d3c8a46d9247041947fec710afe3ca8d4.tar.gz
rneovim-3b5d456d3c8a46d9247041947fec710afe3ca8d4.tar.bz2
rneovim-3b5d456d3c8a46d9247041947fec710afe3ca8d4.zip
Merge pull request #17444 from clason/hl-empty-cterm
fix(api): allow empty list for cterm in nvim_set_hl
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index e8a22ce6a8..8b998ff62e 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -876,6 +876,10 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH);
CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE);
+ } else if (dict->cterm.type == kObjectTypeArray && dict->cterm.data.array.size == 0) {
+ // empty list from Lua API should clear all cterm attributes
+ // TODO(clason): handle via gen_api_dispatch
+ cterm_mask_provided = true;
} else if (HAS_KEY(dict->cterm)) {
api_set_error(err, kErrorTypeValidation, "'cterm' must be a Dictionary.");
}