aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-05-03 15:53:13 +0800
committerglepnir <glephunter@gmail.com>2024-05-25 15:34:29 +0800
commit8b2b1fba2abfb99186e3a1f0123251a3e2eae3fe (patch)
treeaae2b317a3a912e826a9bcd0933af97c95177e81 /src/nvim/api
parent4e5c633ed4871a948aff7338b793ac5f93484153 (diff)
downloadrneovim-8b2b1fba2abfb99186e3a1f0123251a3e2eae3fe.tar.gz
rneovim-8b2b1fba2abfb99186e3a1f0123251a3e2eae3fe.tar.bz2
rneovim-8b2b1fba2abfb99186e3a1f0123251a3e2eae3fe.zip
fix(float): missing default highlight for title
Problem: there is missing default title highlight when highlight not defined in title text chunk. Solution: when attr is not set use default title highlight group.
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/win_config.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 3a9986a7d1..70235d8db6 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -189,13 +189,13 @@
/// ```
/// - title: Title (optional) in window border, string or list.
/// List should consist of `[text, highlight]` tuples.
-/// If string, the default highlight group is `FloatTitle`.
+/// If string, or a tuple lacks a highlight, the default highlight group is `FloatTitle`.
/// - title_pos: Title position. Must be set with `title` option.
/// Value can be one of "left", "center", or "right".
/// 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 `FloatFooter`.
+/// If string, or a tuple lacks a highlight, 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"`.
@@ -851,7 +851,6 @@ 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:
if (fconfig->title) {
@@ -861,7 +860,6 @@ static void parse_bordertext(Object bordertext, BorderTextType bordertext_type,
is_present = &fconfig->title;
chunks = &fconfig->title_chunks;
width = &fconfig->title_width;
- default_hl_id = syn_check_group(S_LEN("FloatTitle"));
break;
case kBorderTextFooter:
if (fconfig->footer) {
@@ -871,7 +869,6 @@ static void parse_bordertext(Object bordertext, BorderTextType bordertext_type,
is_present = &fconfig->footer;
chunks = &fconfig->footer_chunks;
width = &fconfig->footer_width;
- default_hl_id = syn_check_group(S_LEN("FloatFooter"));
break;
}
@@ -881,7 +878,7 @@ static void parse_bordertext(Object bordertext, BorderTextType bordertext_type,
return;
}
kv_push(*chunks, ((VirtTextChunk){ .text = xstrdup(bordertext.data.string.data),
- .hl_id = default_hl_id }));
+ .hl_id = -1 }));
*width = (int)mb_string2cells(bordertext.data.string.data);
*is_present = true;
return;