diff --git a/src/nano.c b/src/nano.c index 2efdcbd5..d4717e7e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -411,10 +411,6 @@ void window_init(void) int toprows = ((ISSET(EMPTY_LINE) && LINES > 5) ? 2 : 1); int bottomrows = ((ISSET(NO_HELP) || LINES < 5) ? 1 : 3); -#ifndef NANO_TINY - if (ISSET(MINIBAR)) - toprows = 0; -#endif editwinrows = LINES - toprows - bottomrows; /* Set up the normal three subwindows. */ diff --git a/src/winio.c b/src/winio.c index 5f5cad82..89729fa7 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1968,7 +1968,7 @@ void titlebar(const char *path) /* The buffer sequence number plus the total buffer count. */ /* If the screen is too small, there is no title bar. */ - if (topwin == NULL) + if (topwin == NULL || ISSET(MINIBAR)) return; wattron(topwin, interface_color_pair[TITLE_BAR]); @@ -2118,8 +2118,8 @@ void minibar(void) #endif /* Draw a colored bar over the full width of the screen. */ - wattron(bottomwin, interface_color_pair[MINI_INFOBAR]); - mvwprintw(bottomwin, 0, 0, "%*s", COLS, " "); + wattron(topwin, interface_color_pair[MINI_INFOBAR]); + mvwprintw(topwin, 0, 0, "%*s", COLS, " "); if (openfile->filename[0] != '\0') { as_an_at = FALSE; @@ -2140,12 +2140,12 @@ void minibar(void) if (COLS > 4) { if (namewidth > COLS - 2) { thename = display_string(thename, namewidth - COLS + 5, COLS - 5, FALSE, FALSE); - mvwaddstr(bottomwin, 0, 0, "..."); - waddstr(bottomwin, thename); + mvwaddstr(topwin, 0, 0, "..."); + waddstr(topwin, thename); } else - mvwaddstr(bottomwin, 0, padding, thename); + mvwaddstr(topwin, 0, padding, thename); - waddstr(bottomwin, openfile->modified ? " *" : " "); + waddstr(topwin, openfile->modified ? " *" : " "); } /* Right after reading or writing a file, display its number of lines; @@ -2157,7 +2157,7 @@ void minibar(void) sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count); tallywidth = breadth(number_of_lines); if (namewidth + tallywidth + 11 < COLS) - waddstr(bottomwin, number_of_lines); + waddstr(topwin, number_of_lines); else tallywidth = 0; report_size = FALSE; @@ -2167,13 +2167,13 @@ void minibar(void) ranking = nmalloc(24); sprintf(ranking, " [%i/%i]", buffer_number(openfile), buffer_number(startfile->prev)); if (namewidth + placewidth + breadth(ranking) + 32 < COLS) - waddstr(bottomwin, ranking); + waddstr(topwin, ranking); } #endif /* Display the line/column position of the cursor. */ if (ISSET(CONSTANT_SHOW) && namewidth + tallywidth + placewidth + 32 < COLS) - mvwaddstr(bottomwin, 0, COLS - 27 - placewidth, location); + mvwaddstr(topwin, 0, COLS - 27 - placewidth, location); /* Display the hexadecimal code of the character under the cursor, * plus the codes of up to two succeeding zero-width characters. */ @@ -2197,7 +2197,7 @@ void minibar(void) else sprintf(hexadecimal, " 0x%02X", (unsigned char)*this_position); - mvwaddstr(bottomwin, 0, COLS - 23, hexadecimal); + mvwaddstr(topwin, 0, COLS - 23, hexadecimal); #ifdef ENABLE_UTF8 successor = this_position + char_length(this_position); @@ -2205,13 +2205,13 @@ void minibar(void) if (*this_position && *successor && is_zerowidth(successor) && mbtowide(&widecode, successor) > 0) { sprintf(hexadecimal, "|%04X", (int)widecode); - waddstr(bottomwin, hexadecimal); + waddstr(topwin, hexadecimal); successor += char_length(successor); if (is_zerowidth(successor) && mbtowide(&widecode, successor) > 0) { sprintf(hexadecimal, "|%04X", (int)widecode); - waddstr(bottomwin, hexadecimal); + waddstr(topwin, hexadecimal); } } else successor = NULL; @@ -2220,18 +2220,18 @@ void minibar(void) /* Display the state of three flags, and the state of macro and mark. */ if (ISSET(STATEFLAGS) && !successor && namewidth + tallywidth + 14 + 2 * padding < COLS) { - wmove(bottomwin, 0, COLS - 11 - padding); - show_states_at(bottomwin); + wmove(topwin, 0, COLS - 11 - padding); + show_states_at(topwin); } /* Display how many percent the current line is into the file. */ if (namewidth + 6 < COLS) { sprintf(location, "%3zi%%", 100 * openfile->current->lineno / openfile->filebot->lineno); - mvwaddstr(bottomwin, 0, COLS - 4 - padding, location); + mvwaddstr(topwin, 0, COLS - 4 - padding, location); } - wattroff(bottomwin, interface_color_pair[MINI_INFOBAR]); - wrefresh(bottomwin); + wattroff(topwin, interface_color_pair[MINI_INFOBAR]); + wrefresh(topwin); free(number_of_lines); free(hexadecimal);