From 9effe71b7d2133f18545d182cef384ea3fd1c0ff Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 30 Jun 2021 00:17:16 +0800 Subject: Apply suggestions from blaz for infobox --- helix-view/Cargo.toml | 1 - helix-view/src/info.rs | 2 +- helix-view/src/input.rs | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'helix-view') diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index b6816d71..cb2032de 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -31,7 +31,6 @@ slotmap = "1" encoding_rs = "0.8" chardetng = "0.1" -unicode-width = "0.1" serde = { version = "1.0", features = ["derive"] } toml = "0.5" diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs index eef8d3a1..0eaab783 100644 --- a/helix-view/src/info.rs +++ b/helix-view/src/info.rs @@ -1,6 +1,6 @@ use crate::input::KeyEvent; +use helix_core::unicode::width::UnicodeWidthStr; use std::fmt::Write; -use unicode_width::UnicodeWidthStr; #[derive(Debug)] /// Info box used in editor. Rendering logic will be in other crate. diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs index 6e8292e9..2847bb69 100644 --- a/helix-view/src/input.rs +++ b/helix-view/src/input.rs @@ -1,5 +1,6 @@ //! Input event handling, currently backed by crossterm. use anyhow::{anyhow, Error}; +use helix_core::unicode::width::UnicodeWidthStr; use serde::de::{self, Deserialize, Deserializer}; use std::fmt; @@ -90,9 +91,9 @@ impl fmt::Display for KeyEvent { } } -impl unicode_width::UnicodeWidthStr for KeyEvent { +impl UnicodeWidthStr for KeyEvent { fn width(&self) -> usize { - use unicode_width::UnicodeWidthChar; + use helix_core::unicode::width::UnicodeWidthChar; let mut width = match self.code { KeyCode::Backspace => keys::BACKSPACE.len(), KeyCode::Enter => keys::ENTER.len(), -- cgit v1.2.3-70-g09d2