mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 05:27:07 +04:00
Add ui.gutter.selected
option for themes (#3303)
* add `ui.gutter.selected` * add `ui.gutter`, `ui.gutter.selected` to docs
This commit is contained in:
parent
6939dd3adb
commit
589d17c758
@ -219,6 +219,8 @@ #### Interface
|
||||
| `ui.cursor.select` | |
|
||||
| `ui.cursor.match` | Matching bracket etc. |
|
||||
| `ui.cursor.primary` | Cursor with primary selection |
|
||||
| `ui.gutter` | Gutter |
|
||||
| `ui.gutter.selected` | Gutter for the line the cursor is on |
|
||||
| `ui.linenr` | Line numbers |
|
||||
| `ui.linenr.selected` | Line number for the line the cursor is on |
|
||||
| `ui.statusline` | Statusline |
|
||||
|
@ -696,6 +696,7 @@ pub fn render_gutter(
|
||||
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 @@ pub fn render_gutter(
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user