M linetest/src/shell/ui/buffer.rs => linetest/src/shell/ui/buffer.rs +8 -0
@@ 236,6 236,14 @@ impl InputBuffer {
}
}
+ pub fn goto_head(&mut self) {
+ self.pos = 0;
+ }
+
+ pub fn goto_tail(&mut self) {
+ self.pos = self.buffer.len();
+ }
+
pub fn take(&mut self) -> String {
let mut old_buffer = String::new();
std::mem::swap(&mut self.buffer, &mut old_buffer);
M linetest/src/shell/ui/term.rs => linetest/src/shell/ui/term.rs +8 -0
@@ 147,6 147,14 @@ impl TermInterface {
self.syslog.scroll_down();
},
+ event::KeyCode::Home => {
+ self.buffer.goto_head();
+ },
+
+ event::KeyCode::End => {
+ self.buffer.goto_tail();
+ },
+
_ => {},
},
}