aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/highlight.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-07-25 10:16:33 +0200
committerbfredl <bjorn.linse@gmail.com>2022-08-17 16:20:39 +0200
commitd879331b0dee66cb106b5bea9efc2f920caf9abd (patch)
tree05188f0b72e9aa7432f2f08516a6f239e491419f /src/nvim/highlight.h
parentf7cfca49d6f1380b2ec0b0f7723ea308d0810857 (diff)
downloadrneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.tar.gz
rneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.tar.bz2
rneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.zip
feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces - check for EOF in screen tests (to indicate a likely crash)
Diffstat (limited to 'src/nvim/highlight.h')
-rw-r--r--src/nvim/highlight.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/highlight.h b/src/nvim/highlight.h
index ae63f83d65..50299bb91c 100644
--- a/src/nvim/highlight.h
+++ b/src/nvim/highlight.h
@@ -4,6 +4,7 @@
#include <stdbool.h>
#include "nvim/api/private/defs.h"
+#include "nvim/buffer_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/ui.h"
@@ -11,6 +12,13 @@
# include "highlight.h.generated.h"
#endif
+static inline int win_hl_attr(win_T *wp, int hlf)
+{
+ // wp->w_ns_hl_attr might be null if we check highlights
+ // prior to entering redraw
+ return ((wp->w_ns_hl_attr && ns_hl_fast < 0) ? wp->w_ns_hl_attr : hl_attr_active)[hlf];
+}
+
#define HL_SET_DEFAULT_COLORS(rgb_fg, rgb_bg, rgb_sp) \
do { \
bool dark_ = (*p_bg == 'd'); \