Add theme key for picker separator (#2523)

Co-authored-by: ky <>
This commit is contained in:
kyrime 2022-05-22 02:24:51 +01:00 committed by GitHub
parent 5c864922d8
commit bfc4ff4dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 36 deletions

View File

@ -205,39 +205,40 @@ #### Interface
- `hover` - for hover popup ui - `hover` - for hover popup ui
| Key | Notes | | Key | Notes |
| --- | --- | | --- | --- |
| `ui.background` | | | `ui.background` | |
| `ui.cursor` | | | `ui.background.separator` | Picker separator below input line |
| `ui.cursor.insert` | | | `ui.cursor` | |
| `ui.cursor.select` | | | `ui.cursor.insert` | |
| `ui.cursor.match` | Matching bracket etc. | | `ui.cursor.select` | |
| `ui.cursor.primary` | Cursor with primary selection | | `ui.cursor.match` | Matching bracket etc. |
| `ui.linenr` | Line numbers | | `ui.cursor.primary` | Cursor with primary selection |
| `ui.linenr.selected` | Line number for the line the cursor is on | | `ui.linenr` | Line numbers |
| `ui.statusline` | Statusline | | `ui.linenr.selected` | Line number for the line the cursor is on |
| `ui.statusline.inactive` | Statusline (unfocused document) | | `ui.statusline` | Statusline |
| `ui.popup` | Documentation popups (e.g space-k) | | `ui.statusline.inactive` | Statusline (unfocused document) |
| `ui.popup.info` | Prompt for multiple key options | | `ui.popup` | Documentation popups (e.g space-k) |
| `ui.window` | Border lines separating splits | | `ui.popup.info` | Prompt for multiple key options |
| `ui.help` | Description box for commands | | `ui.window` | Border lines separating splits |
| `ui.text` | Command prompts, popup text, etc. | | `ui.help` | Description box for commands |
| `ui.text.focus` | | | `ui.text` | Command prompts, popup text, etc. |
| `ui.text.info` | The key: command text in `ui.popup.info` boxes | | `ui.text.focus` | |
| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][rulers-config])| | `ui.text.info` | The key: command text in `ui.popup.info` boxes |
| `ui.virtual.whitespace` | Visible white-space characters | | `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][rulers-config])|
| `ui.menu` | Code and command completion menus | | `ui.virtual.whitespace` | Visible white-space characters |
| `ui.menu.selected` | Selected autocomplete item | | `ui.menu` | Code and command completion menus |
| `ui.selection` | For selections in the editing area | | `ui.menu.selected` | Selected autocomplete item |
| `ui.selection.primary` | | | `ui.selection` | For selections in the editing area |
| `warning` | Diagnostics warning (gutter) | | `ui.selection.primary` | |
| `error` | Diagnostics error (gutter) | | `warning` | Diagnostics warning (gutter) |
| `info` | Diagnostics info (gutter) | | `error` | Diagnostics error (gutter) |
| `hint` | Diagnostics hint (gutter) | | `info` | Diagnostics info (gutter) |
| `diagnostic` | Diagnostics fallback style (editing area) | | `hint` | Diagnostics hint (gutter) |
| `diagnostic.hint` | Diagnostics hint (editing area) | | `diagnostic` | Diagnostics fallback style (editing area) |
| `diagnostic.info` | Diagnostics info (editing area) | | `diagnostic.hint` | Diagnostics hint (editing area) |
| `diagnostic.warning` | Diagnostics warning (editing area) | | `diagnostic.info` | Diagnostics info (editing area) |
| `diagnostic.error` | Diagnostics error (editing area) | | `diagnostic.warning` | Diagnostics warning (editing area) |
| `diagnostic.error` | Diagnostics error (editing area) |
[rulers-config]: ./configuration.md#editor-section [rulers-config]: ./configuration.md#editor-section

View File

@ -26,7 +26,7 @@
use helix_core::{movement::Direction, Position}; use helix_core::{movement::Direction, Position};
use helix_view::{ use helix_view::{
editor::Action, editor::Action,
graphics::{Color, CursorKind, Margin, Modifier, Rect, Style}, graphics::{CursorKind, Margin, Modifier, Rect},
Document, Editor, Document, Editor,
}; };
@ -587,7 +587,7 @@ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
self.prompt.render(area, surface, cx); self.prompt.render(area, surface, cx);
// -- Separator // -- Separator
let sep_style = Style::default().fg(Color::Rgb(90, 89, 119)); let sep_style = cx.editor.theme.get("ui.background.separator");
let borders = BorderType::line_symbols(BorderType::Plain); let borders = BorderType::line_symbols(BorderType::Plain);
for x in inner.left()..inner.right() { for x in inner.left()..inner.right() {
if let Some(cell) = surface.get_mut(x, inner.y + 1) { if let Some(cell) = surface.get_mut(x, inner.y + 1) {

View File

@ -43,6 +43,7 @@ label = "honey"
# concat (ERROR) @error.syntax and "MISSING ;" selectors for errors # concat (ERROR) @error.syntax and "MISSING ;" selectors for errors
"ui.background" = { bg = "midnight" } "ui.background" = { bg = "midnight" }
"ui.background.separator" = { fg = "comet" }
"ui.linenr" = { fg = "comet" } "ui.linenr" = { fg = "comet" }
"ui.linenr.selected" = { fg = "lilac" } "ui.linenr.selected" = { fg = "lilac" }
"ui.statusline" = { fg = "lilac", bg = "revolver" } "ui.statusline" = { fg = "lilac", bg = "revolver" }