diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-11 18:23:49 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-11 18:23:49 +0200 |
| commit | 838631bc7d6d242ea168f3ed4206cf3c51b63733 (patch) | |
| tree | 877b639ac78b0efe83b1bf851564effa8916edd5 /config.def.h | |
| parent | ae450167e7f0574876db44bbe434c4021ee02979 (diff) | |
| download | vis-838631bc7d6d242ea168f3ed4206cf3c51b63733.tar.gz vis-838631bc7d6d242ea168f3ed4206cf3c51b63733.tar.xz | |
Be stricter on what commands to accept at the ':'- prompt
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/config.def.h b/config.def.h index 4b5bf79..62fce25 100644 --- a/config.def.h +++ b/config.def.h @@ -44,23 +44,20 @@ enum { VIS_MODE_REPLACE, }; -/* command recognized at the ':'-prompt, matched using a greedy top to bottom, - * regex search. make sure the longer commands are listed before the shorter ones - * e.g. 'sp' before 's' and 'wq' before 'w'. - */ +/* command recognized at the ':'-prompt. tested top to bottom, first match wins. */ static Command cmds[] = { - { "^[0-9]+", cmd_gotoline }, - { "^e(dit)?", cmd_edit }, - { "^o(pen)?", cmd_open }, - { "^qa(ll)?", cmd_qall }, - { "^q(quit)?", cmd_quit }, - { "^r(ead)?", cmd_read }, - { "^sp(lit)?", cmd_split }, - { "^s(ubstitute)?", cmd_substitute }, - { "^v(split)?", cmd_vsplit }, - { "^wq", cmd_wq }, - { "^w(rite)?", cmd_write }, - { /* array terminator */ }, + { "^[0-9]+$", cmd_gotoline }, + { "^e(dit)?!?$", cmd_edit }, + { "^o(pen)?$", cmd_open }, + { "^qa(ll)?!?$", cmd_qall }, + { "^q(quit)?!?$", cmd_quit }, + { "^r(ead)?$", cmd_read }, + { "^sp(lit)?$", cmd_split }, + { "^s(ubstitute)?$", cmd_substitute }, + { "^v(split)?$", cmd_vsplit }, + { "^wq!?$", cmd_wq }, + { "^w(rite)?$", cmd_write }, + { /* array terminator */ }, }; /* draw a statubar, do whatever you want with win->statuswin curses window */ |
