about summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/ui.c b/ui.c
index 12c8541..daa6dec 100644
--- a/ui.c
+++ b/ui.c
@@ -479,16 +479,29 @@ static void inputUpdate(void) {
 		colorPair(mapColor(self.color), -1),
 		NULL
 	);
+	const char *head = editHead();
+	const char *skip = NULL;
 	if (self.nick) {
-		// TODO: Check if input is command or action.
-		waddch(input, '<');
-		waddstr(input, self.nick);
-		waddstr(input, "> ");
+		size_t id = windows.active->id;
+		if (NULL != (skip = commandIsPrivmsg(id, head))) {
+			waddch(input, '<');
+			waddstr(input, self.nick);
+			waddstr(input, "> ");
+		} else if (NULL != (skip = commandIsNotice(id, head))) {
+			waddch(input, '-');
+			waddstr(input, self.nick);
+			waddstr(input, "- ");
+		} else if (NULL != (skip = commandIsAction(id, head))) {
+			waddstr(input, "* ");
+			waddstr(input, self.nick);
+			waddch(input, ' ');
+		}
 	}
+	if (skip) head = skip;
 
 	int y, x;
 	struct Style style = Reset;
-	inputAdd(&style, editHead());
+	inputAdd(&style, head);
 	getyx(input, y, x);
 	inputAdd(&style, editTail());
 	wclrtoeol(input);
input.c?id=5c4ecb5a0f8a8a532192d066f792c1f2bfbc414c&follow=1'>Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe 2022-02-18Implement new line editing "library"June McEnroe 2022-02-18Simplify cursor positioning in inputJune McEnroe 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe