From d1c8a74771b241ee0824853bd5e8229cb0ab4187 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Mon, 14 Jun 2021 19:31:17 +0530 Subject: Add theme key for selected line number Adds `ui.linenr.selected` which controls highlight of linu numbes which have cursors on. - Fallback to linenr if linenr.selected is missing - Update docs and themes - Add TODOs for themes with temporary linenr.selected --- helix-view/src/theme.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'helix-view/src/theme.rs') diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index efb6a1af..51a21421 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -200,12 +200,14 @@ fn parse_modifier(value: &Value) -> Option { impl Theme { pub fn get(&self, scope: &str) -> Style { - self.styles - .get(scope) - .copied() + self.try_get(scope) .unwrap_or_else(|| Style::default().fg(Color::Rgb(0, 0, 255))) } + pub fn try_get(&self, scope: &str) -> Option