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/buffer.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'helix-tui/src/buffer.rs') diff --git a/helix-tui/src/buffer.rs b/helix-tui/src/buffer.rs index 8b03cb0d..806a178b 100644 --- a/helix-tui/src/buffer.rs +++ b/helix-tui/src/buffer.rs @@ -1,12 +1,10 @@ -use crate::{ - layout::Rect, - style::{Color, Modifier, Style}, - text::{Span, Spans}, -}; +use crate::text::{Span, Spans}; use std::cmp::min; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; +use helix_view::graphics::{Color, Modifier, Rect, Style}; + /// A buffer cell #[derive(Debug, Clone, PartialEq)] pub struct Cell { @@ -89,8 +87,7 @@ impl Default for Cell { /// /// ``` /// use helix_tui::buffer::{Buffer, Cell}; -/// use helix_tui::layout::Rect; -/// use helix_tui::style::{Color, Style, Modifier}; +/// use helix_view::graphics::{Rect, Color, Style, Modifier}; /// /// let mut buf = Buffer::empty(Rect{x: 0, y: 0, width: 10, height: 5}); /// buf.get_mut(0, 2).set_symbol("x"); @@ -193,7 +190,7 @@ impl Buffer { /// /// ``` /// # use helix_tui::buffer::Buffer; - /// # use helix_tui::layout::Rect; + /// # use helix_view::graphics::Rect; /// let rect = Rect::new(200, 100, 10, 10); /// let buffer = Buffer::empty(rect); /// // Global coordinates to the top corner of this buffer's area @@ -225,7 +222,7 @@ impl Buffer { /// /// ``` /// # use helix_tui::buffer::Buffer; - /// # use helix_tui::layout::Rect; + /// # use helix_view::graphics::Rect; /// let rect = Rect::new(200, 100, 10, 10); /// let buffer = Buffer::empty(rect); /// assert_eq!(buffer.pos_of(0), (200, 100)); -- cgit v1.2.3-70-g09d2