aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-15 02:52:25 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-15 02:52:25 -0400
commit5778ecac27a763bc19ef52b5b99c8cc06bb0fa7b (patch)
treee3979fd82c0fe5d2ae688c336a6df232e8a49f76
parentde94023547c353fccbe5d39a021d78761a6dd31f (diff)
downloadfujinet-chat-5778ecac27a763bc19ef52b5b99c8cc06bb0fa7b.tar.gz
Start+A searches from right to left (so [server] isn't constantly coming up).
-rw-r--r--TODO3
-rw-r--r--src/irc.c12
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);