aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-13 14:39:39 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-13 14:39:39 +0300
commitf817a761f00f07b7f57518065da0f5fd8ccf4c9d (patch)
treedba5ba853399880b12f855c53f96936a0e4a2dfd
parent3749cb79b6de6d966248f603c40107c44e719cce (diff)
downloadastar-f817a761f00f07b7f57518065da0f5fd8ccf4c9d.tar.xz
Add a keybinding to move to start/end
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.c b/main.c
index be36753..25b1142 100644
--- a/main.c
+++ b/main.c
@@ -159,6 +159,20 @@ int main(int argc, char **argv) {
case 'K': clear(); map_offset_y += 10; break;
case 'z': clear(); map_offset_x = 2; map_offset_y = 1; break; /* Move to top left corner */
case 'x': clear(); map_offset_x = - width * 2 + COLS - 2; map_offset_y = - height + LINES - 2; break; /* Move to bottom right corner */
+ case 'g':
+ switch (getch()) {
+ case 's':
+ clear();
+ map_offset_x = -start_pos.x * 2 + COLS/2;
+ map_offset_y = -start_pos.y + LINES/2;
+ break;
+ case 'e':
+ clear();
+ map_offset_x = -end_pos.x * 2 + COLS/2;
+ map_offset_y = -end_pos.y + LINES/2;
+ break;
+ }
+ break;
case 'a': anim = !anim; break;
case 'y':
case 'o':