diff options
author | extrawurst <mail@rusticorn.com> | 2024-04-16 08:25:20 +0200 |
---|---|---|
committer | extrawurst <mail@rusticorn.com> | 2024-04-16 08:25:20 +0200 |
commit | 115fd168f5a6fb8b726b8ccee51b05fd722027c8 (patch) | |
tree | af6716ab93062d876e901e365c5fa73c19f7d4a7 /src/ui | |
parent | 47db649e39d98560ffc6f977f0e33e8ff9088d18 (diff) | |
parent | 920c28cfd78b75d84aed7e3fcc543ac821e7afcb (diff) |
Merge branch 'master'ratatui-25-update
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/reflow.rs | 2 | ||||
-rw-r--r-- | src/ui/scrolllist.rs | 1 | ||||
-rw-r--r-- | src/ui/stateful_paragraph.rs | 1 | ||||
-rw-r--r-- | src/ui/style.rs | 6 | ||||
-rw-r--r-- | src/ui/syntax_text.rs | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/reflow.rs b/src/ui/reflow.rs index 8b9c3cde..6255de4e 100644 --- a/src/ui/reflow.rs +++ b/src/ui/reflow.rs @@ -445,7 +445,7 @@ mod test { "mnopab cdefghi j", "klmno", ] - ) + ); } #[test] diff --git a/src/ui/scrolllist.rs b/src/ui/scrolllist.rs index d012ac9a..d65d1451 100644 --- a/src/ui/scrolllist.rs +++ b/src/ui/scrolllist.rs @@ -34,7 +34,6 @@ where } } - #[allow(clippy::missing_const_for_fn)] fn block(mut self, block: Block<'b>) -> Self { self.block = Some(block); self diff --git a/src/ui/stateful_paragraph.rs b/src/ui/stateful_paragraph.rs index 4e31cb07..368c07b8 100644 --- a/src/ui/stateful_paragraph.rs +++ b/src/ui/stateful_paragraph.rs @@ -89,7 +89,6 @@ impl<'a> StatefulParagraph<'a> { } } - #[allow(clippy::missing_const_for_fn)] pub fn block(mut self, block: Block<'a>) -> Self { self.block = Some(block); self diff --git a/src/ui/style.rs b/src/ui/style.rs index c00137b7..e687e45e 100644 --- a/src/ui/style.rs +++ b/src/ui/style.rs @@ -143,7 +143,11 @@ impl Theme { self.apply_select(style, selected) } - fn apply_select(&self, style: Style, selected: bool) -> Style { + const fn apply_select( + &self, + style: Style, + selected: bool, + ) -> Style { if selected { style.bg(self.selection_bg).fg(self.selection_fg) } else { diff --git a/src/ui/syntax_text.rs b/src/ui/syntax_text.rs index 776196ed..fba036e7 100644 --- a/src/ui/syntax_text.rs +++ b/src/ui/syntax_text.rs @@ -33,7 +33,7 @@ pub struct SyntaxText { } static SYNTAX_SET: Lazy<SyntaxSet> = - Lazy::new(SyntaxSet::load_defaults_nonewlines); + Lazy::new(two_face::syntax::extra_no_newlines); static THEME_SET: Lazy<ThemeSet> = Lazy::new(ThemeSet::load_defaults); pub struct AsyncProgressBuffer { |