diff options
author | ChrHorn | 2022-10-03 14:44:45 +0000 |
---|---|---|
committer | GitHub | 2022-10-03 14:44:45 +0000 |
commit | 589d17c7583716b339875b72972aaffe0ae5efc1 (patch) | |
tree | 4351301a2de7cc146cdb041e31ff643982d4e4a4 /helix-term/src | |
parent | 6939dd3adb4ccd89ce63e69d9b0586a377a4df42 (diff) |
Add `ui.gutter.selected` option for themes (#3303)
* add `ui.gutter.selected`
* add `ui.gutter`, `ui.gutter.selected` to docs
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/ui/editor.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 7cb29c3b..0269d804 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -696,6 +696,7 @@ impl EditorView { let mut offset = 0; let gutter_style = theme.get("ui.gutter"); + let gutter_selected_style = theme.get("ui.gutter.selected"); // avoid lots of small allocations by reusing a text buffer for each line let mut text = String::with_capacity(8); @@ -708,6 +709,12 @@ impl EditorView { let x = viewport.x + offset; let y = viewport.y + i as u16; + let gutter_style = if selected { + gutter_selected_style + } else { + gutter_style + }; + if let Some(style) = gutter(line, selected, &mut text) { surface.set_stringn(x, y, &text, *width, gutter_style.patch(style)); } else { |