aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2023-08-25 10:53:39 +0300
committerEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2023-08-26 19:37:43 +0300
commit986bf7e78d09286e198b696630254eb097ad0875 (patch)
treed0915f863f81409785b2f51ac91741b3e14258e9 /src
parent35570e4a11bef061777d741929f74fa66ba3f45a (diff)
downloadrneovim-986bf7e78d09286e198b696630254eb097ad0875.tar.gz
rneovim-986bf7e78d09286e198b696630254eb097ad0875.tar.bz2
rneovim-986bf7e78d09286e198b696630254eb097ad0875.zip
feat(highlight): add `FloatFooter` highlight group
Problem: No clear separation of floating title and footer highlighting. Solution: Add new `FloatFooter` highlight group.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/win_config.c8
-rw-r--r--src/nvim/highlight_group.c1
2 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 325d0cbfa0..ac27554172 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -153,7 +153,7 @@
/// Default is `"left"`.
/// - footer: Footer (optional) in window border, string or list.
/// List should consist of `[text, highlight]` tuples.
-/// If string, the default highlight group is `FloatTitle`.
+/// If string, the default highlight group is `FloatFooter`.
/// - footer_pos: Footer position. Must be set with `footer` option.
/// Value can be one of "left", "center", or "right".
/// Default is `"left"`.
@@ -428,16 +428,19 @@ static void parse_bordertext(Object bordertext, BorderTextType bordertext_type,
bool *is_present;
VirtText *chunks;
int *width;
+ int default_hl_id;
switch (bordertext_type) {
case kBorderTextTitle:
is_present = &fconfig->title;
chunks = &fconfig->title_chunks;
width = &fconfig->title_width;
+ default_hl_id = syn_check_group(S_LEN("FloatTitle"));
break;
case kBorderTextFooter:
is_present = &fconfig->footer;
chunks = &fconfig->footer_chunks;
width = &fconfig->footer_width;
+ default_hl_id = syn_check_group(S_LEN("FloatFooter"));
break;
}
@@ -446,9 +449,8 @@ static void parse_bordertext(Object bordertext, BorderTextType bordertext_type,
*is_present = false;
return;
}
- int hl_id = syn_check_group(S_LEN("FloatTitle"));
kv_push(*chunks, ((VirtTextChunk){ .text = xstrdup(bordertext.data.string.data),
- .hl_id = hl_id }));
+ .hl_id = default_hl_id }));
*width = (int)mb_string2cells(bordertext.data.string.data);
*is_present = true;
return;
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 2b268ff2e1..c4d140d1e1 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -173,6 +173,7 @@ static const char *highlight_init_both[] = {
"default link NormalFloat Pmenu",
"default link FloatBorder WinSeparator",
"default link FloatTitle Title",
+ "default link FloatFooter Title",
"default FloatShadow blend=80 guibg=Black",
"default FloatShadowThrough blend=100 guibg=Black",
"RedrawDebugNormal cterm=reverse gui=reverse",