diff --git a/src/nano.h b/src/nano.h index f811f338..7a9e0083 100644 --- a/src/nano.h +++ b/src/nano.h @@ -563,7 +563,7 @@ enum #define MAIN_VISIBLE (((COLS + 40) / 20) * 2) /* The minimum editor window columns and rows required for nano to work - * correctly. */ + * correctly. Don't make these smaller than 4 and 1. */ #define MIN_EDITOR_COLS 4 #define MIN_EDITOR_ROWS 1 diff --git a/src/winio.c b/src/winio.c index 669a3071..c07ebae6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1980,27 +1980,18 @@ void titlebar(const char *path) blank_titlebar(); - /* space has to be at least 4: two spaces before the version message, - * at least one character of the version message, and one space - * after the version message. */ - if (space < 4) - space = 0; - else { - /* Limit verlen to 1/3 the length of the screen in columns, - * minus three columns for spaces. */ - if (verlen > (COLS / 3) - 3) - verlen = (COLS / 3) - 3; - } + /* Limit the length of the version message to a third of the width of + * the screen, minus three columns for spaces. */ + if (verlen > (COLS / 3) - 3) + verlen = (COLS / 3) - 3; - if (space >= 4) { - /* Add a space after the version message, and account for both - * it and the two spaces before it. */ - mvwaddnstr(topwin, 0, 2, BRANDING, actual_x(BRANDING, verlen)); - verlen += 3; + /* Leave two spaces before the version message, and account also + * for the space after it. */ + mvwaddnstr(topwin, 0, 2, BRANDING, actual_x(BRANDING, verlen)); + verlen += 3; - /* Account for the full length of the version message. */ - space -= verlen; - } + /* Account for the full length of the version message. */ + space -= verlen; #ifndef DISABLE_BROWSER /* Don't display the state if we're in the file browser. */