summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui.c b/ui.c
index 6449e27..81cf125 100644
--- a/ui.c
+++ b/ui.c
@@ -374,14 +374,16 @@ static short stylePair(struct Style style) {
 	return colorPair(Colors[style.fg], Colors[style.bg]);
 }
 
-static void styleAdd(WINDOW *win, const char *str) {
+static int styleAdd(WINDOW *win, const char *str) {
 	struct Style style = StyleDefault;
 	while (*str) {
 		size_t len = styleParse(&style, &str);
 		wattr_set(win, styleAttr(style), stylePair(style), NULL);
-		waddnstr(win, str, len);
+		if (waddnstr(win, str, len) == ERR)
+			return -1;
 		str += len;
 	}
+	return 0;
 }
 
 static void statusUpdate(void) {
@@ -420,7 +422,7 @@ static void statusUpdate(void) {
 		if (window->scroll) {
 			catf(&cat, "~%d ", window->scroll);
 		}
-		styleAdd(status, buf);
+		if (styleAdd(status, buf) < 0) break;
 	}
 	wclrtoeol(status);
 
text.causal.agency/Makefile?id=850613cf83468343a8bf992cb4f1be434b02f593&follow=1'>Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe