mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
Merge pull request #22910 from bfredl/nonormal
fix(highlight): use winhl=Foo:Bar even when Bar is empty
This commit is contained in:
@@ -53,7 +53,7 @@ static int validate_option_value_args(Dict(option) *opts, int *scope, int *opt_t
|
||||
}
|
||||
|
||||
if (HAS_KEY(opts->win)) {
|
||||
VALIDATE_T("win", kObjectTypeInteger, opts->win.type, {
|
||||
VALIDATE_T_HANDLE("win", kObjectTypeWindow, opts->win.type, {
|
||||
return FAIL;
|
||||
});
|
||||
|
||||
@@ -65,7 +65,7 @@ static int validate_option_value_args(Dict(option) *opts, int *scope, int *opt_t
|
||||
}
|
||||
|
||||
if (HAS_KEY(opts->buf)) {
|
||||
VALIDATE_T("buf", kObjectTypeInteger, opts->buf.type, {
|
||||
VALIDATE_T_HANDLE("buf", kObjectTypeBuffer, opts->buf.type, {
|
||||
return FAIL;
|
||||
});
|
||||
|
||||
|
@@ -67,6 +67,15 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/// Checks that actual_t is either the correct handle type or a type erased handle (integer)
|
||||
#define VALIDATE_T_HANDLE(name, expected_t, actual_t, code) \
|
||||
do { \
|
||||
if (expected_t != actual_t && kObjectTypeInteger != actual_t) { \
|
||||
api_err_exp(err, name, api_typename(expected_t), api_typename(actual_t)); \
|
||||
code; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define VALIDATE_RANGE(cond, name, code) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
|
Reference in New Issue
Block a user