to wnoutrefresh() calls, except for those in total_update() and
do_credits(); call doupdate() just before using blocking input, since
nano spends the most time using it, for blocking input; and only do
constant sursor position display if we're just about to use blocking
input
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2943
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
redrawing the screen. Changes to window_init(), main(), and
do_alt_speller(); removal of check_die_too_small() and
window_size_init(). (DLR)
+ - Remove still more redundant screen updates. Change all
+ wrefresh() calls to wnoutrefresh() calls, except for those in
+ total_update() and do_credits(); call doupdate() just before
+ using blocking input, since nano spends the most time using
+ it, for blocking input; and only do constant sursor position
+ display if we're just about to use blocking input. Changes to
+ input_tab(), do_browser(), finish(), do_output(), main(),
+ get_key_buffer(), check_statusblank(), nanogetstr(),
+ titlebar(), statusbar(), bottombars(), edit_refresh(),
+ do_yesno(), and do_help(). (DLR)
- color.c:
- Remove unneeded string.h and fcntl.h includes. (DLR)
- chars.c:
editline++;
}
- wrefresh(edit);
+ wnoutrefresh(edit);
*list = TRUE;
}
curs_set(0);
blank_statusbar();
bottombars(browser_list);
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
/* Set currshortcut so the user can click in the shortcut area, and
free(foo);
}
- wrefresh(edit);
+ wnoutrefresh(edit);
} while ((kbinput = get_kbinput(edit, &meta_key, &func_key)) !=
NANO_EXIT_KEY && kbinput != NANO_EXIT_FKEY);
else
blank_statusbar();
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
endwin();
/* Restore the old terminal settings. */
void do_output(char *output, size_t output_len, bool allow_cntrls)
{
size_t current_len, i = 0;
- bool old_const_update = ISSET(CONST_UPDATE);
bool do_refresh = FALSE;
/* Do we have to call edit_refresh(), or can we get away with
* update_line()? */
current_len = strlen(openfile->current->data);
- /* Turn off constant cursor position display. */
- UNSET(CONST_UPDATE);
-
while (i < output_len) {
/* If allow_cntrls is FALSE, filter out nulls and newlines,
* since they're control characters. */
#endif
}
- /* Turn constant cursor position display back on if it was on
- * before. */
- if (old_const_update)
- SET(CONST_UPDATE);
-
free(char_buf);
openfile->placewewant = xplustabs();
/* Make sure the cursor is in the edit window. */
reset_cursor();
- /* If constant cursor position display is on, display the
- * current cursor position on the statusbar. */
- if (ISSET(CONST_UPDATE))
+ /* If constant cursor position display is on, and there are no
+ * keys waiting in the input buffer, display the current cursor
+ * position on the statusbar. */
+ if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
do_cursorpos(TRUE);
currshortcut = main_list;
allow_pending_sigwinch(TRUE);
#endif
+ /* Just before reading in the first character, display any pending
+ * screen updates. */
+ doupdate();
+
input = wgetch(win);
/* If we get ERR when using blocking input, it means that the input
blank_statusbar();
wnoutrefresh(bottomwin);
reset_cursor();
- wrefresh(edit);
+ wnoutrefresh(edit);
}
}
/* Refresh the edit window and the statusbar before getting
* input. */
wnoutrefresh(edit);
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
/* If we're using restricted mode, we aren't allowed to change the
* name of a file once it has one because that would allow writing
#endif
nanoget_repaint(buf, answer, statusbar_x);
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
}
#ifndef NANO_SMALL
wnoutrefresh(topwin);
reset_cursor();
- wrefresh(edit);
+ wnoutrefresh(edit);
}
/* Set the modified flag if it isn't already set, and then update the
wattroff(bottomwin, A_REVERSE);
wnoutrefresh(bottomwin);
reset_cursor();
- wrefresh(edit);
+ wnoutrefresh(edit);
/* Leave the cursor at its position in the edit window, not
* in the statusbar. */
}
wnoutrefresh(bottomwin);
reset_cursor();
- wrefresh(edit);
+ wnoutrefresh(edit);
}
/* Write a shortcut key to the help area at the bottom of the window.
blank_line(edit, nlines, 0, COLS);
reset_cursor();
- wrefresh(edit);
+ wnoutrefresh(edit);
}
/* Move edittop to put it in range of current, keeping current in the
/* Refresh the edit window and the statusbar before getting
* input. */
wnoutrefresh(edit);
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
do {
int kbinput;
if (old_no_help) {
blank_bottombars();
- wrefresh(bottomwin);
+ wnoutrefresh(bottomwin);
SET(NO_HELP);
window_init();
} else