about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catgirl.14
-rw-r--r--ui.c21
2 files changed, 15 insertions, 10 deletions
diff --git a/catgirl.1 b/catgirl.1
index 722cfd8..cb2826a 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -1,4 +1,4 @@
-.Dd February 25, 2019
+.Dd February 26, 2019
 .Dt CATGIRL 1
 .Os
 .
@@ -304,6 +304,8 @@ Redraw the UI.
 Switch to the next window.
 .It Ic C-p
 Switch to the previous window.
+.It Ic M-/
+Switch to the previously active window.
 .It Ic M-a
 Switch to next hot or unread window.
 .It Ic M-l
diff --git a/ui.c b/ui.c
index fb4a366..643d627 100644
--- a/ui.c
+++ b/ui.c
@@ -61,6 +61,7 @@ struct Window {
 
 static struct {
 	struct Window *active;
+	struct Window *other;
 	struct Window *head;
 	struct Window *tail;
 	struct Window *tag[TagsLen];
@@ -126,11 +127,13 @@ static void windowShow(struct Window *win) {
 		touchwin(win->log);
 		windowUnmark(win);
 	}
+	windows.other = windows.active;
 	windows.active = win;
 }
 
 static void windowClose(struct Window *win) {
 	if (windows.active == win) windowShow(win->next ? win->next : win->prev);
+	if (windows.other == win) windows.other = NULL;
 	windowRemove(win);
 	delwin(win->log);
 	free(win);
@@ -352,12 +355,16 @@ static void uiStatus(void) {
 	wclrtoeol(ui.status);
 }
 
-void uiShowTag(struct Tag tag) {
-	windowShow(windowFor(tag));
+static void uiShowWindow(struct Window *win) {
+	windowShow(win);
 	uiStatus();
 	uiPrompt(false);
 }
 
+void uiShowTag(struct Tag tag) {
+	uiShowWindow(windowFor(tag));
+}
+
 void uiShowNum(int num, bool relative) {
 	struct Window *win = (relative ? windows.active : windows.head);
 	if (num < 0) {
@@ -365,10 +372,7 @@ void uiShowNum(int num, bool relative) {
 	} else {
 		for (; win; win = win->next) if (!num--) break;
 	}
-	if (!win) return;
-	windowShow(win);
-	uiStatus();
-	uiPrompt(false);
+	if (win) uiShowWindow(win);
 }
 
 static void uiShowAuto(void) {
@@ -379,9 +383,7 @@ static void uiShowAuto(void) {
 		if (!unread && hot->unread) unread = hot;
 	}
 	if (!hot && !unread) return;
-	windowShow(hot ? hot : unread);
-	uiStatus();
-	uiPrompt(false);
+	uiShowWindow(hot ? hot : unread);
 }
 
 void uiCloseTag(struct Tag tag) {
@@ -465,6 +467,7 @@ static void keyMeta(wchar_t ch) {
 	struct Window *win = windows.active;
 	if (ch >= L'0' && ch <= L'9') uiShowNum(ch - L'0', false);
 	if (ch == L'a') uiShowAuto();
+	if (ch == L'/' && windows.other) uiShowWindow(windows.other);
 	if (!win) return;
 	switch (ch) {
 		break; case L'b':  edit(win->tag, EditBackWord, 0);
09Remove extended-join and invite-notifyJune McEnroe The remaining caps only generate new commands which can easily be filtered out when sending to clients so will be in the first pass of support. extended-join is probably safe to pass through unaltered, just causing extraneous parameters on JOIN commands, but maybe not. invite-notify reuses the INVITE command where the invited user is not self. 2019-11-09Maintain stateCaps and offer them to clientsJune McEnroe 2019-11-09Parse capabilitiesJune McEnroe The list that I've defined are the ones that I expect to be able to enable probably without any clients breaking... And of course server-time which pounce implements itself. 2019-11-09Avoid the reserved _A names with BIT macroJune McEnroe 2019-11-09Define macro for bit flag enumsJune McEnroe 2019-11-08Check that password is hashedJune McEnroe 2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever. 2019-11-08Only change AWAY status for registered clientsJune McEnroe Turns out I did eventually fix this, because I may want to implement "passive clients" for logging or notification stuff, which wouldn't affect AWAY status either. 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe This might reduce the frequency of a client getting its own message back because it was behind in the ring when it sent it. 2019-11-06Use -l:filename in Linux.mkJune McEnroe 2019-11-06Fix compat.h for #defined strlcpyJune McEnroe 2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe 2019-11-06Document calico service configurationJune McEnroe 2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe 2019-11-06Document pounce service configurationJune McEnroe 2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe 2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe 2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe