summary refs log tree commit diff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--format.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/format.c b/format.c
index 800388b..30b287e 100644
--- a/format.c
+++ b/format.c
@@ -64,10 +64,11 @@ static const wchar_t Stops[] = {
 	L'\0',
 };
 
-bool formatParse(struct Format *format, const wchar_t *stop) {
+bool formatParse(struct Format *format, const wchar_t *split) {
 	format->str += format->len;
 	if (!format->str[0]) return false;
 
+	const wchar_t *init = format->str;
 	switch (format->str[0]) {
 		break; case IRCBold:      format->str++; format->bold ^= true;
 		break; case IRCItalic:    format->str++; format->italic ^= true;
@@ -76,14 +77,15 @@ bool formatParse(struct Format *format, const wchar_t *stop) {
 		break; case IRCColor:     format->str++; parseColor(format);
 		break; case IRCReset:     format->str++; formatReset(format);
 	}
+	format->split = (split >= init && split <= format->str);
 
 	if (format->str[0] == L' ') {
 		format->len = 1 + wcscspn(&format->str[1], Stops);
 	} else {
 		format->len = wcscspn(format->str, Stops);
 	}
-	if (stop && stop > format->str && stop < &format->str[format->len]) {
-		format->len = stop - format->str;
+	if (split > format->str && split < &format->str[format->len]) {
+		format->len = split - format->str;
 	}
 	return true;
 }
0'>2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe