From 5778ecac27a763bc19ef52b5b99c8cc06bb0fa7b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 15 Mar 2026 02:52:25 -0400 Subject: Start+A searches from right to left (so [server] isn't constantly coming up). --- TODO | 3 --- src/irc.c | 12 +++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 083d3e2..19a5f6e 100644 --- a/TODO +++ b/TODO @@ -13,9 +13,6 @@ FujiChat features, we're almost at parity! Other stuff: - Start+E: show entire editbox (plus status, but not screen text). -- Make Start+A search backwards (from screen 7), since [server] - is the least interesting screen (we don't want it constantly - coming up first). - Server /ping command is iffy (see do_server_pong() in irc.c). - Bug: *no idea* how this happened. I typed /quit, then reconnected, and got "USER: not enough parameters" from the server. Can't diff --git a/src/irc.c b/src/irc.c index 7464dd9..49eea56 100644 --- a/src/irc.c +++ b/src/irc.c @@ -782,10 +782,12 @@ static char cur_is_query(void) { } */ -char find_scr(int status) { - char i; +/* count backwards here, because the [server] screen is 0, it's + the least interesting one. */ +char find_scr_with_status(int status) { + signed char i; - for(i = 0; i < MAX_SCREENS; i++) { + for(i = MAX_SCREENS - 1; i != -1; i--) { if(scr_status[i] == status) { return i; } @@ -796,9 +798,9 @@ char find_scr(int status) { void switch_to_active() { char i; - i = find_scr(SCR_HILITE); + i = find_scr_with_status(SCR_HILITE); if(i == 0xff) - i = find_scr(SCR_ACTIVE); + i = find_scr_with_status(SCR_ACTIVE); if(i != 0xff) { scr_prev = scr_current; scr_display(i); -- cgit v1.2.3