on master help sign in
Default rulers color to red (#2669)

* Default rulers color to red Currently if the theme a user is using doesn't have `ui.virtual.rulers` set and they set up a ruler it just fails silently making it really hard to figure out what went wrong. Did they set incorrectly set the ruler? Are they using an outdated version of Helix that doesn't support rulers? This happened to me today, I even switched to the default theme with the assumption that maybe my theme just doesn't have the rulers setup properly and it still didn't work. Not sure if this is a good idea or not, feel free to suggest better alternatives! * Use builtin Style methods instead of Bevy style defaults Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Only default the style if there's no ui or ui.virtual * Update themes style from ui.virtual to ui.virtual.whitespace * Revert ui.virtual change in onelight theme * Prefer unwrap_or_else Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

commitfa4934cff9aa5b86b907e218313a7b370962ae67 authorMathspy <mathspy257@gmail.com> dateTue 21 Jun 2022, 12:35 (4 years ago) parent9f676da
29 files changed+32−30
helix-term/src/ui/editor.rs+4−2 runtime/themes/base16_default_dark.toml+1−1 runtime/themes/base16_default_light.toml+1−1 runtime/themes/base16_terminal.toml+1−1 runtime/themes/bogster.toml+1−1 runtime/themes/boo_berry.toml+1−1 runtime/themes/catppuccin.toml+1−1 runtime/themes/dark_plus.toml+1−1 runtime/themes/dracula.toml+1−1 runtime/themes/everforest_dark.toml+1−1 runtime/themes/everforest_light.toml+1−1 runtime/themes/gruvbox.toml+1−1 runtime/themes/gruvbox_light.toml+1−1 runtime/themes/ingrid.toml+1−1 runtime/themes/monokai.toml+1−1 runtime/themes/monokai_pro.toml+1−1 runtime/themes/monokai_pro_machine.toml+1−1 runtime/themes/monokai_pro_octagon.toml+1−1 runtime/themes/monokai_pro_ristretto.toml+1−1 runtime/themes/monokai_pro_spectrum.toml+1−1 runtime/themes/nord.toml+1−1 runtime/themes/rose_pine.toml+1−1 runtime/themes/rose_pine_dawn.toml+1−1 runtime/themes/serika-dark.toml+1−1 runtime/themes/serika-light.toml+1−1 runtime/themes/snazzy.toml+1−1 runtime/themes/solarized_dark.toml+1−1 runtime/themes/solarized_light.toml+1−1 runtime/themes/spacebones_light.toml+1−1
helix-term/src/ui/editor.rs+4−2
@@ -20,7 +20,7 @@ use helix_core::{
2020use helix_view::{
2121 document::{Mode, SCRATCH_BUFFER_NAME},
2222 editor::{CompleteAction, CursorShapeConfig},
23− graphics::{CursorKind, Modifier, Rect, Style},
23+ graphics::{Color, CursorKind, Modifier, Rect, Style},
2424 input::KeyEvent,
2525 keyboard::{KeyCode, KeyModifiers},
2626 Document, Editor, Theme, View,
@@ -170,7 +170,9 @@ impl EditorView {
170170 theme: &Theme,
171171 ) {
172172 let editor_rulers = &editor.config().rulers;
173− let ruler_theme = theme.get("ui.virtual.ruler");
173+ let ruler_theme = theme
174+ .try_get("ui.virtual.ruler")
175+ .unwrap_or_else(|| Style::default().bg(Color::Red));
174176
175177 let rulers = doc
176178 .language_config()
runtime/themes/base16_default_dark.toml+1−1
@@ -1,7 +1,7 @@
11# Author: RayGervais <raygervais@hotmail.ca>
22
33"ui.background" = { bg = "base00" }
4−"ui.virtual" = "base03"
4+"ui.virtual.whitespace" = "base03"
55"ui.menu" = { fg = "base05", bg = "base01" }
66"ui.menu.selected" = { fg = "base01", bg = "base04" }
77"ui.linenr" = { fg = "base03", bg = "base01" }
runtime/themes/base16_default_light.toml+1−1
@@ -12,7 +12,7 @@
1212"ui.statusline" = { fg = "base04", bg = "base01" }
1313"ui.cursor" = { fg = "base04", modifiers = ["reversed"] }
1414"ui.cursor.primary" = { fg = "base05", modifiers = ["reversed"] }
15−"ui.virtual" = "base03"
15+"ui.virtual.whitespace" = "base03"
1616"ui.text" = "base05"
1717"operator" = "base05"
1818"ui.text.focus" = "base05"
runtime/themes/base16_terminal.toml+1−1
@@ -13,7 +13,7 @@
1313"ui.help" = { fg = "white", bg = "black" }
1414"ui.cursor" = { fg = "light-gray", modifiers = ["reversed"] }
1515"ui.cursor.primary" = { fg = "light-gray", modifiers = ["reversed"] }
16−"ui.virtual" = "light-gray"
16+"ui.virtual.whitespace" = "light-gray"
1717"variable" = "light-red"
1818"constant.numeric" = "yellow"
1919"constant" = "yellow"
runtime/themes/bogster.toml+1−1
@@ -53,7 +53,7 @@
5353
5454"ui.text" = { fg = "#e5ded6" }
5555"ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] }
56−"ui.virtual" = "#627d9d"
56+"ui.virtual.whitespace" = "#627d9d"
5757
5858"ui.selection" = { bg = "#313f4e" }
5959# "ui.cursor.match" # TODO might want to override this because dimmed is not widely supported
runtime/themes/boo_berry.toml+1−1
@@ -44,7 +44,7 @@
4444"ui.menu" = { fg = "lilac", bg = "berry_saturated" }
4545"ui.menu.selected" = { fg = "mint", bg = "berry_saturated" }
4646"ui.selection" = { bg = "berry_saturated" }
47−"ui.virtual" = { fg = "berry_desaturated" }
47+"ui.virtual.whitespace" = { fg = "berry_desaturated" }
4848
4949"diff.plus" = { fg = "mint" }
5050"diff.delta" = { fg = "gold" }
runtime/themes/catppuccin.toml+1−1
@@ -48,7 +48,7 @@ label = "peach"
4848
4949"ui.text" = { fg = "pink" }
5050"ui.text.focus" = { fg = "white" }
51−"ui.virtual" = { fg = "gray_0" }
51+"ui.virtual.whitespace" = { fg = "gray_0" }
5252
5353"ui.selection" = { bg = "#540099" }
5454"ui.selection.primary" = { bg = "#540099" }
runtime/themes/dark_plus.toml+1−1
@@ -78,7 +78,7 @@
7878"ui.text" = { fg = "text" }
7979"ui.text.focus" = { fg = "white" }
8080
81−"ui.virtual" = { fg = "dark_gray" }
81+"ui.virtual.whitespace" = { fg = "dark_gray" }
8282"ui.virtual.ruler" = { bg = "borders" }
8383
8484"warning" = { fg = "gold2" }
runtime/themes/dracula.toml+1−1
@@ -36,7 +36,7 @@
3636"ui.text" = { fg = "foreground" }
3737"ui.text.focus" = { fg = "cyan" }
3838"ui.window" = { fg = "foreground" }
39−"ui.virtual" = { fg = "comment" }
39+"ui.virtual.whitespace" = { fg = "comment" }
4040
4141"error" = { fg = "red" }
4242"warning" = { fg = "cyan" }
runtime/themes/everforest_dark.toml+1−1
@@ -70,7 +70,7 @@
7070"ui.menu" = { fg = "fg", bg = "bg2" }
7171"ui.menu.selected" = { fg = "bg0", bg = "green" }
7272"ui.selection" = { bg = "bg3" }
73−"ui.virtual" = "grey0"
73+"ui.virtual.whitespace" = "grey0"
7474
7575"hint" = "blue"
7676"info" = "aqua"
runtime/themes/everforest_light.toml+1−1
@@ -70,7 +70,7 @@
7070"ui.menu" = { fg = "fg", bg = "bg2" }
7171"ui.menu.selected" = { fg = "bg0", bg = "green" }
7272"ui.selection" = { bg = "bg3" }
73−"ui.virtual" = "grey0"
73+"ui.virtual.whitespace" = "grey0"
7474
7575"hint" = "blue"
7676"info" = "aqua"
runtime/themes/gruvbox.toml+1−1
@@ -53,7 +53,7 @@
5353"ui.cursor.match" = { bg = "bg2" }
5454"ui.menu" = { fg = "fg1", bg = "bg2" }
5555"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] }
56−"ui.virtual" = "bg2"
56+"ui.virtual.whitespace" = "bg2"
5757
5858"diagnostic" = { modifiers = ["underlined"] }
5959
runtime/themes/gruvbox_light.toml+1−1
@@ -54,7 +54,7 @@
5454"ui.cursor.match" = { bg = "bg2" }
5555"ui.menu" = { fg = "fg1", bg = "bg2" }
5656"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] }
57−"ui.virtual" = "bg2"
57+"ui.virtual.whitespace" = "bg2"
5858
5959"diagnostic" = { modifiers = ["underlined"] }
6060
runtime/themes/ingrid.toml+1−1
@@ -53,7 +53,7 @@
5353
5454"ui.text" = { fg = "#7B91B3" }
5555"ui.text.focus" = { fg = "#250E07", modifiers= ["bold"] }
56−"ui.virtual" = "#A6B6CE"
56+"ui.virtual.whitespace" = "#A6B6CE"
5757
5858"ui.selection" = { bg = "#540099" }
5959# "ui.cursor.match" # TODO might want to override this because dimmed is not widely supported
runtime/themes/monokai.toml+1−1
@@ -32,7 +32,7 @@
3232"attribute" = { fg = "fn_declaration" }
3333
3434"comment" = { fg = "#88846F" }
35−"ui.virtual" = "#88846F"
35+"ui.virtual.whitespace" = "#88846F"
3636
3737"string" = { fg = "#e6db74" }
3838"constant.character" = { fg = "#e6db74" }
runtime/themes/monokai_pro.toml+1−1
@@ -6,7 +6,7 @@
66"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
77"ui.menu" = { fg = "base8", bg = "base3" }
88"ui.menu.selected" = { fg = "base2", bg = "yellow" }
9−"ui.virtual" = "base5"
9+"ui.virtual.whitespace" = "base5"
1010
1111"info" = "base8"
1212"hint" = "base8"
runtime/themes/monokai_pro_machine.toml+1−1
@@ -6,7 +6,7 @@
66"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
77"ui.menu" = { fg = "base8", bg = "base3" }
88"ui.menu.selected" = { fg = "base2", bg = "yellow" }
9−"ui.virtual" = "base5"
9+"ui.virtual.whitespace" = "base5"
1010
1111"info" = "base8"
1212"hint" = "base8"
runtime/themes/monokai_pro_octagon.toml+1−1
@@ -6,7 +6,7 @@
66"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
77"ui.menu" = { fg = "base8", bg = "base3" }
88"ui.menu.selected" = { fg = "base2", bg = "yellow" }
9−"ui.virtual" = "base5"
9+"ui.virtual.whitespace" = "base5"
1010
1111"info" = "base8"
1212"hint" = "base8"
runtime/themes/monokai_pro_ristretto.toml+1−1
@@ -6,7 +6,7 @@
66"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
77"ui.menu" = { fg = "base8", bg = "base3" }
88"ui.menu.selected" = { fg = "base2", bg = "yellow" }
9−"ui.virtual" = "base5"
9+"ui.virtual.whitespace" = "base5"
1010
1111"info" = "base8"
1212"hint" = "base8"
runtime/themes/monokai_pro_spectrum.toml+1−1
@@ -6,7 +6,7 @@
66"ui.text.focus" = { fg = "yellow", modifiers= ["bold"] }
77"ui.menu" = { fg = "base8", bg = "base3" }
88"ui.menu.selected" = { fg = "base2", bg = "yellow" }
9−"ui.virtual" = "base5"
9+"ui.virtual.whitespace" = "base5"
1010
1111"info" = "base8"
1212"hint" = "base8"
runtime/themes/nord.toml+1−1
@@ -4,7 +4,7 @@
44"ui.text.focus" = { fg = "nord8", modifiers= ["bold"] }
55"ui.menu" = { fg = "nord6", bg = "#232d38" }
66"ui.menu.selected" = { fg = "nord8", bg = "nord2" }
7−"ui.virtual" = "gray"
7+"ui.virtual.whitespace" = "gray"
88
99"info" = "nord8"
1010"hint" = "nord8"
runtime/themes/rose_pine.toml+1−1
@@ -14,7 +14,7 @@
1414"ui.text" = { fg = "text" }
1515"ui.text.focus" = { fg = "foam", modifiers = ["bold"]}
1616"ui.text.info" = {fg = "pine", modifiers = ["bold"]}
17−"ui.virtual" = "highlight"
17+"ui.virtual.whitespace" = "highlight"
1818"operator" = "rose"
1919"variable" = "text"
2020"constant.numeric" = "iris"
runtime/themes/rose_pine_dawn.toml+1−1
@@ -14,7 +14,7 @@
1414"ui.text" = { fg = "text" }
1515"ui.text.focus" = { fg = "foam", modifiers = ["bold"]}
1616"ui.text.info" = {fg = "pine", modifiers = ["bold"]}
17−"ui.virtual" = "highlight"
17+"ui.virtual.whitespace" = "highlight"
1818"operator" = "rose"
1919"variable" = "text"
2020"number" = "iris"
runtime/themes/serika-dark.toml+1−1
@@ -50,7 +50,7 @@
5050"ui.menu" = { fg = "fg", bg = "bg2" }
5151"ui.menu.selected" = { fg = "bg0", bg = "bg_yellow" }
5252"ui.selection" = { bg = "bg3" }
53−"ui.virtual" = "grey2"
53+"ui.virtual.whitespace" = "grey2"
5454
5555"hint" = "blue"
5656"info" = "aqua"
runtime/themes/serika-light.toml+1−1
@@ -50,7 +50,7 @@
5050"ui.menu" = { fg = "bg0", bg = "bg3" }
5151"ui.menu.selected" = { fg = "bg0", bg = "bg_yellow" }
5252"ui.selection" = { fg = "bg0", bg = "bg3" }
53−"ui.virtual" = { fg = "bg2" }
53+"ui.virtual.whitespace" = { fg = "bg2" }
5454
5555"hint" = "blue"
5656"info" = "aqua"
runtime/themes/snazzy.toml+1−1
@@ -38,7 +38,7 @@
3838"ui.text" = { fg = "foreground" }
3939"ui.text.focus" = { fg = "cyan" }
4040"ui.window" = { fg = "foreground" }
41−"ui.virtual" = { fg = "comment" }
41+"ui.virtual.whitespace" = { fg = "comment" }
4242
4343"error" = { fg = "red" }
4444"warning" = { fg = "cyan" }
runtime/themes/solarized_dark.toml+1−1
@@ -39,7 +39,7 @@
3939# 背景
4040"ui.background" = { bg = "base03" }
4141
42−"ui.virtual" = { fg = "base01" }
42+"ui.virtual.whitespace" = { fg = "base01" }
4343
4444# 行号栏
4545"ui.linenr" = { fg = "base0", bg = "base02" }
runtime/themes/solarized_light.toml+1−1
@@ -40,7 +40,7 @@
4040# background
4141"ui.background" = { bg = "base03" }
4242
43−"ui.virtual" = { fg = "base01" }
43+"ui.virtual.whitespace" = { fg = "base01" }
4444
4545# 行号栏
4646# line number column
runtime/themes/spacebones_light.toml+1−1
@@ -64,7 +64,7 @@
6464"ui.cursor.match" = { bg = "bg3" }
6565"ui.menu" = { fg = "fg1", bg = "bg2" }
6666"ui.menu.selected" = { fg = "#655370", bg = "#d1dcdf", modifiers = ["bold"] }
67−"ui.virtual" = "bg2"
67+"ui.virtual.whitespace" = "bg2"
6868
6969"diagnostic" = { modifiers = ["underlined"] }
7070