vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 2928f3ac7c8d51bc0f6f50db7c856f658ba6108a
parent 5f490c7b00c6e5da4f5f02658c531bb51957ef90
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun, 11 Jan 2015 18:06:16 +0100

Print prettier status bar when given no file name

Diffstat:
Mconfig.def.h | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/config.def.h b/config.def.h @@ -70,12 +70,13 @@ static Command cmds[] = { /* 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 : "", - text_filename_get(win->text), + filename ? filename : "[No Name]", text_modified(win->text) ? "[+]" : "", vis->recording ? "recording": ""); char buf[win->width + 1];