From ce2bfb4d3a49a27bde7c8bbc6c6b1ef6f80054aa Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Fri, 16 Aug 2019 23:43:24 +0100 Subject: add position marks (Ma/g'a) --- screen.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 28d2318..0ef1f69 100644 --- a/screen.c +++ b/screen.c @@ -301,6 +301,24 @@ void handle_goto(FILE *fc, char global){ go_to(MIDDLE); } else step = 0; break; + case '\'': + c = tolower(fgetc(fc)); + if (global) { + dir = DIR_N; + if (isalpha(c) && mark_map[c - 'a']){ + x = marks[c - 'a'].x; + y = marks[c - 'a'].y; +#ifdef DEBUG + fprintf(stderr, "going to valid mark '%c' (%d, %d)\n", c, x, y); +#endif + } +#ifdef DEBUG + else + fprintf(stderr, "invalid mark '%c'\n", c); +#endif + } else step = 0; + break; + } #ifdef DEBUG @@ -435,20 +453,23 @@ void init_screen(){ for (i=0; i