diff options
author | Keith Simmons | 2021-06-25 03:58:15 +0000 |
---|---|---|
committer | GitHub | 2021-06-25 03:58:15 +0000 |
commit | 4418e17547562e211952b9e8585916e04b858b3b (patch) | |
tree | 8427958809392969b035967c1c69e9507207d00e /helix-tui/src/text.rs | |
parent | 74cc4b4a49e05462b2b543737ad4dc32e2265794 (diff) |
reverse the dependency between helix-tui and helix-view (#366)
* reverse the dependency between helix-tui and helix-view by moving a fiew types to view
* fix tests
* clippy and format fixes
Co-authored-by: Keith Simmons <keithsim@microsoft.com>
Diffstat (limited to 'helix-tui/src/text.rs')
-rw-r--r-- | helix-tui/src/text.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/helix-tui/src/text.rs b/helix-tui/src/text.rs index b23bfd81..4af6b09d 100644 --- a/helix-tui/src/text.rs +++ b/helix-tui/src/text.rs @@ -21,7 +21,7 @@ //! ```rust //! # use helix_tui::widgets::Block; //! # use helix_tui::text::{Span, Spans}; -//! # use helix_tui::style::{Color, Style}; +//! # use helix_view::graphics::{Color, Style}; //! // A simple string with no styling. //! // Converted to Spans(vec![ //! // Span { content: Cow::Borrowed("My title"), style: Style { .. } } @@ -46,8 +46,8 @@ //! Span::raw(" title"), //! ]); //! ``` -use crate::style::Style; use helix_core::line_ending::str_is_line_ending; +use helix_view::graphics::Style; use std::borrow::Cow; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; @@ -92,7 +92,7 @@ impl<'a> Span<'a> { /// /// ```rust /// # use helix_tui::text::Span; - /// # use helix_tui::style::{Color, Modifier, Style}; + /// # use helix_view::graphics::{Color, Modifier, Style}; /// let style = Style::default().fg(Color::Yellow).add_modifier(Modifier::ITALIC); /// Span::styled("My text", style); /// Span::styled(String::from("My text"), style); @@ -121,7 +121,7 @@ impl<'a> Span<'a> { /// /// ```rust /// # use helix_tui::text::{Span, StyledGrapheme}; - /// # use helix_tui::style::{Color, Modifier, Style}; + /// # use helix_view::graphics::{Color, Modifier, Style}; /// # use std::iter::Iterator; /// let style = Style::default().fg(Color::Yellow); /// let span = Span::styled("Text", style); @@ -211,7 +211,7 @@ impl<'a> Spans<'a> { /// /// ```rust /// # use helix_tui::text::{Span, Spans}; - /// # use helix_tui::style::{Color, Style}; + /// # use helix_view::graphics::{Color, Style}; /// let spans = Spans::from(vec![ /// Span::styled("My", Style::default().fg(Color::Yellow)), /// Span::raw(" text"), @@ -265,7 +265,7 @@ impl<'a> From<Spans<'a>> for String { /// /// ```rust /// # use helix_tui::text::Text; -/// # use helix_tui::style::{Color, Modifier, Style}; +/// # use helix_view::graphics::{Color, Modifier, Style}; /// let style = Style::default().fg(Color::Yellow).add_modifier(Modifier::ITALIC); /// /// // An initial two lines of `Text` built from a `&str` @@ -319,7 +319,7 @@ impl<'a> Text<'a> { /// /// ```rust /// # use helix_tui::text::Text; - /// # use helix_tui::style::{Color, Modifier, Style}; + /// # use helix_view::graphics::{Color, Modifier, Style}; /// let style = Style::default().fg(Color::Yellow).add_modifier(Modifier::ITALIC); /// Text::styled("The first line\nThe second line", style); /// Text::styled(String::from("The first line\nThe second line"), style); @@ -369,7 +369,7 @@ impl<'a> Text<'a> { /// /// ```rust /// # use helix_tui::text::Text; - /// # use helix_tui::style::{Color, Modifier, Style}; + /// # use helix_view::graphics::{Color, Modifier, Style}; /// let style = Style::default().fg(Color::Yellow).add_modifier(Modifier::ITALIC); /// let mut raw_text = Text::raw("The first line\nThe second line"); /// let styled_text = Text::styled(String::from("The first line\nThe second line"), style); |