From 42e6d96a75c743c2fa8da6c8a0587487b3c21bf0 Mon Sep 17 00:00:00 2001 From: Omnikar Date: Thu, 2 Dec 2021 22:34:54 -0500 Subject: Use `base16_tty` as 16-color default, fix theme name --- base16_terminal.toml | 37 ------------------------------------- base16_theme.toml | 36 ++++++++++++++++++++++++++++++++++++ helix-view/src/theme.rs | 5 ++--- runtime/themes/base16_terminal.toml | 37 +++++++++++++++++++++++++++++++++++++ runtime/themes/base16_tty.toml | 36 ------------------------------------ 5 files changed, 75 insertions(+), 76 deletions(-) delete mode 100644 base16_terminal.toml create mode 100644 base16_theme.toml create mode 100644 runtime/themes/base16_terminal.toml delete mode 100644 runtime/themes/base16_tty.toml diff --git a/base16_terminal.toml b/base16_terminal.toml deleted file mode 100644 index a76cfd7e..00000000 --- a/base16_terminal.toml +++ /dev/null @@ -1,37 +0,0 @@ -# Author: NNB - -"ui.menu" = "black" -"ui.menu.selected" = { modifiers = ["reversed"] } -"ui.linenr" = { fg = "light-gray", bg = "black" } -"ui.popup" = { bg = "black" } -"ui.window" = { bg = "black" } -"ui.linenr.selected" = { fg = "white", bg = "black", modifiers = ["bold"] } -"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" = { modifiers = ["reversed"] } -"variable" = "light-red" -"constant.numeric" = "yellow" -"constant" = "yellow" -"attributes" = "yellow" -"type" = "light-yellow" -"ui.cursor.match" = { fg = "light-yellow", modifiers = ["underlined"] } -"string" = "light-green" -"variable.other.member" = "light-green" -"constant.character.escape" = "light-cyan" -"function" = "light-blue" -"constructor" = "light-blue" -"special" = "light-blue" -"keyword" = "light-magenta" -"label" = "light-magenta" -"namespace" = "light-magenta" -"ui.help" = { fg = "white", bg = "black" } - -"info" = "light-gray" -"hint" = "light-gray" -"debug" = "light-gray" -"diagnostic" = "light-gray" -"error" = "light-red" diff --git a/base16_theme.toml b/base16_theme.toml new file mode 100644 index 00000000..e1d1647b --- /dev/null +++ b/base16_theme.toml @@ -0,0 +1,36 @@ +# Author: NNB + +"ui.menu" = "black" +"ui.menu.selected" = { modifiers = ["reversed"] } +"ui.linenr" = { fg = "gray", 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 = "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" +"attributes" = "yellow" +"type" = "yellow" +"ui.cursor.match" = { fg = "yellow", modifiers = ["underlined"] } +"string" = "green" +"variable.other.member" = "green" +"constant.character.escape" = "cyan" +"function" = "blue" +"constructor" = "blue" +"special" = "blue" +"keyword" = "magenta" +"label" = "magenta" +"namespace" = "magenta" +"ui.help" = { fg = "white", bg = "black" } + +"info" = "gray" +"hint" = "gray" +"debug" = "gray" +"diagnostic" = "gray" +"error" = "red" diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index 6ca021a9..4a2ecbba 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -16,7 +16,7 @@ pub static DEFAULT_THEME: Lazy = Lazy::new(|| { toml::from_slice(include_bytes!("../../theme.toml")).expect("Failed to parse default theme") }); pub static BASE16_DEFAULT_THEME: Lazy = Lazy::new(|| { - toml::from_slice(include_bytes!("../../base16_tty.toml")) + toml::from_slice(include_bytes!("../../base16_theme.toml")) .expect("Failed to parse base 16 default theme") }); @@ -150,8 +150,7 @@ impl Theme { } pub fn get(&self, scope: &str) -> Style { - self.try_get(scope) - .unwrap_or_default() + self.try_get(scope).unwrap_or_default() } pub fn try_get(&self, scope: &str) -> Option