commit afc1045c4d1309313bdb69bd04d21211cd2eb0b6 from: Omar Polo date: Fri Apr 30 12:39:20 2021 UTC added DEFALIAS, q and wq are alias to cmd_kill_telescope commit - cce62e74aaf4fc91e3dfb0fdd3962ed4c5c03ef2 commit + afc1045c4d1309313bdb69bd04d21211cd2eb0b6 blob - ec37209673fddb2cbaf4cca95643b228cbcdeb2e blob + 2c5589320aa9c639784d20cd9005bd978555c546 --- gencmd.awk +++ gencmd.awk @@ -1,5 +1,5 @@ BEGIN { - FS = "[()]"; + FS = "[(,)]"; print "static struct cmds { const char *cmd; void(*fn)(struct window*); } cmds[] = {"; } @@ -12,6 +12,13 @@ BEGIN { next; } +/^DEFALIAS/ { + s = $2; + d = $3; + printf("\t{ \"%s\", %s },\n", s, d); + next +} + { next; } blob - 0b7ad41c21ba5f9fe0116380a50275c1bffdaf02 blob + 17ee0001301787e40a703bd3ffd6c2bc0b35606d --- ui.c +++ ui.c @@ -53,7 +53,8 @@ static struct event stdioev, winchev; static void load_default_keys(void); static void restore_cursor(struct window*); -#define CMD(fnname) static void fnname(struct window *) +#define CMD(fnname) static void fnname(struct window *) +#define DEFALIAS(s, d) /* nothing */ CMD(cmd_previous_line); CMD(cmd_next_line); @@ -70,7 +71,11 @@ CMD(cmd_scroll_up); CMD(cmd_scroll_down); CMD(cmd_beginning_of_buffer); CMD(cmd_end_of_buffer); + CMD(cmd_kill_telescope); +DEFALIAS(q, cmd_kill_telescope) +DEFALIAS(wq, cmd_kill_telescope) + CMD(cmd_push_button); CMD(cmd_push_button_new_tab); CMD(cmd_previous_button);