Add ui.selection to theme.toml
Enables changing the color of the selection which was previously
hard coded.
commitf33aaba53fee32fb0a6e496c472f4e08bb401237
authorGokul Soumya <gokulps15@gmail.com>
dateMon 14 Jun 2021, 15:41 (5 years ago)
parent9cfa163
book/src/configuration.md+1
@@ -77,6 +77,7 @@ Possible keys:
7777| ui.text | |
7878| ui.text.focus | |
7979| ui.menu.selected | |
80+| ui.selection | for selections in the editing area |
8081| warning | LSP warning |
8182| error | LSP error |
8283| info | LSP info |
contrib/themes/bogster.toml+1
@@ -38,6 +38,7 @@
3838"ui.text" = { fg = "#e5ded6" }
3939"ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] }
4040
41+"ui.selection" = { bg = "#540099" }
4142"ui.menu.selected" = { fg = "#e5ded6", bg = "#313f4e" }
4243
4344"warning" = "#dc7759"
contrib/themes/ingrid.toml+1
@@ -38,6 +38,7 @@
3838"ui.text" = { fg = "#7B91B3" }
3939"ui.text.focus" = { fg = "#250E07", modifiers= ["bold"] }
4040
41+"ui.selection" = { bg = "#540099" }
4142"ui.menu.selected" = { fg = "#D74E50", bg = "#F3EAE9" }
4243
4344"warning" = "#D4A520"
contrib/themes/onedark.toml+1
@@ -35,6 +35,7 @@
3535"ui.linenr" = { fg = "#4B5263", modifiers = ['dim'] }
3636"ui.popup" = { bg = "#3E4452" }
3737"ui.statusline" = { fg = "#ABB2BF", bg = "#2C323C" }
38+"ui.selection" = { bg = "#3E4452" }
3839"ui.text" = { fg = "#ABB2BF", bg = "#282C34" }
3940"ui.text.focus" = { fg = "#ABB2BF", bg = "#2C323C", modifiers = ['bold'] }
4041"ui.window" = { bg = "#3E4452" }
helix-term/src/ui/editor.rs+1−2
@@ -240,8 +240,7 @@ impl EditorView {
240240 // .bg(Color::Rgb(255, 255, 255))
241241 .add_modifier(Modifier::REVERSED);
242242
243− // let selection_style = Style::default().bg(Color::Rgb(94, 0, 128));
244− let selection_style = Style::default().bg(Color::Rgb(84, 0, 153));
243+ let selection_style = theme.get("ui.selection");
245244
246245 for selection in doc
247246 .selection(view.id)
theme.toml+1
@@ -50,6 +50,7 @@
5050"ui.text" = { fg = "#a4a0e8" } # lavender
5151"ui.text.focus" = { fg = "#dbbfef"} # lilac
5252
53+"ui.selection" = { bg = "#540099" }
5354"ui.menu.selected" = { fg = "#281733", bg = "#ffffff" } # revolver
5455
5556"warning" = "#ffcd1c"