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-term/src/ui/prompt.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'helix-term/src/ui/prompt.rs') diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 63078c39..6bb1b006 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -1,14 +1,17 @@ use crate::compositor::{Component, Compositor, Context, EventResult}; use crate::ui; use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; -use helix_core::Position; -use helix_view::{Editor, Theme}; use std::{borrow::Cow, ops::RangeFrom}; -use tui::terminal::CursorKind; +use tui::buffer::Buffer as Surface; use helix_core::{ unicode::segmentation::{GraphemeCursor, GraphemeIncomplete}, unicode::width::UnicodeWidthStr, + Position, +}; +use helix_view::{ + graphics::{Color, CursorKind, Margin, Modifier, Rect, Style}, + Editor, Theme, }; pub type Completion = (RangeFrom, Cow<'static, str>); @@ -251,12 +254,6 @@ impl Prompt { } } -use tui::{ - buffer::Buffer as Surface, - layout::Rect, - style::{Color, Modifier, Style}, -}; - const BASE_WIDTH: u16 = 30; impl Prompt { @@ -343,7 +340,6 @@ impl Prompt { let background = theme.get("ui.help"); surface.clear_with(area, background); - use tui::layout::Margin; text.render( area.inner(&Margin { vertical: 1, -- cgit v1.2.3-70-g09d2