From 45efe28f05461f1e4ce58e913b6e29a3f94aacc3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 30 Dec 2020 19:01:35 +0100 Subject: [PATCH] minibar: drop the side spaces before suppressing the state flags Also, consistently keep the right-side elements at least two spaces away from the modification asterisk. --- src/winio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/winio.c b/src/winio.c index 472cbf33..9ed6824a 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2092,7 +2092,8 @@ void minibar(void) placewidth = strlen(location); namewidth = breadth(thename); - if (COLS < 12 || namewidth > COLS - 11) + /* If the file name is relatively long, drop the side spaces. */ + if (namewidth + 19 > COLS) padding = 0; if (COLS > 4) { @@ -2133,7 +2134,7 @@ void minibar(void) mvwaddstr(bottomwin, 0, COLS - 27 - placewidth, location); /* Display the hexadecimal code of the character under the cursor. */ - if (namewidth + tallywidth + 27 < COLS) { + if (namewidth + tallywidth + 28 < COLS) { char *thisline = openfile->current->data; if (thisline[openfile->current_x] == '\0') @@ -2150,8 +2151,8 @@ void minibar(void) } /* Display the state of three flags, and the state of macro and mark. */ - if (namewidth + tallywidth + 18 < COLS) { - wmove(bottomwin, 0, COLS - 13); + if (namewidth + tallywidth + 14 + 2 * padding < COLS) { + wmove(bottomwin, 0, COLS - 11 - padding); show_states_at(bottomwin); }