@@ 126,6 126,10 @@ fn run(conf: *config, in: io::handle) (void | vt::error) = {
action_up(&state)?;
case ' ' =>
action_pgdown(&state)?;
+ case 'g' =>
+ action_top(&state)?;
+ case 'G' =>
+ action_bottom(&state)?;
case =>
yield;
};
@@ 263,3 267,15 @@ fn action_pgdown(state: *state) (void | vt::error) = {
fn action_pgup(state: *state) (void | vt::error) = {
scrollup(state, state.rows - 1)?;
};
+
+fn action_top(state: *state) (void | vt::error) = {
+ state.off = io::seek(state.in, 0, io::whence::SET)?;
+ state.eof = false;
+ delete(state.lines[..]);
+ vt::clear(state.term)?;
+ drawlines(state)?;
+};
+
+fn action_bottom(state: *state) (void | vt::error) = {
+ abort(); // TODO
+};