aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGokul Soumya2021-06-14 10:11:05 +0000
committerBlaž Hrastnik2021-06-14 15:06:53 +0000
commitf33aaba53fee32fb0a6e496c472f4e08bb401237 (patch)
tree407063aae90be69feaaa3e410621f3a42fc9d9f2
parent9cfa1633702a33b917b108eca5e3ca83484b8a6e (diff)
Add ui.selection to theme.toml
Enables changing the color of the selection which was previously hard coded.
-rw-r--r--book/src/configuration.md1
-rw-r--r--contrib/themes/bogster.toml1
-rw-r--r--contrib/themes/ingrid.toml1
-rw-r--r--contrib/themes/onedark.toml1
-rw-r--r--helix-term/src/ui/editor.rs3
-rw-r--r--theme.toml1
6 files changed, 6 insertions, 2 deletions
diff --git a/book/src/configuration.md b/book/src/configuration.md
index 4528080b..f11cebd4 100644
--- a/book/src/configuration.md
+++ b/book/src/configuration.md
@@ -77,6 +77,7 @@ Possible keys:
| ui.text | |
| ui.text.focus | |
| ui.menu.selected | |
+| ui.selection | for selections in the editing area |
| warning | LSP warning |
| error | LSP error |
| info | LSP info |
diff --git a/contrib/themes/bogster.toml b/contrib/themes/bogster.toml
index 40fa7044..0fbafd23 100644
--- a/contrib/themes/bogster.toml
+++ b/contrib/themes/bogster.toml
@@ -38,6 +38,7 @@
"ui.text" = { fg = "#e5ded6" }
"ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] }
+"ui.selection" = { bg = "#540099" }
"ui.menu.selected" = { fg = "#e5ded6", bg = "#313f4e" }
"warning" = "#dc7759"
diff --git a/contrib/themes/ingrid.toml b/contrib/themes/ingrid.toml
index 60377b45..0dd53164 100644
--- a/contrib/themes/ingrid.toml
+++ b/contrib/themes/ingrid.toml
@@ -38,6 +38,7 @@
"ui.text" = { fg = "#7B91B3" }
"ui.text.focus" = { fg = "#250E07", modifiers= ["bold"] }
+"ui.selection" = { bg = "#540099" }
"ui.menu.selected" = { fg = "#D74E50", bg = "#F3EAE9" }
"warning" = "#D4A520"
diff --git a/contrib/themes/onedark.toml b/contrib/themes/onedark.toml
index b10a0292..ccf6a2cc 100644
--- a/contrib/themes/onedark.toml
+++ b/contrib/themes/onedark.toml
@@ -35,6 +35,7 @@
"ui.linenr" = { fg = "#4B5263", modifiers = ['dim'] }
"ui.popup" = { bg = "#3E4452" }
"ui.statusline" = { fg = "#ABB2BF", bg = "#2C323C" }
+"ui.selection" = { bg = "#3E4452" }
"ui.text" = { fg = "#ABB2BF", bg = "#282C34" }
"ui.text.focus" = { fg = "#ABB2BF", bg = "#2C323C", modifiers = ['bold'] }
"ui.window" = { bg = "#3E4452" }
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 00305fc8..dd385ac9 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -240,8 +240,7 @@ impl EditorView {
// .bg(Color::Rgb(255, 255, 255))
.add_modifier(Modifier::REVERSED);
- // let selection_style = Style::default().bg(Color::Rgb(94, 0, 128));
- let selection_style = Style::default().bg(Color::Rgb(84, 0, 153));
+ let selection_style = theme.get("ui.selection");
for selection in doc
.selection(view.id)
diff --git a/theme.toml b/theme.toml
index 5888b6a5..fd5572a6 100644
--- a/theme.toml
+++ b/theme.toml
@@ -50,6 +50,7 @@
"ui.text" = { fg = "#a4a0e8" } # lavender
"ui.text.focus" = { fg = "#dbbfef"} # lilac
+"ui.selection" = { bg = "#540099" }
"ui.menu.selected" = { fg = "#281733", bg = "#ffffff" } # revolver
"warning" = "#ffcd1c"