summaryrefslogtreecommitdiff
path: root/helix-tui/src/backend/crossterm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-tui/src/backend/crossterm.rs')
-rw-r--r--helix-tui/src/backend/crossterm.rs35
1 files changed, 2 insertions, 33 deletions
diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs
index 189f9dce..eff098b3 100644
--- a/helix-tui/src/backend/crossterm.rs
+++ b/helix-tui/src/backend/crossterm.rs
@@ -1,10 +1,4 @@
-use crate::{
- backend::Backend,
- buffer::Cell,
- layout::Rect,
- style::{Color, Modifier},
- terminal::CursorKind,
-};
+use crate::{backend::Backend, buffer::Cell};
use crossterm::{
cursor::{CursorShape, Hide, MoveTo, SetCursorShape, Show},
execute, queue,
@@ -14,6 +8,7 @@ use crossterm::{
},
terminal::{self, Clear, ClearType},
};
+use helix_view::graphics::{Color, CursorKind, Modifier, Rect};
use std::io::{self, Write};
pub struct CrosstermBackend<W: Write> {
@@ -133,32 +128,6 @@ fn map_error(error: crossterm::Result<()>) -> io::Result<()> {
error.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))
}
-impl From<Color> for CColor {
- fn from(color: Color) -> Self {
- match color {
- Color::Reset => CColor::Reset,
- Color::Black => CColor::Black,
- Color::Red => CColor::DarkRed,
- Color::Green => CColor::DarkGreen,
- Color::Yellow => CColor::DarkYellow,
- Color::Blue => CColor::DarkBlue,
- Color::Magenta => CColor::DarkMagenta,
- Color::Cyan => CColor::DarkCyan,
- Color::Gray => CColor::Grey,
- Color::DarkGray => CColor::DarkGrey,
- Color::LightRed => CColor::Red,
- Color::LightGreen => CColor::Green,
- Color::LightBlue => CColor::Blue,
- Color::LightYellow => CColor::Yellow,
- Color::LightMagenta => CColor::Magenta,
- Color::LightCyan => CColor::Cyan,
- Color::White => CColor::White,
- Color::Indexed(i) => CColor::AnsiValue(i),
- Color::Rgb(r, g, b) => CColor::Rgb { r, g, b },
- }
- }
-}
-
#[derive(Debug)]
struct ModifierDiff {
pub from: Modifier,