diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-12-18 13:50:19 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-12-18 16:57:18 +0100 |
| commit | b8456fa2615480fa242c6992ca89481a8370fe5f (patch) | |
| tree | 4836c8561242182ea5d13d735fe6432e9d5624c4 /config.def.h | |
| parent | 46ffdc3dff7a8bf87f3b1004c3c12a7f6fcd8d6c (diff) | |
| download | vis-b8456fa2615480fa242c6992ca89481a8370fe5f.tar.gz vis-b8456fa2615480fa242c6992ca89481a8370fe5f.tar.xz | |
Macro support
At some point this should be optimized further at the moment there
is some 20 byte overhead for each entered key.
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h index f41dd81..16fd674 100644 --- a/config.def.h +++ b/config.def.h @@ -73,10 +73,11 @@ static void statusbar(EditorWin *win) { window_cursor_getxy(win->win, &line, &col); wattrset(win->statuswin, focused ? A_REVERSE|A_BOLD : A_REVERSE); mvwhline(win->statuswin, 0, 0, ' ', win->width); - mvwprintw(win->statuswin, 0, 0, "%s %s %s", + mvwprintw(win->statuswin, 0, 0, "%s %s %s %s", mode->name && mode->name[0] == '-' ? mode->name : "", text_filename_get(win->text), - text_modified(win->text) ? "[+]" : ""); + text_modified(win->text) ? "[+]" : "", + vis->recording ? "recording": ""); char buf[win->width + 1]; int len = snprintf(buf, win->width, "%d, %d", line, col); if (len > 0) { @@ -86,9 +87,11 @@ static void statusbar(EditorWin *win) { } /* called before any other keybindings are checked, if the function returns false - * the key is completely ignored. used to clear a user visible message. */ + * the key is completely ignored. */ static bool vis_keypress(Key *key) { editor_info_hide(vis); + if (vis->recording) + macro_append(vis->recording, key, sizeof(*key)); return true; } @@ -407,6 +410,8 @@ static KeyBinding vis_mode_normal[] = { { { NONE('z'), NONE('t') }, window, { .w = window_redraw_top } }, { { NONE('z'), NONE('z') }, window, { .w = window_redraw_center } }, { { NONE('z'), NONE('b') }, window, { .w = window_redraw_bottom } }, + { { NONE('q') }, macro_record, { NULL } }, + { { NONE('@') }, macro_replay, { NULL } }, { /* empty last element, array terminator */ }, }; |
