Fix popup colors not being reversed
This commit is contained in:
parent
f5c86868fe
commit
09b8253745
12
src/theme.rs
12
src/theme.rs
@ -57,10 +57,14 @@ fn get_hl_colors(nvim: &mut Neovim, hl: &str) -> (Option<Color>, Option<Color>)
|
||||
nvim.get_hl_by_name(hl, true)
|
||||
.ok_and_report()
|
||||
.and_then(|m| if let Some(m) = m.to_attrs_map_report() {
|
||||
Some((
|
||||
get_hl_color(&m, "background"),
|
||||
get_hl_color(&m, "foreground"),
|
||||
))
|
||||
let reverse = m.get("reverse").and_then(|v| v.as_bool()).unwrap_or(false);
|
||||
let bg = get_hl_color(&m, "background");
|
||||
let fg = get_hl_color(&m, "foreground");
|
||||
if reverse {
|
||||
Some((fg, bg))
|
||||
} else {
|
||||
Some((bg, fg))
|
||||
}
|
||||
} else {
|
||||
None
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user