tweaks: in comments, reword "titlebar" and "statusbar" to two words each

To differentiate them from the function names.
master
Benno Schulenberg 2020-01-16 16:16:31 +01:00
parent f47ef539db
commit 706f3e93f4
6 changed files with 37 additions and 37 deletions

View File

@ -129,8 +129,8 @@ void make_new_buffer(void)
#endif #endif
} }
/* Mark the current file as modified if it isn't already, and then /* Mark the current file as modified if it isn't already, and
* update the titlebar to display the file's new status. */ * then update the title bar to display the file's new status. */
void set_modified(void) void set_modified(void)
{ {
if (openfile->modified) if (openfile->modified)
@ -562,10 +562,10 @@ bool replace_buffer(const char *filename, undo_type action, bool marked,
} }
#endif /* ENABLE_SPELLER */ #endif /* ENABLE_SPELLER */
/* Update the titlebar and the multiline cache to match the current buffer. */ /* Update the title bar and the multiline cache to match the current buffer. */
void prepare_for_display(void) void prepare_for_display(void)
{ {
/* Update the titlebar, since the filename may have changed. */ /* Update the title bar, since the filename may have changed. */
if (!inhelp) if (!inhelp)
titlebar(NULL); titlebar(NULL);
@ -620,7 +620,7 @@ void redecorate_after_switch(void)
openfile->firstcolumn = 0; openfile->firstcolumn = 0;
#endif #endif
/* Update titlebar and multiline info to match the current buffer. */ /* Update title bar and multiline info to match the current buffer. */
prepare_for_display(); prepare_for_display();
/* Ensure that the main loop will redraw the help lines. */ /* Ensure that the main loop will redraw the help lines. */
@ -1032,7 +1032,7 @@ void do_insertfile(void)
int response; int response;
const char *msg; const char *msg;
char *given = copy_of(""); char *given = copy_of("");
/* The last answer the user typed at the statusbar prompt. */ /* The last answer the user typed at the status-bar prompt. */
#ifndef NANO_TINY #ifndef NANO_TINY
format_type was_fmt = openfile->fmt; format_type was_fmt = openfile->fmt;
bool execute = FALSE; bool execute = FALSE;
@ -2468,7 +2468,7 @@ char **cwd_tab_completion(const char *buf, bool allow_files,
return matches; return matches;
} }
/* Do tab completion. place refers to how much the statusbar cursor /* Do tab completion. place refers to how much the status-bar cursor
* position should be advanced. refresh_func is the function we will * position should be advanced. refresh_func is the function we will
* call to refresh the edit window. */ * call to refresh the edit window. */
char *input_tab(char *buf, bool allow_files, size_t *place, char *input_tab(char *buf, bool allow_files, size_t *place,

View File

@ -112,7 +112,7 @@ WINDOW *edit = NULL;
* contents of the current buffer, the file we are editing. */ * contents of the current buffer, the file we are editing. */
WINDOW *bottomwin = NULL; WINDOW *bottomwin = NULL;
/* The bottom portion of the screen, where we display statusbar /* The bottom portion of the screen, where we display statusbar
* messages, the statusbar prompt, and a list of shortcuts. */ * messages, the status-bar prompt, and a list of shortcuts. */
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;
@ -163,7 +163,7 @@ char *word_chars = NULL;
/* Nonalphanumeric characters that also form words. */ /* Nonalphanumeric characters that also form words. */
char *answer = NULL; char *answer = NULL;
/* The answer string used by the statusbar prompt. */ /* The answer string used by the status-bar prompt. */
ssize_t tabsize = -1; ssize_t tabsize = -1;
/* The width of a tab in spaces. The default is set in main(). */ /* The width of a tab in spaces. The default is set in main(). */

View File

@ -317,7 +317,7 @@ void disable_bracketed_paste(void)
/* Exit normally: restore the terminal state and save history files. */ /* Exit normally: restore the terminal state and save history files. */
void finish(void) void finish(void)
{ {
/* Blank the statusbar 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(bottomwin);
@ -457,12 +457,12 @@ void window_init(void)
delwin(bottomwin); delwin(bottomwin);
} }
/* If the terminal is very flat, don't set up a titlebar. */ /* If the terminal is very flat, don't set up a title bar. */
if (LINES < 3) { if (LINES < 3) {
topwin = NULL; topwin = NULL;
editwinrows = 1; editwinrows = 1;
/* 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 statusbar window will cover each other. */ * edit window and status-bar window will cover each other. */
edit = newwin(1, COLS, 0, 0); edit = newwin(1, COLS, 0, 0);
bottomwin = newwin(1, COLS, LINES - 1, 0); bottomwin = newwin(1, COLS, LINES - 1, 0);
} else { } else {

View File

@ -24,18 +24,18 @@
#include <string.h> #include <string.h>
static char *prompt = NULL; static char *prompt = NULL;
/* The prompt string used for statusbar questions. */ /* The prompt string used for status-bar questions. */
static size_t typing_x = HIGHEST_POSITIVE; static size_t typing_x = HIGHEST_POSITIVE;
/* The cursor position in answer. */ /* The cursor position in answer. */
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
/* Handle a mouse click on the statusbar prompt or the shortcut list. */ /* Handle a mouse click on the status-bar prompt or the shortcut list. */
int do_statusbar_mouse(void) int do_statusbar_mouse(void)
{ {
int click_row, click_col; int click_row, click_col;
int retval = get_mouseinput(&click_row, &click_col, TRUE); int retval = get_mouseinput(&click_row, &click_col, TRUE);
/* We can click on the statusbar 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(bottomwin, &click_row, &click_col, FALSE)) {
size_t start_col = breadth(prompt) + 2; size_t start_col = breadth(prompt) + 2;
@ -362,7 +362,7 @@ void do_statusbar_uncut_text(void)
} }
/* Return the column number of the first character of the answer that is /* Return the column number of the first character of the answer that is
* displayed in the statusbar when the cursor is at the given column, * displayed in the status bar when the cursor is at the given column,
* with the available room for the answer starting at base. Note that * with the available room for the answer starting at base. Note that
* (0 <= column - get_statusbar_page_start(column) < COLS). */ * (0 <= column - get_statusbar_page_start(column) < COLS). */
size_t get_statusbar_page_start(size_t base, size_t column) size_t get_statusbar_page_start(size_t base, size_t column)
@ -435,7 +435,7 @@ void add_or_remove_pipe_symbol_from_answer(void)
} }
#endif #endif
/* Get a string of input at the statusbar prompt. */ /* Get a string of input at the status-bar prompt. */
functionptrtype acquire_an_answer(int *actual, bool allow_tabs, functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
bool allow_files, bool *listed, linestruct **history_list, bool allow_files, bool *listed, linestruct **history_list,
void (*refresh_func)(void)) void (*refresh_func)(void))
@ -549,7 +549,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
* the help viewer or display a message indicating that help * the help viewer or display a message indicating that help
* is disabled, which means that finished has been set to TRUE. * is disabled, which means that finished has been set to TRUE.
* Set it back to FALSE here, so that we aren't kicked out of * Set it back to FALSE here, so that we aren't kicked out of
* the statusbar prompt. */ * the status-bar prompt. */
finished = FALSE; finished = FALSE;
} }
@ -576,7 +576,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
return func; return func;
} }
/* Ask a question on the statusbar. Return 0 when text was entered, /* Ask a question on the status bar. Return 0 when text was entered,
* -1 for a cancelled entry, -2 for a blank string, and the relevant * -1 for a cancelled entry, -2 for a blank string, and the relevant
* keycode when a valid shortcut key was pressed. * keycode when a valid shortcut key was pressed.
* *
@ -592,7 +592,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
int retval; int retval;
functionptrtype func = NULL; functionptrtype func = NULL;
bool listed = FALSE; bool listed = FALSE;
/* Save a possible current statusbar x position and prompt. */ /* Save a possible current status-bar x position and prompt. */
size_t was_typing_x = typing_x; size_t was_typing_x = typing_x;
char *saved_prompt = prompt; char *saved_prompt = prompt;
@ -646,7 +646,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
} }
/* Ask a simple Yes/No (and optionally All) question, specified in msg, /* Ask a simple Yes/No (and optionally All) question, specified in msg,
* on the statusbar. Return 1 for Yes, 0 for No, 2 for All (if all is * on the status bar. Return 1 for Yes, 0 for No, 2 for All (if all is
* TRUE when passed in), and -1 for Cancel. */ * TRUE when passed in), and -1 for Cancel. */
int do_yesno_prompt(bool all, const char *msg) int do_yesno_prompt(bool all, const char *msg)
{ {

View File

@ -3117,7 +3117,7 @@ void do_wordlinechar_count(void)
openfile->current = was_current; openfile->current = was_current;
openfile->current_x = was_x; openfile->current_x = was_x;
/* Display the total word, line, and character counts on the statusbar. */ /* Display the total word, line, and character counts on the status bar. */
statusline(HUSH, _("%sWords: %zu Lines: %zd Chars: %zu"), openfile->mark ? statusline(HUSH, _("%sWords: %zu Lines: %zd Chars: %zu"), openfile->mark ?
_("In Selection: ") : "", words, lines, chars); _("In Selection: ") : "", words, lines, chars);
} }
@ -3138,7 +3138,7 @@ void do_verbatim_input(void)
/* Read in all the verbatim characters. */ /* Read in all the verbatim characters. */
kbinput = get_verbatim_kbinput(edit, &count); kbinput = get_verbatim_kbinput(edit, &count);
/* Unsuppress cursor-position display or blank the statusbar. */ /* Unsuppress cursor-position display or blank the status bar. */
if (ISSET(CONSTANT_SHOW)) if (ISSET(CONSTANT_SHOW))
suppress_cursorpos = FALSE; suppress_cursorpos = FALSE;
else else

View File

@ -48,7 +48,7 @@ static int digit_count = 0;
static bool waiting_mode = TRUE; static bool waiting_mode = TRUE;
/* Whether getting a character will wait for a key to be pressed. */ /* Whether getting a character will wait for a key to be pressed. */
static int statusblank = 0; static int statusblank = 0;
/* The number of keystrokes left before we blank the statusbar. */ /* The number of keystrokes left before we blank the status bar. */
#ifdef USING_OLD_NCURSES #ifdef USING_OLD_NCURSES
static bool seen_wide = FALSE; static bool seen_wide = FALSE;
/* Whether we've seen a multicolumn character in the current line. */ /* Whether we've seen a multicolumn character in the current line. */
@ -338,7 +338,7 @@ int get_kbinput(WINDOW *win, bool showcursor)
while (kbinput == ERR) while (kbinput == ERR)
kbinput = parse_kbinput(win); kbinput = parse_kbinput(win);
/* If we read from the edit window, blank the statusbar if needed. */ /* If we read from the edit window, blank the status bar if needed. */
if (win == edit) if (win == edit)
check_statusblank(); check_statusblank();
@ -1777,8 +1777,8 @@ void blank_bottombars(void)
} }
} }
/* Check if the number of keystrokes needed to blank the statusbar has /* Check if the number of keystrokes needed to blank the status bar has
* been pressed. If so, blank the statusbar, unless constant cursor * been pressed. If so, blank the status bar, unless constant cursor
* position display is on and we are in the editing screen. */ * position display is on and we are in the editing screen. */
void check_statusblank(void) void check_statusblank(void)
{ {
@ -2005,17 +2005,17 @@ int buffer_number(openfilestruct *buffer)
/* If path is NULL, we're in normal editing mode, so display the current /* If path is NULL, we're in normal editing mode, so display the current
* version of nano, the current filename, and whether the current file * version of nano, the current filename, and whether the current file
* has been modified on the titlebar. If path isn't NULL, we're either * has been modified on the title bar. If path isn't NULL, we're either
* in the file browser or the help viewer, so show either the current * in the file browser or the help viewer, so show either the current
* directory or the title of help text, that is: whatever is in path. */ * directory or the title of help text, that is: whatever is in path. */
void titlebar(const char *path) void titlebar(const char *path)
{ {
size_t verlen, prefixlen, pathlen, statelen; size_t verlen, prefixlen, pathlen, statelen;
/* The width of the different titlebar elements, in columns. */ /* The width of the different title-bar elements, in columns. */
size_t pluglen = 0; size_t pluglen = 0;
/* The width that "Modified" would take up. */ /* The width that "Modified" would take up. */
size_t offset = 0; size_t offset = 0;
/* The position at which the center part of the titlebar starts. */ /* The position at which the center part of the title bar starts. */
const char *upperleft = ""; const char *upperleft = "";
/* What is shown in the top left corner. */ /* What is shown in the top left corner. */
const char *prefix = ""; const char *prefix = "";
@ -2027,7 +2027,7 @@ void titlebar(const char *path)
char *indicator = NULL; char *indicator = NULL;
/* The buffer sequence number plus buffer count. */ /* The buffer sequence number plus buffer count. */
/* If the screen is too small, there is no titlebar. */ /* If the screen is too small, there is no title bar. */
if (topwin == NULL) if (topwin == NULL)
return; return;
@ -2144,7 +2144,7 @@ void titlebar(const char *path)
wrefresh(topwin); wrefresh(topwin);
} }
/* Display a message on the statusbar, and set suppress_cursorpos to /* Display a message on the status bar, and set suppress_cursorpos to
* TRUE, so that the message won't be immediately overwritten if * TRUE, so that the message won't be immediately overwritten if
* constant cursor position display is on. */ * constant cursor position display is on. */
void statusline(message_type importance, const char *msg, ...) void statusline(message_type importance, const char *msg, ...)
@ -2237,7 +2237,7 @@ void statusline(message_type importance, const char *msg, ...)
SET(WHITESPACE_DISPLAY); SET(WHITESPACE_DISPLAY);
#endif #endif
/* If doing quick blanking, blank the statusbar after just one keystroke. /* If doing quick blanking, blank the status bar after just one keystroke.
* Otherwise, blank it after twenty-six keystrokes, as Pico does. */ * Otherwise, blank it after twenty-six keystrokes, as Pico does. */
if (ISSET(QUICK_BLANK)) if (ISSET(QUICK_BLANK))
statusblank = 1; statusblank = 1;
@ -2245,13 +2245,13 @@ void statusline(message_type importance, const char *msg, ...)
statusblank = 26; statusblank = 26;
} }
/* Display a normal message on the statusbar, quietly. */ /* Display a normal message on the status bar, quietly. */
void statusbar(const char *msg) void statusbar(const char *msg)
{ {
statusline(HUSH, msg); statusline(HUSH, msg);
} }
/* Warn the user on the statusbar and pause for a moment, so that the /* Warn the user on the status bar and pause for a moment, so that the
* message can be noticed and read. */ * message can be noticed and read. */
void warn_and_shortly_pause(const char *msg) void warn_and_shortly_pause(const char *msg)
{ {
@ -3338,7 +3338,7 @@ void total_refresh(void)
bottombars(currmenu); bottombars(currmenu);
} }
/* Show info about the current cursor position on the statusbar. /* Show info about the current cursor position on the status bar.
* Do this unconditionally when force is TRUE; otherwise, only if * Do this unconditionally when force is TRUE; otherwise, only if
* suppress_cursorpos is FALSE. In any case, reset the latter. */ * suppress_cursorpos is FALSE. In any case, reset the latter. */
void do_cursorpos(bool force) void do_cursorpos(bool force)
@ -3366,7 +3366,7 @@ void do_cursorpos(bool force)
if (openfile->current != openfile->filebot) if (openfile->current != openfile->filebot)
sum--; sum--;
/* Display the current cursor position on the statusbar. */ /* Display the current cursor position on the status bar. */
linepct = 100 * openfile->current->lineno / openfile->filebot->lineno; linepct = 100 * openfile->current->lineno / openfile->filebot->lineno;
colpct = 100 * cur_xpt / cur_lenpt; colpct = 100 * cur_xpt / cur_lenpt;
charpct = (openfile->totsize == 0) ? 0 : 100 * sum / openfile->totsize; charpct = (openfile->totsize == 0) ? 0 : 100 * sum / openfile->totsize;