tweaks: rename another variable, to better fit in with its sisters
This commit is contained in:
parent
a24e72f972
commit
c28048d20f
@ -121,9 +121,9 @@ WINDOW *topwin = NULL;
|
|||||||
WINDOW *midwin = NULL;
|
WINDOW *midwin = NULL;
|
||||||
/* The middle portion of the screen: the edit window, showing the
|
/* The middle portion of the screen: the edit window, showing the
|
||||||
* contents of the current buffer, the file we are editing. */
|
* contents of the current buffer, the file we are editing. */
|
||||||
WINDOW *bottomwin = NULL;
|
WINDOW *footwin = NULL;
|
||||||
/* The bottom portion of the screen, where we display statusbar
|
/* The bottom portion of the screen, where status-bar messages,
|
||||||
* messages, the status-bar prompt, and a list of shortcuts. */
|
* the status-bar prompt, and a list of shortcuts are shown. */
|
||||||
int editwinrows = 0;
|
int editwinrows = 0;
|
||||||
/* How many rows does the edit window take up? */
|
/* How many rows does the edit window take up? */
|
||||||
int editwincols = -1;
|
int editwincols = -1;
|
||||||
|
|||||||
18
src/nano.c
18
src/nano.c
@ -243,14 +243,14 @@ void finish(void)
|
|||||||
/* Blank the status bar and (if applicable) the shortcut list. */
|
/* Blank the status bar and (if applicable) the shortcut list. */
|
||||||
blank_statusbar();
|
blank_statusbar();
|
||||||
blank_bottombars();
|
blank_bottombars();
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Deallocate the two or three subwindows. */
|
/* Deallocate the two or three subwindows. */
|
||||||
if (topwin != NULL)
|
if (topwin != NULL)
|
||||||
delwin(topwin);
|
delwin(topwin);
|
||||||
delwin(midwin);
|
delwin(midwin);
|
||||||
delwin(bottomwin);
|
delwin(footwin);
|
||||||
#endif
|
#endif
|
||||||
/* Switch the cursor on, exit from curses, and restore terminal settings. */
|
/* Switch the cursor on, exit from curses, and restore terminal settings. */
|
||||||
restore_terminal();
|
restore_terminal();
|
||||||
@ -407,7 +407,7 @@ void window_init(void)
|
|||||||
if (topwin != NULL)
|
if (topwin != NULL)
|
||||||
delwin(topwin);
|
delwin(topwin);
|
||||||
delwin(midwin);
|
delwin(midwin);
|
||||||
delwin(bottomwin);
|
delwin(footwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
topwin = NULL;
|
topwin = NULL;
|
||||||
@ -418,7 +418,7 @@ void window_init(void)
|
|||||||
/* Set up two subwindows. If the terminal is just one line,
|
/* Set up two subwindows. If the terminal is just one line,
|
||||||
* edit window and status-bar window will cover each other. */
|
* edit window and status-bar window will cover each other. */
|
||||||
midwin = newwin(editwinrows, COLS, 0, 0);
|
midwin = newwin(editwinrows, COLS, 0, 0);
|
||||||
bottomwin = newwin(1, COLS, LINES - 1, 0);
|
footwin = newwin(1, COLS, LINES - 1, 0);
|
||||||
} else {
|
} else {
|
||||||
int toprows = ((ISSET(EMPTY_LINE) && LINES > 6) ? 2 : 1);
|
int toprows = ((ISSET(EMPTY_LINE) && LINES > 6) ? 2 : 1);
|
||||||
int bottomrows = ((ISSET(NO_HELP) || LINES < 6) ? 1 : 3);
|
int bottomrows = ((ISSET(NO_HELP) || LINES < 6) ? 1 : 3);
|
||||||
@ -433,16 +433,16 @@ void window_init(void)
|
|||||||
if (toprows > 0)
|
if (toprows > 0)
|
||||||
topwin = newwin(toprows, COLS, 0, 0);
|
topwin = newwin(toprows, COLS, 0, 0);
|
||||||
midwin = newwin(editwinrows, COLS, toprows, 0);
|
midwin = newwin(editwinrows, COLS, toprows, 0);
|
||||||
bottomwin = newwin(bottomrows, COLS, LINES - bottomrows, 0);
|
footwin = newwin(bottomrows, COLS, LINES - bottomrows, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In case the terminal shrunk, make sure the status line is clear. */
|
/* In case the terminal shrunk, make sure the status line is clear. */
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
|
|
||||||
/* When not disabled, turn escape-sequence translation on. */
|
/* When not disabled, turn escape-sequence translation on. */
|
||||||
if (!ISSET(RAW_SEQUENCES)) {
|
if (!ISSET(RAW_SEQUENCES)) {
|
||||||
keypad(midwin, TRUE);
|
keypad(midwin, TRUE);
|
||||||
keypad(bottomwin, TRUE);
|
keypad(footwin, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLED_WRAPORJUSTIFY
|
#ifdef ENABLED_WRAPORJUSTIFY
|
||||||
@ -2558,8 +2558,8 @@ int main(int argc, char **argv)
|
|||||||
edit_scroll(FORWARD);
|
edit_scroll(FORWARD);
|
||||||
wnoutrefresh(midwin);
|
wnoutrefresh(midwin);
|
||||||
}
|
}
|
||||||
wredrawln(bottomwin, 0 ,1);
|
wredrawln(footwin, 0 ,1);
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
place_the_cursor();
|
place_the_cursor();
|
||||||
} else if (ISSET(ZERO) && lastmessage > VACUUM)
|
} else if (ISSET(ZERO) && lastmessage > VACUUM)
|
||||||
wredrawln(midwin, editwinrows - 1, 1);
|
wredrawln(midwin, editwinrows - 1, 1);
|
||||||
|
|||||||
60
src/prompt.c
60
src/prompt.c
@ -204,7 +204,7 @@ int do_statusbar_mouse(void)
|
|||||||
int retval = get_mouseinput(&click_row, &click_col, TRUE);
|
int retval = get_mouseinput(&click_row, &click_col, TRUE);
|
||||||
|
|
||||||
/* We can click on the status-bar window text to move the cursor. */
|
/* We can click on the status-bar window text to move the cursor. */
|
||||||
if (retval == 0 && wmouse_trafo(bottomwin, &click_row, &click_col, FALSE)) {
|
if (retval == 0 && wmouse_trafo(footwin, &click_row, &click_col, FALSE)) {
|
||||||
size_t start_col = breadth(prompt) + 2;
|
size_t start_col = breadth(prompt) + 2;
|
||||||
|
|
||||||
/* Move to where the click occurred. */
|
/* Move to where the click occurred. */
|
||||||
@ -240,7 +240,7 @@ void do_statusbar_verbatim_input(void)
|
|||||||
size_t count = 1;
|
size_t count = 1;
|
||||||
char *bytes;
|
char *bytes;
|
||||||
|
|
||||||
bytes = get_verbatim_kbinput(bottomwin, &count);
|
bytes = get_verbatim_kbinput(footwin, &count);
|
||||||
|
|
||||||
if (0 < count && count < 999)
|
if (0 < count && count < 999)
|
||||||
inject_into_answer(bytes, count);
|
inject_into_answer(bytes, count);
|
||||||
@ -266,7 +266,7 @@ int do_statusbar_input(bool *finished)
|
|||||||
*finished = FALSE;
|
*finished = FALSE;
|
||||||
|
|
||||||
/* Read in a character. */
|
/* Read in a character. */
|
||||||
input = get_kbinput(bottomwin, VISIBLE);
|
input = get_kbinput(footwin, VISIBLE);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (input == KEY_WINCH)
|
if (input == KEY_WINCH)
|
||||||
@ -278,7 +278,7 @@ int do_statusbar_input(bool *finished)
|
|||||||
* shortcut character. */
|
* shortcut character. */
|
||||||
if (input == KEY_MOUSE) {
|
if (input == KEY_MOUSE) {
|
||||||
if (do_statusbar_mouse() == 1)
|
if (do_statusbar_mouse() == 1)
|
||||||
input = get_kbinput(bottomwin, BLIND);
|
input = get_kbinput(footwin, BLIND);
|
||||||
else
|
else
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
@ -410,33 +410,33 @@ void draw_the_promptbar(void)
|
|||||||
end_page = get_statusbar_page_start(base, base + breadth(answer) - 1);
|
end_page = get_statusbar_page_start(base, base + breadth(answer) - 1);
|
||||||
|
|
||||||
/* Color the prompt bar over its full width. */
|
/* Color the prompt bar over its full width. */
|
||||||
wattron(bottomwin, interface_color_pair[PROMPT_BAR]);
|
wattron(footwin, interface_color_pair[PROMPT_BAR]);
|
||||||
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
|
mvwprintw(footwin, 0, 0, "%*s", COLS, " ");
|
||||||
|
|
||||||
mvwaddstr(bottomwin, 0, 0, prompt);
|
mvwaddstr(footwin, 0, 0, prompt);
|
||||||
waddch(bottomwin, ':');
|
waddch(footwin, ':');
|
||||||
waddch(bottomwin, (the_page == 0) ? ' ' : '<');
|
waddch(footwin, (the_page == 0) ? ' ' : '<');
|
||||||
|
|
||||||
expanded = display_string(answer, the_page, COLS - base, FALSE, TRUE);
|
expanded = display_string(answer, the_page, COLS - base, FALSE, TRUE);
|
||||||
waddstr(bottomwin, expanded);
|
waddstr(footwin, expanded);
|
||||||
free(expanded);
|
free(expanded);
|
||||||
|
|
||||||
if (the_page < end_page && base + breadth(answer) - the_page > COLS)
|
if (the_page < end_page && base + breadth(answer) - the_page > COLS)
|
||||||
mvwaddch(bottomwin, 0, COLS - 1, '>');
|
mvwaddch(footwin, 0, COLS - 1, '>');
|
||||||
|
|
||||||
wattroff(bottomwin, interface_color_pair[PROMPT_BAR]);
|
wattroff(footwin, interface_color_pair[PROMPT_BAR]);
|
||||||
|
|
||||||
#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH < 20210220)
|
#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH < 20210220)
|
||||||
/* Work around a cursor-misplacement bug -- https://sv.gnu.org/bugs/?59808. */
|
/* Work around a cursor-misplacement bug -- https://sv.gnu.org/bugs/?59808. */
|
||||||
if (ISSET(NO_HELP)) {
|
if (ISSET(NO_HELP)) {
|
||||||
wmove(bottomwin, 0, 0);
|
wmove(footwin, 0, 0);
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Place the cursor at the right spot. */
|
/* Place the cursor at the right spot. */
|
||||||
wmove(bottomwin, 0, column - the_page);
|
wmove(footwin, 0, column - the_page);
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
@ -689,34 +689,34 @@ int ask_user(bool withall, const char *question)
|
|||||||
|
|
||||||
/* Now show the ones for "Yes", "No", "Cancel" and maybe "All". */
|
/* Now show the ones for "Yes", "No", "Cancel" and maybe "All". */
|
||||||
sprintf(shortstr, " %c", yesstr[0]);
|
sprintf(shortstr, " %c", yesstr[0]);
|
||||||
wmove(bottomwin, 1, 0);
|
wmove(footwin, 1, 0);
|
||||||
post_one_key(shortstr, _("Yes"), width);
|
post_one_key(shortstr, _("Yes"), width);
|
||||||
|
|
||||||
shortstr[1] = nostr[0];
|
shortstr[1] = nostr[0];
|
||||||
wmove(bottomwin, 2, 0);
|
wmove(footwin, 2, 0);
|
||||||
post_one_key(shortstr, _("No"), width);
|
post_one_key(shortstr, _("No"), width);
|
||||||
|
|
||||||
if (withall) {
|
if (withall) {
|
||||||
shortstr[1] = allstr[0];
|
shortstr[1] = allstr[0];
|
||||||
wmove(bottomwin, 1, width);
|
wmove(footwin, 1, width);
|
||||||
post_one_key(shortstr, _("All"), width);
|
post_one_key(shortstr, _("All"), width);
|
||||||
}
|
}
|
||||||
|
|
||||||
wmove(bottomwin, 2, width);
|
wmove(footwin, 2, width);
|
||||||
post_one_key(cancelshortcut->keystr, _("Cancel"), width);
|
post_one_key(cancelshortcut->keystr, _("Cancel"), width);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Color the prompt bar over its full width and display the question. */
|
/* Color the prompt bar over its full width and display the question. */
|
||||||
wattron(bottomwin, interface_color_pair[PROMPT_BAR]);
|
wattron(footwin, interface_color_pair[PROMPT_BAR]);
|
||||||
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
|
mvwprintw(footwin, 0, 0, "%*s", COLS, " ");
|
||||||
mvwaddnstr(bottomwin, 0, 0, question, actual_x(question, COLS - 1));
|
mvwaddnstr(footwin, 0, 0, question, actual_x(question, COLS - 1));
|
||||||
wattroff(bottomwin, interface_color_pair[PROMPT_BAR]);
|
wattroff(footwin, interface_color_pair[PROMPT_BAR]);
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
|
|
||||||
currmenu = MYESNO;
|
currmenu = MYESNO;
|
||||||
|
|
||||||
/* When not replacing, show the cursor while waiting for a key. */
|
/* When not replacing, show the cursor while waiting for a key. */
|
||||||
kbinput = get_kbinput(bottomwin, !withall);
|
kbinput = get_kbinput(footwin, !withall);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (kbinput == KEY_WINCH)
|
if (kbinput == KEY_WINCH)
|
||||||
@ -724,7 +724,7 @@ int ask_user(bool withall, const char *question)
|
|||||||
|
|
||||||
/* Accept the first character of an external paste. */
|
/* Accept the first character of an external paste. */
|
||||||
if (bracketed_paste && kbinput == BRACKETED_PASTE_MARKER)
|
if (bracketed_paste && kbinput == BRACKETED_PASTE_MARKER)
|
||||||
kbinput = get_kbinput(bottomwin, BLIND);
|
kbinput = get_kbinput(footwin, BLIND);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
@ -736,7 +736,7 @@ int ask_user(bool withall, const char *question)
|
|||||||
int extras = (kbinput / 16) % 4 + (kbinput <= 0xCF ? 1 : 0);
|
int extras = (kbinput / 16) % 4 + (kbinput <= 0xCF ? 1 : 0);
|
||||||
|
|
||||||
while (extras <= waiting_keycodes() && extras-- > 0)
|
while (extras <= waiting_keycodes() && extras-- > 0)
|
||||||
letter[index++] = (unsigned char)get_kbinput(bottomwin, !withall);
|
letter[index++] = (unsigned char)get_kbinput(footwin, !withall);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
letter[index] = '\0';
|
letter[index] = '\0';
|
||||||
@ -769,7 +769,7 @@ int ask_user(bool withall, const char *question)
|
|||||||
int mouse_x, mouse_y;
|
int mouse_x, mouse_y;
|
||||||
/* We can click on the Yes/No/All shortcuts to select an answer. */
|
/* We can click on the Yes/No/All shortcuts to select an answer. */
|
||||||
if (get_mouseinput(&mouse_y, &mouse_x, FALSE) == 0 &&
|
if (get_mouseinput(&mouse_y, &mouse_x, FALSE) == 0 &&
|
||||||
wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE) &&
|
wmouse_trafo(footwin, &mouse_y, &mouse_x, FALSE) &&
|
||||||
mouse_x < (width * 2) && mouse_y > 0) {
|
mouse_x < (width * 2) && mouse_y > 0) {
|
||||||
int x = mouse_x / width;
|
int x = mouse_x / width;
|
||||||
int y = mouse_y - 1;
|
int y = mouse_y - 1;
|
||||||
@ -800,7 +800,7 @@ int ask_user(bool withall, const char *question)
|
|||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Ignore the rest of an external paste. */
|
/* Ignore the rest of an external paste. */
|
||||||
while (bracketed_paste)
|
while (bracketed_paste)
|
||||||
kbinput = get_kbinput(bottomwin, BLIND);
|
kbinput = get_kbinput(footwin, BLIND);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ extern size_t wrap_at;
|
|||||||
|
|
||||||
extern WINDOW *topwin;
|
extern WINDOW *topwin;
|
||||||
extern WINDOW *midwin;
|
extern WINDOW *midwin;
|
||||||
extern WINDOW *bottomwin;
|
extern WINDOW *footwin;
|
||||||
extern int editwinrows;
|
extern int editwinrows;
|
||||||
extern int editwincols;
|
extern int editwincols;
|
||||||
extern int margin;
|
extern int margin;
|
||||||
|
|||||||
@ -2820,7 +2820,7 @@ void do_linter(void)
|
|||||||
place_the_cursor();
|
place_the_cursor();
|
||||||
wnoutrefresh(midwin);
|
wnoutrefresh(midwin);
|
||||||
|
|
||||||
kbinput = get_kbinput(bottomwin, VISIBLE);
|
kbinput = get_kbinput(footwin, VISIBLE);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (kbinput == KEY_WINCH)
|
if (kbinput == KEY_WINCH)
|
||||||
|
|||||||
104
src/winio.c
104
src/winio.c
@ -1507,7 +1507,7 @@ char *get_verbatim_kbinput(WINDOW *frame, size_t *count)
|
|||||||
* the data that the frame parameter points to. */
|
* the data that the frame parameter points to. */
|
||||||
if (!ISSET(RAW_SEQUENCES)) {
|
if (!ISSET(RAW_SEQUENCES)) {
|
||||||
keypad(midwin, TRUE);
|
keypad(midwin, TRUE);
|
||||||
keypad(bottomwin, TRUE);
|
keypad(footwin, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*count < 999) {
|
if (*count < 999) {
|
||||||
@ -1543,7 +1543,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
in_editwin = wenclose(midwin, event.y, event.x);
|
in_editwin = wenclose(midwin, event.y, event.x);
|
||||||
in_bottomwin = wenclose(bottomwin, event.y, event.x);
|
in_bottomwin = wenclose(footwin, event.y, event.x);
|
||||||
|
|
||||||
/* Save the screen coordinates where the mouse event took place. */
|
/* Save the screen coordinates where the mouse event took place. */
|
||||||
*mouse_x = event.x - (in_editwin ? margin : 0);
|
*mouse_x = event.x - (in_editwin ? margin : 0);
|
||||||
@ -1564,8 +1564,8 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
|
|||||||
size_t number;
|
size_t number;
|
||||||
/* The number of shortcut items that get displayed. */
|
/* The number of shortcut items that get displayed. */
|
||||||
|
|
||||||
/* Translate the coordinates to become relative to bottomwin. */
|
/* Shift the coordinates to be relative to the bottom window. */
|
||||||
wmouse_trafo(bottomwin, mouse_y, mouse_x, FALSE);
|
wmouse_trafo(footwin, mouse_y, mouse_x, FALSE);
|
||||||
|
|
||||||
/* Clicks on the status bar are handled elsewhere, so
|
/* Clicks on the status bar are handled elsewhere, so
|
||||||
* restore the untranslated mouse-event coordinates. */
|
* restore the untranslated mouse-event coordinates. */
|
||||||
@ -1615,7 +1615,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
/* Clicks outside of bottomwin are handled elsewhere. */
|
/* Clicks outside of the bottom window are handled elsewhere. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if NCURSES_MOUSE_VERSION >= 2
|
#if NCURSES_MOUSE_VERSION >= 2
|
||||||
@ -1626,8 +1626,8 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
|
|||||||
bool in_edit = wenclose(midwin, *mouse_y, *mouse_x);
|
bool in_edit = wenclose(midwin, *mouse_y, *mouse_x);
|
||||||
|
|
||||||
if (in_bottomwin)
|
if (in_bottomwin)
|
||||||
/* Translate the coordinates to become relative to bottomwin. */
|
/* Shift the coordinates to be relative to the bottom window. */
|
||||||
wmouse_trafo(bottomwin, mouse_y, mouse_x, FALSE);
|
wmouse_trafo(footwin, mouse_y, mouse_x, FALSE);
|
||||||
|
|
||||||
if (in_edit || (in_bottomwin && *mouse_y == 0)) {
|
if (in_edit || (in_bottomwin && *mouse_y == 0)) {
|
||||||
int keycode = (event.bstate & BUTTON4_PRESSED) ? KEY_UP : KEY_DOWN;
|
int keycode = (event.bstate & BUTTON4_PRESSED) ? KEY_UP : KEY_DOWN;
|
||||||
@ -1671,7 +1671,7 @@ void blank_edit(void)
|
|||||||
/* Blank the first line of the bottom portion of the screen. */
|
/* Blank the first line of the bottom portion of the screen. */
|
||||||
void blank_statusbar(void)
|
void blank_statusbar(void)
|
||||||
{
|
{
|
||||||
blank_row(bottomwin, 0);
|
blank_row(footwin, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wipe the status bar clean and include this in the next screen update. */
|
/* Wipe the status bar clean and include this in the next screen update. */
|
||||||
@ -1682,16 +1682,16 @@ void wipe_statusbar(void)
|
|||||||
if (ISSET(ZERO) || ISSET(MINIBAR) || LINES == 1)
|
if (ISSET(ZERO) || ISSET(MINIBAR) || LINES == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
blank_row(bottomwin, 0);
|
blank_row(footwin, 0);
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Blank out the two help lines (when they are present). */
|
/* Blank out the two help lines (when they are present). */
|
||||||
void blank_bottombars(void)
|
void blank_bottombars(void)
|
||||||
{
|
{
|
||||||
if (!ISSET(NO_HELP) && LINES > 5) {
|
if (!ISSET(NO_HELP) && LINES > 5) {
|
||||||
blank_row(bottomwin, 1);
|
blank_row(footwin, 1);
|
||||||
blank_row(bottomwin, 2);
|
blank_row(footwin, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2117,8 +2117,8 @@ void minibar(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Draw a colored bar over the full width of the screen. */
|
/* Draw a colored bar over the full width of the screen. */
|
||||||
wattron(bottomwin, interface_color_pair[MINI_INFOBAR]);
|
wattron(footwin, interface_color_pair[MINI_INFOBAR]);
|
||||||
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
|
mvwprintw(footwin, 0, 0, "%*s", COLS, " ");
|
||||||
|
|
||||||
if (openfile->filename[0] != '\0') {
|
if (openfile->filename[0] != '\0') {
|
||||||
as_an_at = FALSE;
|
as_an_at = FALSE;
|
||||||
@ -2140,13 +2140,13 @@ void minibar(void)
|
|||||||
if (namewidth > COLS - 2) {
|
if (namewidth > COLS - 2) {
|
||||||
char *shortname = display_string(thename, namewidth - COLS + 5,
|
char *shortname = display_string(thename, namewidth - COLS + 5,
|
||||||
COLS - 5, FALSE, FALSE);
|
COLS - 5, FALSE, FALSE);
|
||||||
mvwaddstr(bottomwin, 0, 0, "...");
|
mvwaddstr(footwin, 0, 0, "...");
|
||||||
waddstr(bottomwin, shortname);
|
waddstr(footwin, shortname);
|
||||||
free(shortname);
|
free(shortname);
|
||||||
} else
|
} else
|
||||||
mvwaddstr(bottomwin, 0, padding, thename);
|
mvwaddstr(footwin, 0, padding, thename);
|
||||||
|
|
||||||
waddstr(bottomwin, openfile->modified ? " *" : " ");
|
waddstr(footwin, openfile->modified ? " *" : " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Right after reading or writing a file, display its number of lines;
|
/* Right after reading or writing a file, display its number of lines;
|
||||||
@ -2158,7 +2158,7 @@ void minibar(void)
|
|||||||
sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count);
|
sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count);
|
||||||
tallywidth = breadth(number_of_lines);
|
tallywidth = breadth(number_of_lines);
|
||||||
if (namewidth + tallywidth + 11 < COLS)
|
if (namewidth + tallywidth + 11 < COLS)
|
||||||
waddstr(bottomwin, number_of_lines);
|
waddstr(footwin, number_of_lines);
|
||||||
else
|
else
|
||||||
tallywidth = 0;
|
tallywidth = 0;
|
||||||
report_size = FALSE;
|
report_size = FALSE;
|
||||||
@ -2168,13 +2168,13 @@ void minibar(void)
|
|||||||
ranking = nmalloc(24);
|
ranking = nmalloc(24);
|
||||||
sprintf(ranking, " [%i/%i]", buffer_number(openfile), buffer_number(startfile->prev));
|
sprintf(ranking, " [%i/%i]", buffer_number(openfile), buffer_number(startfile->prev));
|
||||||
if (namewidth + placewidth + breadth(ranking) + 32 < COLS)
|
if (namewidth + placewidth + breadth(ranking) + 32 < COLS)
|
||||||
waddstr(bottomwin, ranking);
|
waddstr(footwin, ranking);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Display the line/column position of the cursor. */
|
/* Display the line/column position of the cursor. */
|
||||||
if (ISSET(CONSTANT_SHOW) && namewidth + tallywidth + placewidth + 32 < COLS)
|
if (ISSET(CONSTANT_SHOW) && namewidth + tallywidth + placewidth + 32 < COLS)
|
||||||
mvwaddstr(bottomwin, 0, COLS - 27 - placewidth, location);
|
mvwaddstr(footwin, 0, COLS - 27 - placewidth, location);
|
||||||
|
|
||||||
/* Display the hexadecimal code of the character under the cursor,
|
/* Display the hexadecimal code of the character under the cursor,
|
||||||
* plus the codes of up to two succeeding zero-width characters. */
|
* plus the codes of up to two succeeding zero-width characters. */
|
||||||
@ -2198,7 +2198,7 @@ void minibar(void)
|
|||||||
else
|
else
|
||||||
sprintf(hexadecimal, " 0x%02X", (unsigned char)*this_position);
|
sprintf(hexadecimal, " 0x%02X", (unsigned char)*this_position);
|
||||||
|
|
||||||
mvwaddstr(bottomwin, 0, COLS - 23, hexadecimal);
|
mvwaddstr(footwin, 0, COLS - 23, hexadecimal);
|
||||||
|
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
successor = this_position + char_length(this_position);
|
successor = this_position + char_length(this_position);
|
||||||
@ -2206,13 +2206,13 @@ void minibar(void)
|
|||||||
if (*this_position && *successor && is_zerowidth(successor) &&
|
if (*this_position && *successor && is_zerowidth(successor) &&
|
||||||
mbtowide(&widecode, successor) > 0) {
|
mbtowide(&widecode, successor) > 0) {
|
||||||
sprintf(hexadecimal, "|%04X", (int)widecode);
|
sprintf(hexadecimal, "|%04X", (int)widecode);
|
||||||
waddstr(bottomwin, hexadecimal);
|
waddstr(footwin, hexadecimal);
|
||||||
|
|
||||||
successor += char_length(successor);
|
successor += char_length(successor);
|
||||||
|
|
||||||
if (is_zerowidth(successor) && mbtowide(&widecode, successor) > 0) {
|
if (is_zerowidth(successor) && mbtowide(&widecode, successor) > 0) {
|
||||||
sprintf(hexadecimal, "|%04X", (int)widecode);
|
sprintf(hexadecimal, "|%04X", (int)widecode);
|
||||||
waddstr(bottomwin, hexadecimal);
|
waddstr(footwin, hexadecimal);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
successor = NULL;
|
successor = NULL;
|
||||||
@ -2221,18 +2221,18 @@ void minibar(void)
|
|||||||
|
|
||||||
/* Display the state of three flags, and the state of macro and mark. */
|
/* Display the state of three flags, and the state of macro and mark. */
|
||||||
if (ISSET(STATEFLAGS) && !successor && namewidth + tallywidth + 14 + 2 * padding < COLS) {
|
if (ISSET(STATEFLAGS) && !successor && namewidth + tallywidth + 14 + 2 * padding < COLS) {
|
||||||
wmove(bottomwin, 0, COLS - 11 - padding);
|
wmove(footwin, 0, COLS - 11 - padding);
|
||||||
show_states_at(bottomwin);
|
show_states_at(footwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display how many percent the current line is into the file. */
|
/* Display how many percent the current line is into the file. */
|
||||||
if (namewidth + 6 < COLS) {
|
if (namewidth + 6 < COLS) {
|
||||||
sprintf(location, "%3zi%%", 100 * openfile->current->lineno / openfile->filebot->lineno);
|
sprintf(location, "%3zi%%", 100 * openfile->current->lineno / openfile->filebot->lineno);
|
||||||
mvwaddstr(bottomwin, 0, COLS - 4 - padding, location);
|
mvwaddstr(footwin, 0, COLS - 4 - padding, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
wattroff(bottomwin, interface_color_pair[MINI_INFOBAR]);
|
wattroff(footwin, interface_color_pair[MINI_INFOBAR]);
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
|
|
||||||
free(number_of_lines);
|
free(number_of_lines);
|
||||||
free(hexadecimal);
|
free(hexadecimal);
|
||||||
@ -2284,11 +2284,11 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
/* If there are multiple alert messages, add trailing dots to the first. */
|
/* If there are multiple alert messages, add trailing dots to the first. */
|
||||||
if (lastmessage == ALERT) {
|
if (lastmessage == ALERT) {
|
||||||
if (start_col > 4) {
|
if (start_col > 4) {
|
||||||
wmove(bottomwin, 0, COLS + 2 - start_col);
|
wmove(footwin, 0, COLS + 2 - start_col);
|
||||||
wattron(bottomwin, interface_color_pair[ERROR_MESSAGE]);
|
wattron(footwin, interface_color_pair[ERROR_MESSAGE]);
|
||||||
waddstr(bottomwin, "...");
|
waddstr(footwin, "...");
|
||||||
wattroff(bottomwin, interface_color_pair[ERROR_MESSAGE]);
|
wattroff(footwin, interface_color_pair[ERROR_MESSAGE]);
|
||||||
wnoutrefresh(bottomwin);
|
wnoutrefresh(footwin);
|
||||||
start_col = 0;
|
start_col = 0;
|
||||||
napms(100);
|
napms(100);
|
||||||
beep();
|
beep();
|
||||||
@ -2320,23 +2320,23 @@ void statusline(message_type importance, const char *msg, ...)
|
|||||||
start_col = (COLS - breadth(message)) / 2;
|
start_col = (COLS - breadth(message)) / 2;
|
||||||
bracketed = (start_col > 1);
|
bracketed = (start_col > 1);
|
||||||
|
|
||||||
wmove(bottomwin, 0, (bracketed ? start_col - 2 : start_col));
|
wmove(footwin, 0, (bracketed ? start_col - 2 : start_col));
|
||||||
wattron(bottomwin, colorpair);
|
wattron(footwin, colorpair);
|
||||||
if (bracketed)
|
if (bracketed)
|
||||||
waddstr(bottomwin, "[ ");
|
waddstr(footwin, "[ ");
|
||||||
waddstr(bottomwin, message);
|
waddstr(footwin, message);
|
||||||
if (bracketed)
|
if (bracketed)
|
||||||
waddstr(bottomwin, " ]");
|
waddstr(footwin, " ]");
|
||||||
wattroff(bottomwin, colorpair);
|
wattroff(footwin, colorpair);
|
||||||
|
|
||||||
#ifdef USING_OLDER_LIBVTE
|
#ifdef USING_OLDER_LIBVTE
|
||||||
/* Defeat a VTE/Konsole bug, where the cursor can go off-limits. */
|
/* Defeat a VTE/Konsole bug, where the cursor can go off-limits. */
|
||||||
if (ISSET(CONSTANT_SHOW) && ISSET(NO_HELP))
|
if (ISSET(CONSTANT_SHOW) && ISSET(NO_HELP))
|
||||||
wmove(bottomwin, 0, 0);
|
wmove(footwin, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Push the message to the screen straightaway. */
|
/* Push the message to the screen straightaway. */
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
|
|
||||||
free(compound);
|
free(compound);
|
||||||
free(message);
|
free(message);
|
||||||
@ -2366,19 +2366,19 @@ void warn_and_briefly_pause(const char *msg)
|
|||||||
* Key plus tag may occupy at most width columns. */
|
* Key plus tag may occupy at most width columns. */
|
||||||
void post_one_key(const char *keystroke, const char *tag, int width)
|
void post_one_key(const char *keystroke, const char *tag, int width)
|
||||||
{
|
{
|
||||||
wattron(bottomwin, interface_color_pair[KEY_COMBO]);
|
wattron(footwin, interface_color_pair[KEY_COMBO]);
|
||||||
waddnstr(bottomwin, keystroke, actual_x(keystroke, width));
|
waddnstr(footwin, keystroke, actual_x(keystroke, width));
|
||||||
wattroff(bottomwin, interface_color_pair[KEY_COMBO]);
|
wattroff(footwin, interface_color_pair[KEY_COMBO]);
|
||||||
|
|
||||||
/* If the remaining space is too small, skip the description. */
|
/* If the remaining space is too small, skip the description. */
|
||||||
width -= breadth(keystroke);
|
width -= breadth(keystroke);
|
||||||
if (width < 2)
|
if (width < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
waddch(bottomwin, ' ');
|
waddch(footwin, ' ');
|
||||||
wattron(bottomwin, interface_color_pair[FUNCTION_TAG]);
|
wattron(footwin, interface_color_pair[FUNCTION_TAG]);
|
||||||
waddnstr(bottomwin, tag, actual_x(tag, width - 1));
|
waddnstr(footwin, tag, actual_x(tag, width - 1));
|
||||||
wattroff(bottomwin, interface_color_pair[FUNCTION_TAG]);
|
wattroff(footwin, interface_color_pair[FUNCTION_TAG]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the shortcut list corresponding to menu on the last two rows
|
/* Display the shortcut list corresponding to menu on the last two rows
|
||||||
@ -2420,7 +2420,7 @@ void bottombars(int menu)
|
|||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wmove(bottomwin, 1 + index % 2, (index / 2) * itemwidth);
|
wmove(footwin, 1 + index % 2, (index / 2) * itemwidth);
|
||||||
|
|
||||||
/* When the number is uneven, the penultimate item can be double wide. */
|
/* When the number is uneven, the penultimate item can be double wide. */
|
||||||
if ((number % 2) == 1 && (index + 2 == number))
|
if ((number % 2) == 1 && (index + 2 == number))
|
||||||
@ -2435,7 +2435,7 @@ void bottombars(int menu)
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Redetermine current_y from the position of current relative to edittop,
|
/* Redetermine current_y from the position of current relative to edittop,
|
||||||
@ -3704,7 +3704,7 @@ void do_credits(void)
|
|||||||
|
|
||||||
wrefresh(topwin);
|
wrefresh(topwin);
|
||||||
wrefresh(midwin);
|
wrefresh(midwin);
|
||||||
wrefresh(bottomwin);
|
wrefresh(footwin);
|
||||||
napms(700);
|
napms(700);
|
||||||
|
|
||||||
for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) {
|
for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user