vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 0355fc94d9a6f6aad81c36a3aab538443ba20d21 parent 79f1bb216c652de6317db2394bfd4d5bd6f623a4 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 11 Sep 2014 11:01:36 +0200 Remove Ctrl+c for quit, since we now have a command prompt Diffstat:
| M | config.def.h | | | 4 | +--- |
| M | vis.c | | | 5 | +++-- |
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h @@ -90,9 +90,7 @@ static KeyBinding basic_movement[] = { { { KEY(NPAGE) }, cursor, { .m = window_page_down } }, { { KEY(HOME) }, movement, { .i = MOVE_LINE_START } }, { { KEY(END) }, movement, { .i = MOVE_LINE_FINISH } }, - // temporary until we have a way to enter user commands - { { CONTROL('c') }, quit, }, - { /* empty last element, array terminator */ }, + { /* empty last element, array terminator */ }, }; static KeyBinding vis_movements[] = { diff --git a/vis.c b/vis.c @@ -375,6 +375,7 @@ static void insert_verbatim(const Arg *arg); static void cursor(const Arg *arg); /* call editor function as indicated by arg->f */ static void call(const Arg *arg); +/* quit editor, discard all changes */ static void quit(const Arg *arg); /** commands to enter at the ':'-prompt */ @@ -878,7 +879,7 @@ static bool cmd_quit(const char *argv[]) { return false; editor_window_close(vis->win); if (!vis->windows) - running = false; + quit(NULL); return true; } @@ -890,7 +891,7 @@ static bool cmd_qall(const char *argv[]) { editor_window_close(win); } if (!vis->windows) - running = false; + quit(NULL); return vis->windows == NULL; }