A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/edi/input_handlers/keyboard.rs')
-rw-r--r--src/edi/input_handlers/keyboard.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/edi/input_handlers/keyboard.rs b/src/edi/input_handlers/keyboard.rs
index 9a22457..c789851 100644
--- a/src/edi/input_handlers/keyboard.rs
+++ b/src/edi/input_handlers/keyboard.rs
@@ -345,8 +345,11 @@ impl Editor {
Some(Do::Edit) => self.handle_edit(event),
Some(Do::Undo) => {
self.hist.test_push(&mut self.text);
- self.hist.undo(&mut self.text).unwrap();
+ if let Err(e) = self.hist.undo(&mut self.text) {
+ eprintln!("undo failed: {e}");
+ }
self.bar.last_action = "undid".to_string();
+
change!(self, window.clone());
}
Some(Do::Redo) => {
@@ -758,9 +761,10 @@ impl Editor {
x
.iter()
.flatten()
- .flat_map(|(a, b)| {
- [a, b].map(|c| self.text.rope.l_position(*c).unwrap())
- })
+ .map(|c| self.text.rope.l_position(*c).unwrap())
+ // .flat_map(|(a, b)| {
+ // [a, b].map(|c| self.text.rope.l_position(*c).unwrap())
+ // })
.sorted()
.rev()
{