diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-03-30 23:04:54 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-03 23:52:06 +0200 |
| commit | 9915b9fd0b8e59bda9e334eb9485c473b06055c9 (patch) | |
| tree | 768f0a04df7e6cfc6d1379de8f19d1d4acdbf3a2 /config.def.h | |
| parent | b3b1abc76a832e53159b1191120bef56fe3a7041 (diff) | |
| download | vis-9915b9fd0b8e59bda9e334eb9485c473b06055c9.tar.gz vis-9915b9fd0b8e59bda9e334eb9485c473b06055c9.tar.xz | |
Preliminary user interface separation
In theory only ui-curses.[hc] should depend on curses, however in
practice keyboard input is still handled in vis.c. Furthermore the
syntax definitions as well as keyboard bindings and selection code
in window.c still depends on some curses constants.
There is also a slight regression in that the window status bar
does not show the current mode name. This and related global state
should be eliminated in the future.
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/config.def.h b/config.def.h index 2a9e258..b8657a4 100644 --- a/config.def.h +++ b/config.def.h @@ -1,5 +1,4 @@ /** start by reading from the top of vis.c up until config.h is included */ -#define DEFAULT_TERM "xterm" /* default term to use if $TERM isn't set */ /* macros used to specify keys for key bindings */ #define ESC 0x1B #define NONE(k) { .str = { k }, .code = 0 } @@ -71,26 +70,6 @@ static Command cmds[] = { { /* array terminator */ }, }; -/* draw a statubar, do whatever you want with win->statuswin curses window */ -static void statusbar(EditorWin *win) { - bool focused = vis->win == win || vis->prompt->editor == win; - const char *filename = text_filename_get(win->text); - CursorPos pos = window_cursor_getpos(win->win); - 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 %s", - mode->name && mode->name[0] == '-' ? mode->name : "", - filename ? filename : "[No Name]", - text_modified(win->text) ? "[+]" : "", - vis->recording ? "recording": ""); - char buf[win->width + 1]; - int len = snprintf(buf, win->width, "%zd, %zd", pos.line, pos.col); - if (len > 0) { - buf[len] = '\0'; - mvwaddstr(win->statuswin, 0, win->width - len - 1, buf); - } -} - /* called before any other keybindings are checked, if the function returns false * the key is completely ignored. */ static bool vis_keypress(Key *key) { @@ -796,7 +775,6 @@ static Config editors[] = { { .name = "vis", .mode = &vis_modes[VIS_MODE_NORMAL], - .statusbar = statusbar, .keypress = vis_keypress, }, }; |
