aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-27 04:29:24 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-27 04:29:24 -0400
commite673118ae3b3779f56fa9a99bbae9a677717f5db (patch)
tree781d35704fcd9c7e184a3ed123ffc7ade2337bc5 /src
parent4f31140995b95672100d3ffa8158fe4a30b22ca9 (diff)
downloadfujinet-chat-e673118ae3b3779f56fa9a99bbae9a677717f5db.tar.gz
Clean up status bar some, stop double-spacing.
Diffstat (limited to 'src')
-rw-r--r--src/cmd.c16
-rw-r--r--src/screen.c13
2 files changed, 19 insertions, 10 deletions
diff --git a/src/cmd.c b/src/cmd.c
index 43f9fbe..154feaf 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -484,20 +484,26 @@ static void do_pool(void) {
int count;
for(p = 0; p < MAX_POOLS; p++) {
- if(pools[p].screen_count == POOL_UNUSED)
+ scr_print_current("Pool ");
+ scr_cur_printnum(p);
+ if(pools[p].screen_count == POOL_UNUSED) {
+ scr_print_current(" unused\n");
break;
+ }
count = 0;
l = pools[p].free_list;
- while(l != (line_t *)END_MARKER)
+ while(l != (line_t *)END_MARKER) {
+ l = l->next;
count++;
+ }
- scr_print_current("Pool ");
- scr_cur_printnum(p);
scr_print_current(" has ");
scr_cur_printnum(count);
- scr_print_current("lines\n");
+ scr_print_current(" free lines, ");
+ scr_cur_printnum(pools[p].screen_count);
+ scr_print_current(" screens\n");
}
}
#endif
diff --git a/src/screen.c b/src/screen.c
index 1bd239a..13e0cfc 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -143,17 +143,19 @@ void scr_show_status(char s) {
int i;
char *p, sc;
- status_box[0] = (s % 10) + 177; /* inverse number */
+ // status_box[0] = (s % 10) + 177; /* inverse number */
+ if(s > 8) s -= 8; /* 9 => 0, 10 => 1, etc */
+ status_box[0] = s + 177;
status_box[1] = ':';
strncpy(status_box + 2, screens[s].title, 32);
p = status_box + 43; /* one space past the 2nd indicator */
+ memclear(status_box + 43, 17);
+
for(i = 0; i < MAX_SCREENS; i++) {
sc = (i % 10) + '1';
switch(screens[i].status) {
- case SCR_INACTIVE: /* color0 */
- break;
case SCR_ACTIVE: /* color1 */
sc |= 0x40;
break;
@@ -163,8 +165,9 @@ void scr_show_status(char s) {
case SCR_HILITE: /* color3 */
sc |= 0xc0;
break;
+ case SCR_INACTIVE:
default:
- continue; /* don't show anything for unused */
+ continue; /* don't show anything for inactive or unused */
}
*p++ = sc;
}
@@ -228,7 +231,7 @@ void scr_putc(char s, char c) {
return;
}
- if(xpos == 0 || xpos == LINE_LEN) {
+ if(screens[s].line_list == (line_t *)END_MARKER || xpos == LINE_LEN) {
add_line(s);
xpos = 0;
}