Commit 8328fc24 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

properly account for padding in titlebar()

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1767 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Showing with 12 additions and 10 deletions
+12 -10
...@@ -263,11 +263,11 @@ CVS code - ...@@ -263,11 +263,11 @@ CVS code -
- Overhaul to use display_string() to display the filename, and - Overhaul to use display_string() to display the filename, and
to better handle shorter screen widths. Also remove to better handle shorter screen widths. Also remove
now-unneeded wrefresh(topwin) calls. (David Benbennick) now-unneeded wrefresh(topwin) calls. (David Benbennick)
DLR: Tweak to reserve enough space for "Modified" in all DLR: Tweak to reserve enough space for "Modified", plus
cases, to make sure that the version message takes up no more padding, in all cases, to make sure that the version message
more than 1/3 of the available width, and to include a takes up no more more than 1/3 of the available width, minus
reset_cursor() call so that the cursor is always in the right padding, and to include a reset_cursor() call so that the
place. cursor is always in the right place.
bottombars() bottombars()
- Call blank_bottombars() instead of blank_bottomwin(). (David - Call blank_bottombars() instead of blank_bottomwin(). (David
Benbennick) Benbennick)
......
...@@ -1556,14 +1556,16 @@ void titlebar(const char *path) ...@@ -1556,14 +1556,16 @@ void titlebar(const char *path)
space = 0; space = 0;
else { else {
space = COLS - 5 - verlen; space = COLS - 5 - verlen;
/* Reserve 2/3 of the screen for after the version message. */ /* Reserve 2/3 of the screen plus one column for after the
if (space < COLS - (COLS / 3)) * version message. */
space = COLS - (COLS / 3); if (space < COLS - (COLS / 3) + 1)
space = COLS - (COLS / 3) + 1;
} }
if (COLS > 4) { if (COLS > 4) {
/* The version message should only take up 1/3 of the screen. */ /* The version message should only take up 1/3 of the screen
mvwaddnstr(topwin, 0, 2, VERMSG, COLS / 3); * minus one column. */
mvwaddnstr(topwin, 0, 2, VERMSG, (COLS / 3) - 3);
waddstr(topwin, " "); waddstr(topwin, " ");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment