summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui.c b/ui.c
index d69e706..6a834cd 100644
--- a/ui.c
+++ b/ui.c
@@ -362,16 +362,20 @@ static void statusUpdate(void) {
 	putp(from_status_line);
 }
 
+static void unmark(void) {
+	windows.active->heat = Cold;
+	windows.active->unread = 0;
+	windows.active->mark = false;
+	statusUpdate();
+}
+
 void uiShowID(size_t id) {
-	windows.active->mark = true;
 	struct Window *window = windowFor(id);
-	window->heat = Cold;
-	window->unread = 0;
-	window->mark = false;
+	touchwin(window->pad);
 	windows.other = windows.active;
 	windows.active = window;
-	touchwin(window->pad);
-	statusUpdate();
+	windows.other->mark = true;
+	unmark();
 }
 
 void uiWrite(size_t id, enum Heat heat, const time_t *time, const char *str) {
@@ -403,7 +407,7 @@ void uiFormat(
 static void keyCode(int code) {
 	switch (code) {
 		break; case KEY_RESIZE:; // TODO
-		break; case KeyFocusIn:; // TODO
+		break; case KeyFocusIn:  unmark();
 		break; case KeyFocusOut: windows.active->mark = true;
 		break; case KeyPasteOn:; // TODO
 		break; case KeyPasteOff:; // TODO
d>June McEnroe 2019-01-13Document PSlitJune McEnroe 2019-01-13Document PS0June McEnroe 2019-01-13Set PS0 in cashJune McEnroe 2019-01-13Add PS0June McEnroe 2019-01-13Change default ENV from cashrc to env.shJune McEnroe 2019-01-13Use colours in cash promptsJune McEnroe 2019-01-12Set PSlit like NetBSD shJune McEnroe 2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe 2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe 2019-01-12Restore cash builtin man page datesJune McEnroe 2019-01-12Use local libeditJune McEnroe 2019-01-12Replace libedit MakefileJune McEnroe 2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe 2019-01-11Add PSlit for prompt escapesJune McEnroe 2019-01-11Don't make depend automaticallyJune McEnroe