on master help sign in
adress review comments
commit328c4d002f5eaef2b79c73a48ce5011e89425b54 authorPascal Kuthe <pascal.kuthe@semimod.de> dateTue 11 Oct 2022, 12:11 (4 years ago) parent2f7088c
3 files changed+11−12
book/src/themes.md+1−1 helix-view/src/graphics.rs+9−9 helix-view/src/theme.rs+1−2
book/src/themes.md+1−1
@@ -16,7 +16,7 @@ Each line in the theme file is specified as below:
1616key = { fg = "#ffffff", bg = "#000000", underline-color = "#ff0000", underline-style = "curl", modifiers = ["bold", "italic"] }
1717```
1818
19−where `key` represents what you want to style, `fg` specifies the foreground color, `bg` the background color, `underline_style` the underline style, `underline_color` the underline color (only meaningful if an underline style is enabled), and `modifiers` is a list of style modifiers. `bg`, `underline` and `modifiers` can be omitted to defer to the defaults.
19+where `key` represents what you want to style, `fg` specifies the foreground color, `bg` the background color, `underline-style` the underline style, `underline-color` the underline color (only meaningful if an underline style is enabled), and `modifiers` is a list of style modifiers. `bg`, `underline` and `modifiers` can be omitted to defer to the defaults.
2020
2121To specify only the foreground color:
2222
helix-view/src/graphics.rs+9−9
@@ -365,16 +365,16 @@ bitflags! {
365365 ///
366366 /// let m = Modifier::BOLD | Modifier::ITALIC;
367367 /// ```
368− #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize), serde(rename_all = "kebab-case"))]
368+ #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
369369 pub struct Modifier: u16 {
370− const BOLD = 0b0000_0000_0000_0001;
371− const DIM = 0b0000_0000_0000_0010;
372− const ITALIC = 0b0000_0000_0000_0100;
373− const SLOW_BLINK = 0b0000_0000_0001_0000;
374− const RAPID_BLINK = 0b0000_0000_0010_0000;
375− const REVERSED = 0b0000_0000_0100_0000;
376− const HIDDEN = 0b0000_0000_1000_0000;
377− const CROSSED_OUT = 0b0000_0001_0000_0000;
370+ const BOLD = 0b0000_0000_0001;
371+ const DIM = 0b0000_0000_0010;
372+ const ITALIC = 0b0000_0000_0100;
373+ const SLOW_BLINK = 0b0000_0001_0000;
374+ const RAPID_BLINK = 0b0000_0010_0000;
375+ const REVERSED = 0b0000_0100_0000;
376+ const HIDDEN = 0b0000_1000_0000;
377+ const CROSSED_OUT = 0b0001_0000_0000;
378378 }
379379}
380380
helix-view/src/theme.rs+1−2
@@ -268,7 +268,7 @@ impl ThemePalette {
268268 value
269269 .as_str()
270270 .and_then(|s| s.parse().ok())
271− .ok_or(format!("Theme: invalid underline_style: {}", value))
271+ .ok_or(format!("Theme: invalid underline-style: {}", value))
272272 }
273273
274274 pub fn parse_style(&self, style: &mut Style, value: Value) -> Result<(), String> {
@@ -279,7 +279,6 @@ impl ThemePalette {
279279 "bg" => *style = style.bg(self.parse_color(value)?),
280280 "underline-color" => *style = style.underline_color(self.parse_color(value)?),
281281 "underline-style" => {
282− warn!("found style");
283282 *style = style.underline_style(Self::parse_underline_style(&value)?)
284283 }
285284 "modifiers" => {