on master help sign in
Add theme key for picker separator (#2523)

Co-authored-by: ky <>

commitbfc4ff4dcfd9135924d90bb822f2e23ae9cb2420 authorkyrime <kyrime@users.noreply.github.com> dateSun 22 May 2022, 02:24 (4 years ago) parent5c86492
3 files changed+38−36
book/src/themes.md+35−34 helix-term/src/ui/picker.rs+2−2 theme.toml+1
book/src/themes.md+35−34
@@ -205,39 +205,40 @@ These scopes are used for theming the editor interface.
205205 - `hover` - for hover popup ui
206206
207207
208−| Key | Notes |
209−| --- | --- |
210−| `ui.background` | |
211−| `ui.cursor` | |
212−| `ui.cursor.insert` | |
213−| `ui.cursor.select` | |
214−| `ui.cursor.match` | Matching bracket etc. |
215−| `ui.cursor.primary` | Cursor with primary selection |
216−| `ui.linenr` | Line numbers |
217−| `ui.linenr.selected` | Line number for the line the cursor is on |
218−| `ui.statusline` | Statusline |
219−| `ui.statusline.inactive` | Statusline (unfocused document) |
220−| `ui.popup` | Documentation popups (e.g space-k) |
221−| `ui.popup.info` | Prompt for multiple key options |
222−| `ui.window` | Border lines separating splits |
223−| `ui.help` | Description box for commands |
224−| `ui.text` | Command prompts, popup text, etc. |
225−| `ui.text.focus` | |
226−| `ui.text.info` | The key: command text in `ui.popup.info` boxes |
227−| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][rulers-config])|
228−| `ui.virtual.whitespace` | Visible white-space characters |
229−| `ui.menu` | Code and command completion menus |
230−| `ui.menu.selected` | Selected autocomplete item |
231−| `ui.selection` | For selections in the editing area |
232−| `ui.selection.primary` | |
233−| `warning` | Diagnostics warning (gutter) |
234−| `error` | Diagnostics error (gutter) |
235−| `info` | Diagnostics info (gutter) |
236−| `hint` | Diagnostics hint (gutter) |
237−| `diagnostic` | Diagnostics fallback style (editing area) |
238−| `diagnostic.hint` | Diagnostics hint (editing area) |
239−| `diagnostic.info` | Diagnostics info (editing area) |
240−| `diagnostic.warning` | Diagnostics warning (editing area) |
241−| `diagnostic.error` | Diagnostics error (editing area) |
208+| Key | Notes |
209+| --- | --- |
210+| `ui.background` | |
211+| `ui.background.separator` | Picker separator below input line |
212+| `ui.cursor` | |
213+| `ui.cursor.insert` | |
214+| `ui.cursor.select` | |
215+| `ui.cursor.match` | Matching bracket etc. |
216+| `ui.cursor.primary` | Cursor with primary selection |
217+| `ui.linenr` | Line numbers |
218+| `ui.linenr.selected` | Line number for the line the cursor is on |
219+| `ui.statusline` | Statusline |
220+| `ui.statusline.inactive` | Statusline (unfocused document) |
221+| `ui.popup` | Documentation popups (e.g space-k) |
222+| `ui.popup.info` | Prompt for multiple key options |
223+| `ui.window` | Border lines separating splits |
224+| `ui.help` | Description box for commands |
225+| `ui.text` | Command prompts, popup text, etc. |
226+| `ui.text.focus` | |
227+| `ui.text.info` | The key: command text in `ui.popup.info` boxes |
228+| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][rulers-config])|
229+| `ui.virtual.whitespace` | Visible white-space characters |
230+| `ui.menu` | Code and command completion menus |
231+| `ui.menu.selected` | Selected autocomplete item |
232+| `ui.selection` | For selections in the editing area |
233+| `ui.selection.primary` | |
234+| `warning` | Diagnostics warning (gutter) |
235+| `error` | Diagnostics error (gutter) |
236+| `info` | Diagnostics info (gutter) |
237+| `hint` | Diagnostics hint (gutter) |
238+| `diagnostic` | Diagnostics fallback style (editing area) |
239+| `diagnostic.hint` | Diagnostics hint (editing area) |
240+| `diagnostic.info` | Diagnostics info (editing area) |
241+| `diagnostic.warning` | Diagnostics warning (editing area) |
242+| `diagnostic.error` | Diagnostics error (editing area) |
242243
243244[rulers-config]: ./configuration.md#editor-section
helix-term/src/ui/picker.rs+2−2
@@ -26,7 +26,7 @@ use crate::ui::{Prompt, PromptEvent};
2626use helix_core::{movement::Direction, Position};
2727use helix_view::{
2828 editor::Action,
29− graphics::{Color, CursorKind, Margin, Modifier, Rect, Style},
29+ graphics::{CursorKind, Margin, Modifier, Rect},
3030 Document, Editor,
3131};
3232
@@ -587,7 +587,7 @@ impl<T: 'static> Component for Picker<T> {
587587 self.prompt.render(area, surface, cx);
588588
589589 // -- Separator
590− let sep_style = Style::default().fg(Color::Rgb(90, 89, 119));
590+ let sep_style = cx.editor.theme.get("ui.background.separator");
591591 let borders = BorderType::line_symbols(BorderType::Plain);
592592 for x in inner.left()..inner.right() {
593593 if let Some(cell) = surface.get_mut(x, inner.y + 1) {
theme.toml+1
@@ -43,6 +43,7 @@ label = "honey"
4343# concat (ERROR) @error.syntax and "MISSING ;" selectors for errors
4444
4545"ui.background" = { bg = "midnight" }
46+"ui.background.separator" = { fg = "comet" }
4647"ui.linenr" = { fg = "comet" }
4748"ui.linenr.selected" = { fg = "lilac" }
4849"ui.statusline" = { fg = "lilac", bg = "revolver" }