From f6b8cede914ca2e3c2d1b389b81d4cf3e5f33bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 11 Jan 2015 18:06:16 +0100 Subject: Print prettier status bar when given no file name --- config.def.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 642d0cc..27b8486 100644 --- 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]; -- cgit v1.2.3