From 7ffb76af211c66bb4547598940a1291771680403 Mon Sep 17 00:00:00 2001 From: Ben LeFevre Date: Fri, 18 Aug 2023 09:21:45 +1000 Subject: [PATCH] feat: add different background color for inactive panes --- book/src/themes.md | 1 + helix-term/src/ui/editor.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/book/src/themes.md b/book/src/themes.md index 1bc2627dd..258fd451e 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -269,6 +269,7 @@ These scopes are used for theming the editor interface: | Key | Notes | | --- | --- | | `ui.background` | | +| `ui.background.inactive` | Background of unfocused document | | `ui.background.separator` | Picker separator below input line | | `ui.cursor` | | | `ui.cursor.normal` | | diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index f7541fe25..433233a0f 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -98,6 +98,10 @@ impl EditorView { let text_annotations = view.text_annotations(doc, Some(theme)); let mut decorations = DecorationManager::default(); + if !is_focused { + surface.set_style(area, theme.get("ui.background.inactive")) + } + if is_focused && config.cursorline { decorations.add_decoration(Self::cursorline(doc, view, theme)); }