aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.rs
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-01-07 00:18:07 -0800
committerRose Hogenson <rosehogenson@posteo.net>2024-01-07 00:18:07 -0800
commit79b47a31332309b6fc1e5831e031ee4ca0d54450 (patch)
tree8d5b815f21c78906b22ece75ca629e1b563e221c /src/term.rs
parent01510eeccff4f5062ec061a964176d3a800a7094 (diff)
downloadeditor-79b47a31332309b6fc1e5831e031ee4ca0d54450.tar.zst
Implement redo.
Is this how redo works?
Diffstat (limited to 'src/term.rs')
-rw-r--r--src/term.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/term.rs b/src/term.rs
index 3a56091..988786d 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -69,6 +69,7 @@ pub enum Key {
CtrlQ,
CtrlS,
CtrlZ,
+ CtrlY,
Up,
Down,
Left,
@@ -80,6 +81,7 @@ pub enum Key {
pub fn read_key() -> Result<Key, Box<dyn Error>> {
const CTRL_Q: u8 = 17;
const CTRL_S: u8 = 19;
+ const CTRL_Y: u8 = 25;
const CTRL_Z: u8 = 26;
const BACKSPACE: u8 = 127;
const ESC: u8 = 27;
@@ -93,6 +95,9 @@ pub fn read_key() -> Result<Key, Box<dyn Error>> {
if buf[0] == CTRL_S {
return Ok(Key::CtrlS);
}
+ if buf[0] == CTRL_Y {
+ return Ok(Key::CtrlY);
+ }
if buf[0] == CTRL_Z {
return Ok(Key::CtrlZ);
}