vis

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

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

commit 3302e5baf745b82a1ac37f08f2f700d325bed753
parent 58d464f310098d227ec8dbc438a5c07e32208e22
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun,  8 Nov 2015 19:39:24 +0100

ui: warn if theme loading failed

Diffstat:
Mui-curses.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ui-curses.c b/ui-curses.c @@ -1000,8 +1000,14 @@ static bool ui_init(Ui *ui, Vis *vis) { UiCurses *uic = (UiCurses*)ui; uic->vis = vis; const char *theme = getenv("VIS_THEME"); - if (!theme || !theme[0] || !vis_theme_load(vis, theme)) - vis_theme_load(vis, COLORS <= 16 ? "default-16" : "default-256"); + if (theme && theme[0]) { + if (!vis_theme_load(vis, theme)) + vis_info_show(vis, "Warning: failed to load theme `%s'", theme); + } else { + theme = COLORS <= 16 ? "default-16" : "default-256"; + if (!vis_theme_load(vis, theme)) + vis_info_show(vis, "Warning: failed to load theme `%s' set $VIS_PATH", theme); + } return true; }