|
|
@ -1,5 +1,6 @@
|
|
|
|
//! Input event handling, currently backed by crossterm.
|
|
|
|
//! Input event handling, currently backed by crossterm.
|
|
|
|
use anyhow::{anyhow, Error};
|
|
|
|
use anyhow::{anyhow, Error};
|
|
|
|
|
|
|
|
use helix_core::unicode::width::UnicodeWidthStr;
|
|
|
|
use serde::de::{self, Deserialize, Deserializer};
|
|
|
|
use serde::de::{self, Deserialize, Deserializer};
|
|
|
|
use std::fmt;
|
|
|
|
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 {
|
|
|
|
fn width(&self) -> usize {
|
|
|
|
use unicode_width::UnicodeWidthChar;
|
|
|
|
use helix_core::unicode::width::UnicodeWidthChar;
|
|
|
|
let mut width = match self.code {
|
|
|
|
let mut width = match self.code {
|
|
|
|
KeyCode::Backspace => keys::BACKSPACE.len(),
|
|
|
|
KeyCode::Backspace => keys::BACKSPACE.len(),
|
|
|
|
KeyCode::Enter => keys::ENTER.len(),
|
|
|
|
KeyCode::Enter => keys::ENTER.len(),
|
|
|
|