diff options
author | Gokul Soumya | 2021-06-14 14:01:17 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-16 06:00:14 +0000 |
commit | d1c8a74771b241ee0824853bd5e8229cb0ab4187 (patch) | |
tree | 583f5e890713384295c82930a1f531cf1a6693af /helix-view/src | |
parent | 33a35b7589dbc35f43f8823b79591ca857bceeac (diff) |
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
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/theme.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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<Modifier> { 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<Style> { + self.styles.get(scope).copied() + } + #[inline] pub fn scopes(&self) -> &[String] { &self.scopes |