+2014-06-19 Benno Schulenberg <bensberg@justemail.net>
+ * src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()'
+ for consistency, and tweak the related comments.
+
2014-06-18 Benno Schulenberg <bensberg@justemail.net>
* src/text.c: Rename 'to_end' to 'to_eof', to lessen confusion
with CUT_TO_END (which is about cutting to end-of-line).
void window_init(void)
{
/* If the screen height is too small, get out. */
- editwinrows = LINES - 5 + no_more_space() + no_help();
+ editwinrows = LINES - 5 + more_space() + no_help();
if (COLS < MIN_EDITOR_COLS || editwinrows < MIN_EDITOR_ROWS)
die(_("Window size is too small for nano...\n"));
delwin(bottomwin);
/* Set up the windows. */
- topwin = newwin(2 - no_more_space(), COLS, 0, 0);
- edit = newwin(editwinrows, COLS, 2 - no_more_space(), 0);
+ topwin = newwin(2 - more_space(), COLS, 0, 0);
+ edit = newwin(editwinrows, COLS, 2 - more_space(), 0);
bottomwin = newwin(3 - no_help(), COLS, editwinrows + (2 -
- no_more_space()), 0);
+ more_space()), 0);
/* Turn the keypad on for the windows, if necessary. */
if (!ISSET(REBIND_KEYPAD)) {
}
/* Return 1 if the MORE_SPACE flag is set, and 0 otherwise. This is
- * used to calculate the relative screen position while taking this flag
- * into account, since it adds one line to the edit window. */
-int no_more_space(void)
+ * used to calculate the sizes and Y coordinates of the subwindows. */
+int more_space(void)
{
return ISSET(MORE_SPACE) ? 1 : 0;
}
/* Return 2 if the NO_HELP flag is set, and 0 otherwise. This is used
- * to calculate the relative screen position while taking this flag into
- * account, since it removes two lines from the edit window. */
+ * to calculate the sizes and Y coordinates of the subwindows, because
+ * having NO_HELP adds two lines to the edit window. */
int no_help(void)
{
return ISSET(NO_HELP) ? 2 : 0;