on master help sign in
adress review comments
328c4d0Pascal Kuthe
book/src/themes.md+1−1
@@ -16,7 +16,7 @@ Each line in the theme file is specified as below:
16key = { fg = "#ffffff", bg = "#000000", underline-color = "#ff0000", underline-style = "curl", modifiers = ["bold", "italic"] }
16key = { fg = "#ffffff", bg = "#000000", underline-color = "#ff0000", underline-style = "curl", modifiers = ["bold", "italic"] }
17```
17```
18
18
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.
20
20
21To specify only the foreground color:
21To specify only the foreground color:
22
22
helix-view/src/graphics.rs+9−9
@@ -365,16 +365,16 @@ bitflags! {
365 ///
365 ///
366 /// let m = Modifier::BOLD | Modifier::ITALIC;
366 /// let m = Modifier::BOLD | Modifier::ITALIC;
367 /// ```
367 /// ```
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))]
369 pub struct Modifier: u16 {
369 pub struct Modifier: u16 {
370− const BOLD = 0b0000_0000_0000_0001;
370+ const BOLD = 0b0000_0000_0001;
371− const DIM = 0b0000_0000_0000_0010;
371+ const DIM = 0b0000_0000_0010;
372− const ITALIC = 0b0000_0000_0000_0100;
372+ const ITALIC = 0b0000_0000_0100;
373− const SLOW_BLINK = 0b0000_0000_0001_0000;
373+ const SLOW_BLINK = 0b0000_0001_0000;
374− const RAPID_BLINK = 0b0000_0000_0010_0000;
374+ const RAPID_BLINK = 0b0000_0010_0000;
375− const REVERSED = 0b0000_0000_0100_0000;
375+ const REVERSED = 0b0000_0100_0000;
376− const HIDDEN = 0b0000_0000_1000_0000;
376+ const HIDDEN = 0b0000_1000_0000;
377− const CROSSED_OUT = 0b0000_0001_0000_0000;
377+ const CROSSED_OUT = 0b0001_0000_0000;
378 }
378 }
379}
379}
380
380
helix-view/src/theme.rs+1−2
@@ -268,7 +268,7 @@ impl ThemePalette {
268 value
268 value
269 .as_str()
269 .as_str()
270 .and_then(|s| s.parse().ok())
270 .and_then(|s| s.parse().ok())
271− .ok_or(format!("Theme: invalid underline_style: {}", value))
271+ .ok_or(format!("Theme: invalid underline-style: {}", value))
272 }
272 }
273
273
274 pub fn parse_style(&self, style: &mut Style, value: Value) -> Result<(), String> {
274 pub fn parse_style(&self, style: &mut Style, value: Value) -> Result<(), String> {
@@ -279,7 +279,6 @@ impl ThemePalette {
279 "bg" => *style = style.bg(self.parse_color(value)?),
279 "bg" => *style = style.bg(self.parse_color(value)?),
280 "underline-color" => *style = style.underline_color(self.parse_color(value)?),
280 "underline-color" => *style = style.underline_color(self.parse_color(value)?),
281 "underline-style" => {
281 "underline-style" => {
282− warn!("found style");
283 *style = style.underline_style(Self::parse_underline_style(&value)?)
282 *style = style.underline_style(Self::parse_underline_style(&value)?)
284 }
283 }
285 "modifiers" => {
284 "modifiers" => {