summaryrefslogtreecommitdiff
path: root/helix-term/src/ui/prompt.rs
diff options
context:
space:
mode:
authorKeith Simmons2021-06-25 03:58:15 +0000
committerGitHub2021-06-25 03:58:15 +0000
commit4418e17547562e211952b9e8585916e04b858b3b (patch)
tree8427958809392969b035967c1c69e9507207d00e /helix-term/src/ui/prompt.rs
parent74cc4b4a49e05462b2b543737ad4dc32e2265794 (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-term/src/ui/prompt.rs')
-rw-r--r--helix-term/src/ui/prompt.rs16
1 files changed, 6 insertions, 10 deletions
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<usize>, 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,