Commit 4d6f00341d

4d6f00341d395512597e27b3a6dd3aab0b263052

parent: 952fea55b0

Unregistered key

Ulyssa <git@ulyssa.dev> · 2026-09-27 19:21 UTC
committer: <noreply@github.com>

Support picking the line type used when drawing different boxes (#757)

Layout: unified · split

Cargo.lock +32 −10
@@ -1622,21 +1622,22 @@ dependencies = [
16221622
16231623[[package]]
16241624name = "editor-types"
1625version = "0.0.4"
1625version = "0.0.5"
16261626source = "registry+https://github.com/rust-lang/crates.io-index"
1627checksum = "4f43aac4281b3b2127f017a09550a0133d11f5b51e0678d87a1a086767096182"
1627checksum = "9f826643f7fa44f8ba305301de9fba0215aa4d1f069d15a19d98d67bc71570b5"
16281628dependencies = [
16291629 "bitflags 2.13.2",
16301630 "editor-types-macros",
1631 "enum-map",
16311632 "keybindings",
16321633 "regex",
16331634]
16341635
16351636[[package]]
16361637name = "editor-types-macros"
1637version = "0.0.4"
1638version = "0.0.5"
16381639source = "registry+https://github.com/rust-lang/crates.io-index"
1639checksum = "786e57be6adb4b06cfbdfa2680b864382ba1d040e7e20e065b0850239565a477"
1640checksum = "fc2388897d6842fe58a567b8a7b4deabda77ce1129f5a2de88e7b94a88f0c76f"
16401641dependencies = [
16411642 "editor-types-parser",
16421643 "nom 8.0.0",
@@ -1647,9 +1648,9 @@ dependencies = [
16471648
16481649[[package]]
16491650name = "editor-types-parser"
1650version = "0.0.4"
1651version = "0.0.5"
16511652source = "registry+https://github.com/rust-lang/crates.io-index"
1652checksum = "9821f63ec0570a7b063cfd5a8882595e412f25de56f940ec9218ddd35d39f7d7"
1653checksum = "65739071a9f3f74a960551ad8a388d16d2c9546c1e9c0ce011e3c4d9ff93a84d"
16531654dependencies = [
16541655 "nom 8.0.0",
16551656 "thiserror 2.0.20",
@@ -1697,6 +1698,26 @@ version = "1.0.1"
16971698source = "registry+https://github.com/rust-lang/crates.io-index"
16981699checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca"
16991700
1701[[package]]
1702name = "enum-map"
1703version = "2.7.3"
1704source = "registry+https://github.com/rust-lang/crates.io-index"
1705checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9"
1706dependencies = [
1707 "enum-map-derive",
1708]
1709
1710[[package]]
1711name = "enum-map-derive"
1712version = "0.17.0"
1713source = "registry+https://github.com/rust-lang/crates.io-index"
1714checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb"
1715dependencies = [
1716 "proc-macro2",
1717 "quote",
1718 "syn 2.0.119",
1719]
1720
17001721[[package]]
17011722name = "enumflags2"
17021723version = "0.7.12"
@@ -3794,9 +3815,9 @@ dependencies = [
37943815
37953816[[package]]
37963817name = "modalkit"
3797version = "0.0.29"
3818version = "0.0.30"
37983819source = "registry+https://github.com/rust-lang/crates.io-index"
3799checksum = "74f52c73943f474277b3151ed970ca26457547d62fafe92d0f2806344ed9a733"
3820checksum = "7906e266d10ebe501fa0afb585fcfa180012067679c558460e07014e828ff9d0"
38003821dependencies = [
38013822 "anymap2",
38023823 "arboard",
@@ -3818,11 +3839,12 @@ dependencies = [
38183839
38193840[[package]]
38203841name = "modalkit-ratatui"
3821version = "0.0.29"
3842version = "0.0.30"
38223843source = "registry+https://github.com/rust-lang/crates.io-index"
3823checksum = "09874ea261c8c7859483de20f71b9e9e3c71b71f31d1b07d30a207ea633441c6"
3844checksum = "dc12f79c2070f1bfbadf97f93f338308b25416c1f8b8a943112db4974d7fed15"
38243845dependencies = [
38253846 "crossterm 0.29.0",
3847 "enum-map",
38263848 "intervaltree",
38273849 "libc",
38283850 "modalkit",
Cargo.toml +4 −4
@@ -82,15 +82,15 @@ version = "4.12"
8282optional = true
8383
8484[dependencies.modalkit]
85version = "0.0.29"
85version = "0.0.30"
8686default-features = false
8787#git = "https://github.com/ulyssa/modalkit"
88#rev = "bdb1c365417234f0c3be297beeffcfe2d1e75a5a"
88#rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96"
8989
9090[dependencies.modalkit-ratatui]
91version = "0.0.29"
91version = "0.0.30"
9292#git = "https://github.com/ulyssa/modalkit"
93#rev = "bdb1c365417234f0c3be297beeffcfe2d1e75a5a"
93#rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96"
9494
9595[dependencies.matrix-sdk-base]
9696version = "0.19.0"
docs/iamb.5 +43
@@ -717,6 +717,35 @@ Modifier names prefixed with
717717will remove the modifier if it was inherited from another default, global config, etc.
718718.El
719719.Pp
720Some special UI elements also have additional properties available:
721.Bl -tag -width Ds
722.It Sy line
723For UI elements that draw a block, such as
724.Sy "theme.windows.border" ,
725.Sy "theme.windows.border_focused" ,
726.Sy "theme.messages.code_block" ,
727or
728.Sy "theme.messages.table" ,
729you can specify what characters should be used to draw the bounding line.
730.Pp
731Possible values are
732.Dq Sy "plain" ,
733.Dq Sy "rounded" ,
734.Dq Sy "double" ,
735.Dq Sy "thick" ,
736.Dq Sy "double-dashed-light" ,
737.Dq Sy "double-dashed-heavy" ,
738.Dq Sy "triple-dashed-light" ,
739.Dq Sy "triple-dashed-heavy" ,
740.Dq Sy "quadruple-dashed-light" ,
741and
742.Dq Sy "quadruple-dashed-heavy" .
743.It Sy colors
744For UI elements that can use multiple colors, like
745.Sy "theme.users"
746for usernames, you can specify an array of colors that make up the pallete to pick from.
747.El
748.Pp
720749Within
721750.Sy theme ,
722751there are several subsections for specific UI areas:
@@ -730,6 +759,8 @@ For controlling how the text in the command bar is styled.
730759Configure the default styling for the command bar.
731760.It Sy prompt
732761Configure the styling for the prompt in the command bar.
762.It Sy completions
763Configure the styling for displaying possible command bar completions.
733764.It Sy error
734765Configure the styling for error messages shown in the command bar.
735766.It Sy info
@@ -761,6 +792,10 @@ UI elements you can set within this subsection are:
761792.Bl -tag -width Ds
762793.It Sy default
763794Configure the default styling for messages.
795.It Sy "blockquote"
796Configure the styling for the line used for indenting
797.Sy "<blockquote>"
798elements in formatted message bodies.
764799.It Sy code
765800Configure the styling for
766801.Sy "<code>"
@@ -775,6 +810,10 @@ Configure the styling for
775810and
776811.Sy "<i>"
777812elements in formatted message bodies.
813.It Sy "ruler"
814Configure the styling for the line used for drawing
815.Sy "<ruler>"
816elements in formatted message bodies.
778817.It Sy "strikethrough"
779818Configure the styling for
780819.Sy "<del>" ,
@@ -788,6 +827,10 @@ Configure the styling for
788827and
789828.Sy "<b>"
790829elements in formatted message bodies.
830.It Sy "table"
831Configure the styling for the line used for drawing the cells for
832.Sy "<table>"
833elements in formatted message bodies.
791834.It Sy "underlined"
792835Configure the styling for
793836.Sy "<u>"
src/completions.rs +6 −1
@@ -777,7 +777,12 @@ impl Completer<IambInfo> for IambCompleter {
777777 ) -> Vec<String> {
778778 match content {
779779 IambBufferId::Command(CommandType::Command) => complete_cmdbar(text, cursor, store),
780 IambBufferId::Command(CommandType::Search) => vec![],
780 IambBufferId::Command(
781 CommandType::Application |
782 CommandType::Content |
783 CommandType::Search |
784 CommandType::Shell,
785 ) => vec![],
781786 IambBufferId::Room(room_id, _, RoomFocus::MessageBar) => {
782787 complete_msgbar(text, cursor, store, room_id)
783788 },
src/config/theme.rs +162 −11
@@ -2,6 +2,7 @@
22use std::collections::hash_map::DefaultHasher;
33use std::hash::{Hash, Hasher};
44
5use ratatui::widgets::BorderType;
56use serde::de::Error as SerdeError;
67use serde::de::Visitor;
78use serde::{Deserialize, Deserializer};
@@ -11,7 +12,15 @@ use crate::prelude::*;
1112pub fn default_theme() -> Theme {
1213 Theme {
1314 messages: ThemeMessages {
15 blockquote: LineStylable {
16 line: Some(LineName::Thick),
17 stylable: Stylable::fg(Color::Indexed(236)),
18 },
1419 code: Stylable::bg(Color::Indexed(236)),
20 code_block: LineStylable {
21 line: Some(LineName::Plain),
22 stylable: Stylable::default(),
23 },
1524 emphasis: Stylable::with_modifiers(StyleModifier::ITALIC),
1625 strikethrough: Stylable::with_modifiers(StyleModifier::CROSSED_OUT),
1726 strong: Stylable::with_modifiers(StyleModifier::BOLD),
@@ -29,8 +38,8 @@ pub fn default_theme() -> Theme {
2938 title_focused: Stylable::without_modifiers(StyleModifier::DIM),
3039 },
3140 windows: ThemeWindows {
32 border: Stylable::with_modifiers(StyleModifier::DIM),
33 border_focused: Stylable::without_modifiers(StyleModifier::DIM),
41 border: Stylable::with_modifiers(StyleModifier::DIM).into(),
42 border_focused: Stylable::without_modifiers(StyleModifier::DIM).into(),
3443 title: Stylable::with_modifiers(StyleModifier::BOLD),
3544 ..Default::default()
3645 },
@@ -80,6 +89,57 @@ pub fn default_theme() -> Theme {
8089 }
8190}
8291
92/// Internal variant to get lowercase, hyphenated config options.
93#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)]
94#[serde(rename_all = "kebab-case")]
95pub enum LineName {
96 #[default]
97 Plain,
98 Rounded,
99 Double,
100 Thick,
101 DoubleDashedLight,
102 DoubleDashedHeavy,
103 TripleDashedLight,
104 TripleDashedHeavy,
105 QuadrupleDashedLight,
106 QuadrupleDashedHeavy,
107}
108
109impl LineName {
110 pub fn to_table_set(&self) -> &'static ratatui::symbols::line::Set<'static> {
111 match self {
112 Self::Plain => &ratatui::symbols::line::NORMAL,
113 Self::Rounded => &ratatui::symbols::line::ROUNDED,
114 Self::Double => &ratatui::symbols::line::DOUBLE,
115 Self::Thick => &ratatui::symbols::line::THICK,
116 Self::DoubleDashedLight => &ratatui::symbols::line::LIGHT_DOUBLE_DASHED,
117 Self::DoubleDashedHeavy => &ratatui::symbols::line::HEAVY_DOUBLE_DASHED,
118 Self::TripleDashedLight => &ratatui::symbols::line::LIGHT_TRIPLE_DASHED,
119 Self::TripleDashedHeavy => &ratatui::symbols::line::HEAVY_TRIPLE_DASHED,
120 Self::QuadrupleDashedLight => &ratatui::symbols::line::LIGHT_QUADRUPLE_DASHED,
121 Self::QuadrupleDashedHeavy => &ratatui::symbols::line::HEAVY_QUADRUPLE_DASHED,
122 }
123 }
124}
125
126impl From<LineName> for BorderType {
127 fn from(name: LineName) -> Self {
128 match name {
129 LineName::Plain => Self::Plain,
130 LineName::Rounded => Self::Rounded,
131 LineName::Double => Self::Double,
132 LineName::Thick => Self::Thick,
133 LineName::DoubleDashedLight => Self::LightDoubleDashed,
134 LineName::DoubleDashedHeavy => Self::HeavyDoubleDashed,
135 LineName::TripleDashedLight => Self::LightTripleDashed,
136 LineName::TripleDashedHeavy => Self::HeavyTripleDashed,
137 LineName::QuadrupleDashedLight => Self::LightQuadrupleDashed,
138 LineName::QuadrupleDashedHeavy => Self::HeavyQuadrupleDashed,
139 }
140 }
141}
142
83143#[derive(Clone, Copy, Debug)]
84144enum ModifierChange {
85145 Insert(StyleModifier),
@@ -215,6 +275,29 @@ impl From<Stylable> for Style {
215275 }
216276}
217277
278#[derive(Clone, Debug, Default, Deserialize)]
279struct LineStylable {
280 #[serde(rename = "line")]
281 line: Option<LineName>,
282 #[serde(flatten)]
283 stylable: Stylable,
284}
285
286impl LineStylable {
287 fn merge(self, other: Self) -> Self {
288 Self {
289 line: self.line.or(other.line),
290 stylable: self.stylable.merge(other.stylable),
291 }
292 }
293}
294
295impl From<Stylable> for LineStylable {
296 fn from(stylable: Stylable) -> Self {
297 Self { stylable, line: None }
298 }
299}
300
218301#[derive(Clone, Debug, Default, Deserialize)]
219302pub struct Theme {
220303 /// Default styling when others aren't specified.
@@ -339,11 +422,20 @@ struct ThemeMessages {
339422 #[serde(default)]
340423 default: Stylable,
341424
425 #[serde(default)]
426 blockquote: LineStylable,
427
342428 #[serde(default)]
343429 code: Stylable,
344430
345431 #[serde(default)]
346 code_block: Stylable,
432 code_block: LineStylable,
433
434 #[serde(default)]
435 ruler: LineStylable,
436
437 #[serde(default)]
438 table: LineStylable,
347439
348440 #[serde(default)]
349441 emphasis: Stylable,
@@ -362,8 +454,11 @@ impl ThemeMessages {
362454 fn merge(self, other: Self) -> Self {
363455 Self {
364456 default: self.default.merge(other.default),
457 blockquote: self.blockquote.merge(other.blockquote),
365458 code: self.code.merge(other.code),
366459 code_block: self.code_block.merge(other.code_block),
460 ruler: self.ruler.merge(other.ruler),
461 table: self.table.merge(other.table),
367462 emphasis: self.emphasis.merge(other.emphasis),
368463 strong: self.strong.merge(other.strong),
369464 strikethrough: self.strikethrough.merge(other.strikethrough),
@@ -373,17 +468,33 @@ impl ThemeMessages {
373468
374469 fn values(self, base: Style) -> ThemeMessagesValues {
375470 let default = base.patch(self.default);
376 let code = default.patch(self.code);
377 let code_block = code.patch(self.code_block);
471 let blockquote = default.patch(self.blockquote.stylable);
472 let ruler = default.patch(self.ruler.stylable);
473 let table = default.patch(self.table.stylable);
378474 let emphasis = default.patch(self.emphasis);
379475 let strong = default.patch(self.strong);
380476 let strikethrough = default.patch(self.strikethrough);
381477 let underlined = default.patch(self.underlined);
382478
479 let code = default.patch(self.code);
480 let code_block = code.patch(self.code_block.stylable);
481
482 let blockquote_line = self.blockquote.line.unwrap_or_default();
483 let code_block_line = self.code_block.line.unwrap_or_default().into();
484 let ruler_line = self.ruler.line.unwrap_or_default();
485 let table_line = self.table.line.unwrap_or_default();
486
383487 ThemeMessagesValues {
384488 default,
489 blockquote,
490 blockquote_line,
385491 code,
386492 code_block,
493 code_block_line,
494 ruler,
495 ruler_line,
496 table,
497 table_line,
387498 emphasis,
388499 strong,
389500 strikethrough,
@@ -395,8 +506,15 @@ impl ThemeMessages {
395506#[derive(Clone, Debug, Default)]
396507pub struct ThemeMessagesValues {
397508 pub default: Style,
509 pub blockquote: Style,
510 pub blockquote_line: LineName,
398511 pub code: Style,
399512 pub code_block: Style,
513 pub code_block_line: BorderType,
514 pub ruler: Style,
515 pub ruler_line: LineName,
516 pub table: Style,
517 pub table_line: LineName,
400518 pub emphasis: Style,
401519 pub strong: Style,
402520 pub strikethrough: Style,
@@ -548,6 +666,9 @@ struct ThemeCommandBar {
548666 #[serde(default)]
549667 default: Stylable,
550668
669 #[serde(default)]
670 completions: Stylable,
671
551672 #[serde(default)]
552673 prompt: Stylable,
553674
@@ -562,6 +683,7 @@ impl ThemeCommandBar {
562683 fn merge(self, other: Self) -> Self {
563684 Self {
564685 default: self.default.merge(other.default),
686 completions: self.completions.merge(other.completions),
565687 prompt: self.prompt.merge(other.prompt),
566688 info: self.info.merge(other.info),
567689 error: self.error.merge(other.error),
@@ -570,16 +692,18 @@ impl ThemeCommandBar {
570692
571693 fn values(self, base: Style) -> ThemeCommandBarValues {
572694 let default = base.patch(self.default);
695 let completions = default.patch(self.completions);
573696 let prompt = default.patch(self.prompt);
574697 let info = default.patch(self.info);
575698 let error = default.patch(self.error);
576 ThemeCommandBarValues { default, prompt, info, error }
699 ThemeCommandBarValues { default, completions, prompt, info, error }
577700 }
578701}
579702
580703#[derive(Clone, Debug, Default)]
581704pub struct ThemeCommandBarValues {
582705 pub default: Style,
706 pub completions: Style,
583707 pub prompt: Style,
584708 pub info: Style,
585709 pub error: Style,
@@ -705,10 +829,10 @@ struct ThemeWindows {
705829 default: Stylable,
706830
707831 #[serde(default)]
708 border: Stylable,
832 border: LineStylable,
709833
710834 #[serde(default)]
711 border_focused: Stylable,
835 border_focused: LineStylable,
712836
713837 #[serde(default)]
714838 title: Stylable,
@@ -726,11 +850,21 @@ impl ThemeWindows {
726850
727851 fn values(self, base: Style) -> ThemeWindowsValues {
728852 let default = base.patch(self.default);
729 let border = default.patch(self.border);
730 let border_focused = border.patch(self.border_focused);
853 let border = default.patch(self.border.stylable);
854 let border_focused = border.patch(self.border_focused.stylable);
731855 let title = default.patch(self.title);
856 let border_line: BorderType = self.border.line.unwrap_or_default().into();
857 let border_focused_line =
858 self.border_focused.line.map(BorderType::from).unwrap_or(border_line);
732859
733 ThemeWindowsValues { default, border, border_focused, title }
860 ThemeWindowsValues {
861 default,
862 border,
863 border_line,
864 border_focused,
865 border_focused_line,
866 title,
867 }
734868 }
735869}
736870
@@ -738,7 +872,9 @@ impl ThemeWindows {
738872pub struct ThemeWindowsValues {
739873 pub default: Style,
740874 pub border: Style,
875 pub border_line: BorderType,
741876 pub border_focused: Style,
877 pub border_focused_line: BorderType,
742878 pub title: Style,
743879}
744880
@@ -825,4 +961,19 @@ mod tests {
825961 assert_eq!(values.windows.border_focused, Style::default().fg(Color::Green).not_bold());
826962 assert_eq!(values.windows.title, Style::default().fg(Color::Red).bold());
827963 }
964
965 #[test]
966 fn test_border_names() {
967 let res: LineName = serde_json::from_str(r#""plain""#).unwrap();
968 assert_eq!(res, LineName::Plain);
969
970 let res: LineName = serde_json::from_str(r#""rounded""#).unwrap();
971 assert_eq!(res, LineName::Rounded);
972
973 let res: LineName = serde_json::from_str(r#""double-dashed-light""#).unwrap();
974 assert_eq!(res, LineName::DoubleDashedLight);
975
976 let res: LineName = serde_json::from_str(r#""double-dashed-heavy""#).unwrap();
977 assert_eq!(res, LineName::DoubleDashedHeavy);
978 }
828979}
src/main.rs +4
@@ -315,7 +315,11 @@ impl Application {
315315 .borders(true)
316316 .border_style(theme.windows.border)
317317 .border_style_focused(theme.windows.border_focused)
318 .border_type(theme.windows.border_line)
319 .border_type_focused(theme.windows.border_focused_line)
318320 .cmdbar_style(theme.cmdbar.default)
321 .cmdbar_completions_style(theme.cmdbar.completions)
322 .cmdbar_prompt_style(theme.cmdbar.prompt)
319323 .tab_style(theme.tabs.title)
320324 .tab_style_focused(theme.tabs.title_focused)
321325 .completion_style(theme.completion.default)
src/message/html.rs +37 −29
@@ -18,14 +18,11 @@ use html5ever::tendril::{StrTendril, TendrilSink};
1818use html5ever::{local_name, ns};
1919use markup5ever_rcdom::{Handle, NodeData, RcDom};
2020use matrix_sdk::OwnedServerName;
21use ratatui::symbols::line;
2221
2322use crate::message::printer::TextPrinter;
2423use crate::prelude::*;
2524use crate::util::{join_cell_text, space_text};
2625
27const QUOTE_COLOR: Color = Color::Indexed(236);
28
2926/// Generate bullet points from a [ListStyle].
3027pub struct BulletIterator {
3128 style: ListStyle,
@@ -162,6 +159,9 @@ impl Table {
162159
163160 let mut nrows = 0;
164161
162 let line_style = style.patch(settings.theme.messages.table);
163 let line = settings.theme.messages.table_line.to_table_set();
164
165165 if let Some(caption) = &self.caption {
166166 let subw = width.saturating_sub(6);
167167 let mut printer =
@@ -181,26 +181,26 @@ impl Table {
181181
182182 for (i, w) in cell_widths.iter().enumerate() {
183183 let cross = match (nrows, i) {
184 (0, 0) => line::TOP_LEFT,
185 (0, _) => line::HORIZONTAL_DOWN,
186 (_, 0) => line::VERTICAL_RIGHT,
187 (_, _) => line::CROSS,
184 (0, 0) => line.top_left,
185 (0, _) => line.horizontal_down,
186 (_, 0) => line.vertical_right,
187 (_, _) => line.cross,
188188 };
189189
190190 ruler.push_str(cross);
191191
192192 for _ in 0..*w {
193 ruler.push_str(line::HORIZONTAL);
193 ruler.push_str(line.horizontal);
194194 }
195195 }
196196
197197 if nrows == 0 {
198 ruler.push_str(line::TOP_RIGHT);
198 ruler.push_str(line.top_right);
199199 } else {
200 ruler.push_str(line::VERTICAL_LEFT);
200 ruler.push_str(line.vertical_left);
201201 }
202202
203 text.lines.push(Line::from(vec![Span::styled(ruler, style)]));
203 text.lines.push(Line::from(vec![Span::styled(ruler, line_style)]));
204204
205205 let cells = cell_widths
206206 .iter()
@@ -221,7 +221,7 @@ impl Table {
221221 })
222222 .collect();
223223
224 let joined = join_cell_text(cells, Span::styled(line::VERTICAL, style), style);
224 let joined = join_cell_text(cells, Span::styled(line.vertical, line_style), style);
225225 text.lines.extend(joined.lines);
226226
227227 nrows += 1;
@@ -233,20 +233,20 @@ impl Table {
233233
234234 for (i, w) in cell_widths.iter().enumerate() {
235235 let cross = if i == 0 {
236 line::BOTTOM_LEFT
236 line.bottom_left
237237 } else {
238 line::HORIZONTAL_UP
238 line.horizontal_up
239239 };
240240
241241 ruler.push_str(cross);
242242
243243 for _ in 0..*w {
244 ruler.push_str(line::HORIZONTAL);
244 ruler.push_str(line.horizontal);
245245 }
246246 }
247247
248 ruler.push_str(line::BOTTOM_RIGHT);
249 text.lines.push(Line::from(vec![Span::styled(ruler, style)]));
248 ruler.push_str(line.bottom_right);
249 text.lines.push(Line::from(vec![Span::styled(ruler, line_style)]));
250250 }
251251
252252 text
@@ -377,13 +377,16 @@ impl StyleTreeNode {
377377 printer.push_span_nobreak(span);
378378 },
379379 StyleTreeNode::Blockquote(child) => {
380 let quote_style = style.patch(printer.settings().theme.messages.blockquote);
381 let quote =
382 printer.settings().theme.messages.blockquote_line.to_table_set().vertical;
383
380384 let mut subp = printer.sub(3);
381385 child.print(&mut subp, style);
382386
383387 for mut line in subp.finish() {
384388 line.spans.insert(0, Span::styled(" ", style));
385 line.spans
386 .insert(0, Span::styled(line::THICK_VERTICAL, style.fg(QUOTE_COLOR)));
389 line.spans.insert(0, Span::styled(quote, quote_style));
387390 line.spans.insert(0, Span::styled(" ", style));
388391 printer.push_line(line);
389392 }
@@ -445,30 +448,31 @@ impl StyleTreeNode {
445448 let code_style = style.patch(subp.settings().theme.messages.code_block);
446449 let _ = subp.replace_base_style(code_style);
447450 let subw = subp.width();
451 let border = subp.settings().theme.messages.code_block_line.to_border_set();
448452
449453 child.print(&mut subp, code_style);
450454
451455 printer.commit();
452456 printer.push_line(
453457 vec![
454 Span::styled(line::TOP_LEFT, style),
455 Span::styled(line::HORIZONTAL.repeat(subw), style),
456 Span::styled(line::TOP_RIGHT, style),
458 Span::styled(border.top_left, style),
459 Span::styled(border.horizontal_top.repeat(subw), style),
460 Span::styled(border.top_right, style),
457461 ]
458462 .into(),
459463 );
460464
461465 for mut line in subp.finish() {
462 line.spans.insert(0, Span::styled(line::VERTICAL, style));
463 line.spans.push(Span::styled(line::VERTICAL, style));
466 line.spans.insert(0, Span::styled(border.vertical_left, style));
467 line.spans.push(Span::styled(border.vertical_right, style));
464468 printer.push_line(line);
465469 }
466470
467471 printer.push_line(
468472 vec![
469 Span::styled(line::BOTTOM_LEFT, style),
470 Span::styled(line::HORIZONTAL.repeat(subw), style),
471 Span::styled(line::BOTTOM_RIGHT, style),
473 Span::styled(border.bottom_left, style),
474 Span::styled(border.horizontal_bottom.repeat(subw), style),
475 Span::styled(border.bottom_right, style),
472476 ]
473477 .into(),
474478 );
@@ -476,8 +480,11 @@ impl StyleTreeNode {
476480 printer.commit();
477481 },
478482 StyleTreeNode::Ruler => {
483 let style = style.patch(printer.settings().theme.messages.ruler);
484 let line = printer.settings().theme.messages.ruler_line.to_table_set().horizontal;
485
479486 for _ in 0..width {
480 printer.push_str(line::HORIZONTAL, style);
487 printer.push_str(line, style);
481488 }
482489 },
483490 StyleTreeNode::Table(table) => {
@@ -921,6 +928,7 @@ pub fn parse_matrix_html(s: &str) -> StyleTree {
921928pub mod tests {
922929 use super::*;
923930 use pretty_assertions::assert_eq;
931 use ratatui::symbols::line;
924932 use unicode_width::UnicodeWidthStr;
925933
926934 use crate::tests::{mock_room, mock_settings};
@@ -1149,7 +1157,7 @@ pub mod tests {
11491157 let s = "<blockquote>Hello world!</blockquote>";
11501158 let tree = parse_matrix_html(s);
11511159 let text = tree.to_text(10, Style::default(), &settings, &info);
1152 let style = Style::new().fg(QUOTE_COLOR);
1160 let style = Style::new().fg(Color::Indexed(236));
11531161 assert_eq!(text.lines.len(), 2);
11541162 assert_eq!(
11551163 text.lines[0],
src/windows/mod.rs +6
@@ -1113,6 +1113,8 @@ impl Display for GenericRoomItem {
11131113}
11141114
11151115impl ListItem<IambInfo> for GenericRoomItem {
1116 type Section = &'static str;
1117
11161118 fn show(
11171119 &self,
11181120 selected: bool,
@@ -1189,6 +1191,8 @@ impl Display for MemberItem {
11891191}
11901192
11911193impl ListItem<IambInfo> for MemberItem {
1194 type Section = &'static str;
1195
11921196 fn show(
11931197 &self,
11941198 selected: bool,
@@ -1329,6 +1333,8 @@ impl Display for PinnedItem {
13291333}
13301334
13311335impl ListItem<IambInfo> for PinnedItem {
1336 type Section = &'static str;
1337
13321338 fn show(
13331339 &self,
13341340 selected: bool,
src/windows/verify.rs +2
@@ -133,6 +133,8 @@ impl fmt::Display for VerifyItem {
133133}
134134
135135impl ListItem<IambInfo> for VerifyItem {
136 type Section = &'static str;
137
136138 fn show(
137139 &self,
138140 selected: bool,