From 4418e17547562e211952b9e8585916e04b858b3b Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Thu, 24 Jun 2021 20:58:15 -0700 Subject: 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 --- helix-tui/src/text.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'helix-tui/src/text.rs') 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> 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); -- cgit v1.2.3-70-g09d2