summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/ui.c b/ui.c
index 568df8d..172120b 100644
--- a/ui.c
+++ b/ui.c
@@ -325,27 +325,6 @@ static void unmark(void) {
 	statusUpdate();
 }
 
-static void windowShow(struct Window *window) {
-	touchwin(window->pad);
-	windows.other = windows.active;
-	windows.active = window;
-	windows.other->mark = true;
-	unmark();
-}
-
-void uiShowID(size_t id) {
-	windowShow(windowFor(id));
-}
-
-void uiShowNum(size_t num) {
-	struct Window *window = windows.head;
-	for (size_t i = 0; i < num; ++i) {
-		window = window->next;
-		if (!window) return;
-	}
-	windowShow(window);
-}
-
 static int wordWidth(const char *str) {
 	size_t len = strcspn(str, " ");
 	int width = 0;
@@ -462,6 +441,7 @@ static void inputUpdate(void) {
 		NULL
 	);
 	if (self.nick) {
+		// TODO: Check if input is command or action.
 		waddch(input, '<');
 		waddstr(input, self.nick);
 		waddstr(input, "> ");
@@ -476,6 +456,28 @@ static void inputUpdate(void) {
 	wmove(input, y, x);
 }
 
+static void windowShow(struct Window *window) {
+	touchwin(window->pad);
+	windows.other = windows.active;
+	windows.active = window;
+	windows.other->mark = true;
+	inputUpdate();
+	unmark();
+}
+
+void uiShowID(size_t id) {
+	windowShow(windowFor(id));
+}
+
+void uiShowNum(size_t num) {
+	struct Window *window = windows.head;
+	for (size_t i = 0; i < num; ++i) {
+		window = window->next;
+		if (!window) return;
+	}
+	windowShow(window);
+}
+
 static void keyCode(int code) {
 	switch (code) {
 		break; case KEY_RESIZE:; // TODO
er'>2021-06-09Use seprintf for snip, removing strlcpynJune McEnroe 2021-06-09Use seprintf for reserializeJune McEnroe 2021-06-09Use seprintf for capListJune McEnroe 2021-06-09Add seprintfJune McEnroe Based on seprint(2) from Plan 9. I'm not sure if my return value exactly matches Plan 9's in the case of truncation. seprint(2) is described only as returning a pointer to the terminating '\0', but if it does so even in the case of truncation, it is awkward for the caller to detect. This implementation returns end in the truncation case, so that (ptr == end) indicates truncation. 2021-05-27Add pounce-notify to README 2.4June McEnroe 2021-05-27Fix ENVIRONMENT formatting in pounce-notify(1)June McEnroe 2021-05-27Add note about Libera.Chat SASL-only rangesJune McEnroe 2021-05-25Add QUIRKS fileJune McEnroe 2021-05-19Replace freenode with tilde.chatJune McEnroe 2021-05-04notify: Reword pounce-notify manualJune McEnroe 2021-05-02Clean up Makefiles, configure scriptsJune McEnroe Default MANDIR to ${PREFIX}/man since it turns out man-db includes /usr/local/man by default. Add support for BINDIR. Separate libs out into LDADD variables. 2021-04-30palaver: Exit on getopt failureJune McEnroe Oops. 2021-04-30notify: Implement pounce-notifyJune McEnroe