about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ui.c b/ui.c
index 4435a52..53e4a19 100644
--- a/ui.c
+++ b/ui.c
@@ -102,6 +102,7 @@ static struct {
 	uint len;
 	uint show;
 	uint swap;
+	uint user;
 } windows;
 
 static uint windowPush(struct Window *window) {
@@ -825,6 +826,7 @@ static void windowShow(uint num) {
 	touchwin(windows.ptrs[num]->pad);
 	windows.swap = windows.show;
 	windows.show = num;
+	windows.user = num;
 	mark(windows.ptrs[windows.swap]);
 	unmark(windows.ptrs[windows.show]);
 	inputUpdate();
@@ -877,10 +879,6 @@ static void toggleIgnore(struct Window *window) {
 }
 
 static void showAuto(void) {
-	static uint swap;
-	if (windows.swap != swap) {
-		swap = windows.show;
-	}
 	uint minHot = UINT_MAX, numHot;
 	uint minWarm = UINT_MAX, numWarm;
 	for (uint num = 0; num < windows.len; ++num) {
@@ -896,14 +894,15 @@ static void showAuto(void) {
 			numWarm = num;
 		}
 	}
+	uint user = windows.user;
 	if (minHot < UINT_MAX) {
 		windowShow(numHot);
-		windows.swap = swap;
+		windows.user = user;
 	} else if (minWarm < UINT_MAX) {
 		windowShow(numWarm);
-		windows.swap = swap;
+		windows.user = user;
 	} else {
-		windowShow(windows.swap);
+		windowShow(user);
 	}
 }
 
l output. Big win! 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe This fixes badly indented comments. 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe