aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/highlight.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-03-22 23:27:59 +0100
committerGitHub <noreply@github.com>2021-03-22 23:27:59 +0100
commit1df1098b0c54258a41c4f97c9d3131d061a5b206 (patch)
tree315d116677afd7dfbfbc6858949e66e574c81aee /src/nvim/highlight.c
parent6fef28da58a217a45d2d6e5b68ecfddd1eb84c29 (diff)
parent243820ebd0d9df7664311c8bf79d879bf23eb742 (diff)
downloadrneovim-1df1098b0c54258a41c4f97c9d3131d061a5b206.tar.gz
rneovim-1df1098b0c54258a41c4f97c9d3131d061a5b206.tar.bz2
rneovim-1df1098b0c54258a41c4f97c9d3131d061a5b206.zip
Merge pull request #13998 from bfredl/border
floats: add MS-DOS mode (borders)
Diffstat (limited to 'src/nvim/highlight.c')
-rw-r--r--src/nvim/highlight.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index b01cdde236..f03382bea7 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -341,6 +341,17 @@ void update_window_hl(win_T *wp, bool invalid)
}
wp->w_hl_attrs[hlf] = attr;
}
+
+ if (wp->w_floating && wp->w_float_config.border) {
+ for (int i = 0; i < 8; i++) {
+ int attr = wp->w_hl_attrs[HLF_BORDER];
+ if (wp->w_float_config.border_hl_ids[i]) {
+ attr = hl_get_ui_attr(HLF_BORDER, wp->w_float_config.border_hl_ids[i],
+ false);
+ }
+ wp->w_float_config.border_attr[i] = attr;
+ }
+ }
}
/// Gets HL_UNDERLINE highlight.
@@ -517,6 +528,10 @@ static HlAttrs get_colors_force(int attr)
/// @return the resulting attributes.
int hl_blend_attrs(int back_attr, int front_attr, bool *through)
{
+ if (front_attr < 0 || back_attr < 0) {
+ return -1;
+ }
+
HlAttrs fattrs = get_colors_force(front_attr);
int ratio = fattrs.hl_blend;
if (ratio <= 0) {