aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/validate.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-04-06 17:38:16 +0200
committerGitHub <noreply@github.com>2023-04-06 17:38:16 +0200
commitdd80ee0ca948bb548a8af804523ea7ea29c18279 (patch)
tree25160427c07459cdc4b9a12a4672af62c5830ab8 /src/nvim/api/private/validate.h
parente29bc03c046b3a137c2e36b4d34c119b277d62b2 (diff)
parent0f42aa1f2a860ce6d72a825b397fe09c875613b5 (diff)
downloadrneovim-dd80ee0ca948bb548a8af804523ea7ea29c18279.tar.gz
rneovim-dd80ee0ca948bb548a8af804523ea7ea29c18279.tar.bz2
rneovim-dd80ee0ca948bb548a8af804523ea7ea29c18279.zip
Merge pull request #22910 from bfredl/nonormal
fix(highlight): use winhl=Foo:Bar even when Bar is empty
Diffstat (limited to 'src/nvim/api/private/validate.h')
-rw-r--r--src/nvim/api/private/validate.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/api/private/validate.h b/src/nvim/api/private/validate.h
index 91a92c2762..a3e77ea838 100644
--- a/src/nvim/api/private/validate.h
+++ b/src/nvim/api/private/validate.h
@@ -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)) { \