aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.rs
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2023-12-29 16:13:59 -0800
committerRose Hogenson <rosehogenson@posteo.net>2023-12-29 16:13:59 -0800
commitda54c7c2c103c9b1c98f0c5179945b0122a1eef7 (patch)
treec11c0a4595e7569bd99e946250ed01575cec27f9 /src/term.rs
parent52591143ae4211555c955a7f9304684f75a59660 (diff)
downloadeditor-da54c7c2c103c9b1c98f0c5179945b0122a1eef7.tar.zst
Support inserting text.
Diffstat (limited to 'src/term.rs')
-rw-r--r--src/term.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/term.rs b/src/term.rs
index 20098a0..2303fa2 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -67,7 +67,7 @@ pub enum Key {
Down,
Left,
Right,
- Char(char),
+ Char(u8),
}
pub fn read_key(stdin: &mut Stdin) -> Result<Key, String> {
@@ -83,7 +83,7 @@ pub fn read_key(stdin: &mut Stdin) -> Result<Key, String> {
return Ok(Key::CtrlQ);
}
if buf[0] != ESC {
- return Ok(Key::Char(char::from(buf[0])));
+ return Ok(Key::Char(buf[0]));
}
// Try to handle an escape sequence.
let mut buf = vec![0; 2];