change to .unwrap_or_default() and fix ui.window and ui.statusline

This commit is contained in:
NNB 2021-12-02 19:33:31 +07:00 committed by Blaž Hrastnik
parent 3080be8268
commit d9727868dd
5 changed files with 12 additions and 25 deletions

View File

@ -1,7 +1,7 @@
# Author: NNB <nnbnh@protonmail.com>
"ui.menu" = "black"
"ui.menu.selected" = { fg = "white", bg = "black" }
"ui.menu.selected" = { modifiers = ["reversed"] }
"ui.linenr" = { fg = "light-gray", bg = "black" }
"ui.popup" = { bg = "black" }
"ui.window" = { bg = "black" }
@ -9,12 +9,10 @@
"ui.selection" = { fg = "gray", modifiers = ["reversed"] }
"comment" = { fg = "light-gray", modifiers = ["italic"] }
"ui.statusline" = { fg = "white", bg = "black" }
"ui.statusline.inactive" = { fg = "gray", bg = "black" }
"ui.help" = { fg = "white", bg = "black" }
"ui.cursor" = { fg = "light-gray", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "white", modifiers = ["reversed"] } #FIXME
"ui.text" = "white" #FIXME
"operator" = "white" #FIXME
"ui.text.focus" = "white" #FIXME
"ui.cursor.primary" = { modifiers = ["reversed"] }
"variable" = "light-red"
"constant.numeric" = "yellow"
"constant" = "yellow"
@ -30,8 +28,6 @@
"keyword" = "light-magenta"
"label" = "light-magenta"
"namespace" = "light-magenta"
"ui.popup" = { bg = "black" }
"ui.window" = { bg = "base00" }
"ui.help" = { fg = "white", bg = "black" }
"info" = "light-gray"

View File

@ -151,7 +151,7 @@ impl Theme {
pub fn get(&self, scope: &str) -> Style {
self.try_get(scope)
.unwrap_or_else(|| Style::default().fg(Color::Rgb(0, 0, 255)))
.unwrap_or_default()
}
pub fn try_get(&self, scope: &str) -> Option<Style> {

View File

@ -2,7 +2,7 @@
"ui.background" = { bg = "base00" }
"ui.menu" = "base01"
"ui.menu.selected" = { fg = "base04", bg = "base01" }
"ui.menu.selected" = { fg = "base01", bg = "base04" }
"ui.linenr" = { fg = "base03", bg = "base01" }
"ui.popup" = { bg = "base01" }
"ui.window" = { bg = "base01" }
@ -31,8 +31,6 @@
"keyword" = "base0E"
"label" = "base0E"
"namespace" = "base0E"
"ui.popup" = { bg = "base01" }
"ui.window" = { bg = "base00" }
"ui.help" = { fg = "base06", bg = "base01" }
"info" = "base03"

View File

@ -2,7 +2,7 @@
"ui.background" = { bg = "base00" }
"ui.menu" = "base01"
"ui.menu.selected" = { fg = "base04", bg = "base01" }
"ui.menu.selected" = { fg = "base01", bg = "base04" }
"ui.linenr" = { fg = "base03", bg = "base01" }
"ui.popup" = { bg = "base01" }
"ui.window" = { bg = "base01" }
@ -31,8 +31,6 @@
"keyword" = "base0E"
"label" = "base0E"
"namespace" = "base0E"
"ui.popup" = { bg = "base01" }
"ui.window" = { bg = "base00" }
"ui.help" = { fg = "base06", bg = "base01" }
"info" = "base03"

View File

@ -1,20 +1,17 @@
# Author: NNB <nnbnh@protonmail.com>
"ui.menu" = "black"
"ui.menu.selected" = { fg = "white", bg = "black" }
"ui.menu.selected" = { modifiers = ["reversed"] }
"ui.linenr" = { fg = "gray", bg = "black" }
"ui.popup" = { bg = "black" }
"ui.window" = { bg = "black" }
"ui.popup" = { modifiers = ["reversed"] }
"ui.linenr.selected" = { fg = "white", bg = "black", modifiers = ["bold"] }
"ui.selection" = { fg = "black", bg = "blue" }
"ui.selection.primary" = { fg = "white", bg = "blue" }
"comment" = { fg = "gray" }
"ui.statusline" = { fg = "white", bg = "black" }
"ui.help" = { fg = "white", bg = "black" }
"ui.cursor" = { fg = "white", modifiers = ["reversed"] } #FIXME
"ui.text" = "white" #FIXME
"operator" = "white" #FIXME
"ui.text.focus" = "white" #FIXME
"ui.statusline" = { fg = "black", bg = "white" }
"ui.statusline.inactive" = { fg = "gray", bg = "white" }
"ui.help" = { modifiers = ["reversed"] }
"ui.cursor" = { modifiers = ["reversed"] }
"variable" = "red"
"constant.numeric" = "yellow"
"constant" = "yellow"
@ -30,8 +27,6 @@
"keyword" = "magenta"
"label" = "magenta"
"namespace" = "magenta"
"ui.popup" = { bg = "black" }
"ui.window" = { bg = "base00" }
"ui.help" = { fg = "white", bg = "black" }
"info" = "gray"