tweaks: rename a variable and invert its logic

master
Benno Schulenberg 2017-02-23 18:31:36 +01:00
parent 9e6e1ebe58
commit 07ebba5e99
4 changed files with 12 additions and 14 deletions

View File

@ -2671,7 +2671,7 @@ int main(int argc, char **argv)
/* Update the displayed current cursor position only when there
* are no keys waiting in the input buffer. */
if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
do_cursorpos(TRUE);
do_cursorpos(FALSE);
/* Refresh just the cursor position or the entire edit window. */
if (!refresh_needed) {

View File

@ -756,7 +756,7 @@ void adjust_viewport(update_type location);
void total_redraw(void);
void total_refresh(void);
void display_main_list(void);
void do_cursorpos(bool constant);
void do_cursorpos(bool force);
void do_cursorpos_void(void);
void spotlight(bool active, const char *word);
void xon_complaint(void);

View File

@ -2510,7 +2510,7 @@ void do_justify(bool full_justify)
/* If needed, unset the cursor-position suppression flag, so the cursor
* position /will/ be displayed upon a return to the main loop. */
if (ISSET(CONST_UPDATE))
do_cursorpos(TRUE);
do_cursorpos(FALSE);
func = func_from_key(&kbinput);
@ -3664,11 +3664,9 @@ void do_verbatim_input(void)
/* Read in all the verbatim characters. */
kbinput = get_verbatim_kbinput(edit, &kbinput_len);
/* If constant cursor position display is on, make sure the current
* cursor position will be properly displayed on the statusbar.
* Otherwise, blank the statusbar. */
/* Unsuppress cursor-position display or blank the statusbar. */
if (ISSET(CONST_UPDATE))
do_cursorpos(TRUE);
do_cursorpos(FALSE);
else {
blank_statusbar();
wnoutrefresh(bottomwin);

View File

@ -3032,10 +3032,10 @@ void display_main_list(void)
bottombars(MMAIN);
}
/* If constant is TRUE, we display the current cursor position only if
* suppress_cursorpos is FALSE. If constant is FALSE, we display the
* position always. In any case we reset suppress_cursorpos to FALSE. */
void do_cursorpos(bool constant)
/* Show info about the current cursor position on the statusbar.
* Do this unconditionally when force is TRUE; otherwise, only if
* suppress_cursorpos is FALSE. In any case, reset the latter. */
void do_cursorpos(bool force)
{
char saved_byte;
size_t sum, cur_xpt = xplustabs() + 1;
@ -3056,8 +3056,8 @@ void do_cursorpos(bool constant)
if (openfile->current != openfile->filebot)
sum--;
/* If the position needs to be suppressed, don't suppress it next time. */
if (suppress_cursorpos && constant) {
/* If the showing needs to be suppressed, don't suppress it next time. */
if (suppress_cursorpos && !force) {
suppress_cursorpos = FALSE;
return;
}
@ -3081,7 +3081,7 @@ void do_cursorpos(bool constant)
/* Unconditionally display the current cursor position. */
void do_cursorpos_void(void)
{
do_cursorpos(FALSE);
do_cursorpos(TRUE);
}
void enable_nodelay(void)