diff options
author | Dmitry Sharshakov | 2021-08-25 16:22:01 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-08-25 16:22:01 +0000 |
commit | c7759a5aa0b5381e0a71ba58f3f7a5f7d98c9777 (patch) | |
tree | 66fe309913b5d7fad40e21def56b724cabc61127 /helix-term/src/ui/info.rs | |
parent | 4ee66b876613c3d2c06945520e0c5e392d9315d1 (diff) | |
parent | 44a0512d951806cc98ab30ccc73009ba2631e42f (diff) |
Merge remote-tracking branch 'origin/master' into debug
Diffstat (limited to 'helix-term/src/ui/info.rs')
-rw-r--r-- | helix-term/src/ui/info.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-term/src/ui/info.rs b/helix-term/src/ui/info.rs index 75d978da..55b0e65d 100644 --- a/helix-term/src/ui/info.rs +++ b/helix-term/src/ui/info.rs @@ -6,8 +6,12 @@ use tui::widgets::{Block, Borders, Paragraph, Widget}; impl Component for Info { fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) { - let text_style = cx.editor.theme.get("ui.text.focus"); - let popup_style = text_style.patch(cx.editor.theme.get("ui.popup")); + let get_theme = |style, fallback| { + let theme = &cx.editor.theme; + theme.try_get(style).unwrap_or_else(|| theme.get(fallback)) + }; + let text_style = get_theme("ui.info.text", "ui.text"); + let popup_style = text_style.patch(get_theme("ui.info", "ui.popup")); // Calculate the area of the terminal to modify. Because we want to // render at the bottom right, we use the viewport's width and height |