add missing check_statusblank() calls

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2878 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-07-17 00:01:18 +00:00
parent 157ce9120b
commit 5e146e815f
2 changed files with 70 additions and 63 deletions

View File

@ -71,7 +71,8 @@ CVS code -
- Simplify wording of nano_gotoline_msg. (Jordi and Ken Tyler)
- move.c:
do_first_line(), do_last_line()
- Simplify by only using edit_redraw(). (DLR)
- Simplify by only using edit_redraw(), and also make them call
check_statusblank(). (DLR)
do_page_up(), do_page_down()
- If there's less than a page of text onscreen, just call
do_(first|last)_line(). (DLR)

View File

@ -35,6 +35,8 @@ void do_first_line(void)
const filestruct *current_save = openfile->current;
size_t pww_save = openfile->placewewant;
check_statusblank();
openfile->current = openfile->fileage;
openfile->current_x = 0;
openfile->placewewant = 0;
@ -47,6 +49,8 @@ void do_last_line(void)
const filestruct *current_save = openfile->current;
size_t pww_save = openfile->placewewant;
check_statusblank();
openfile->current = openfile->filebot;
openfile->current_x = 0;
openfile->placewewant = 0;
@ -59,6 +63,8 @@ void do_home(void)
{
size_t pww_save = openfile->placewewant;
check_statusblank();
#ifndef NANO_SMALL
if (ISSET(SMART_HOME)) {
size_t current_x_save = openfile->current_x;
@ -78,8 +84,6 @@ void do_home(void)
}
#endif
check_statusblank();
if (need_horizontal_update(pww_save))
update_line(openfile->current, openfile->current_x);
}
@ -88,17 +92,21 @@ void do_end(void)
{
size_t pww_save = openfile->placewewant;
check_statusblank();
openfile->current_x = strlen(openfile->current->data);
openfile->placewewant = xplustabs();
check_statusblank();
if (need_horizontal_update(pww_save))
update_line(openfile->current, openfile->current_x);
}
void do_page_up(void)
{
int i;
check_statusblank();
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
@ -106,14 +114,13 @@ void do_page_up(void)
/* If there's less than a page of text left on the screen, put the
* cursor at the beginning of the first line of the file, and then
* update the edit window. */
if (openfile->current->lineno <= editwinrows - 2)
if (openfile->current->lineno <= editwinrows - 2) {
do_first_line();
else {
int i;
return;
}
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico
* does. */
* beginning of the top line of the edit window, as Pico does. */
#ifndef NANO_SMALL
if (!ISSET(SMOOTH_SCROLL)) {
#endif
@ -123,8 +130,8 @@ void do_page_up(void)
}
#endif
for (i = editwinrows - 2; i > 0 && openfile->current->prev !=
NULL; i--)
for (i = editwinrows - 2; i > 0 && openfile->current->prev != NULL;
i--)
openfile->current = openfile->current->prev;
openfile->current_x = actual_x(openfile->current->data,
@ -132,13 +139,14 @@ void do_page_up(void)
/* Scroll the edit window up a page. */
edit_scroll(UP, editwinrows - 2);
}
check_statusblank();
}
void do_page_down(void)
{
int i;
check_statusblank();
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
@ -147,14 +155,13 @@ void do_page_down(void)
* cursor at the beginning of the last line of the file, and then
* update the edit window. */
if (openfile->current->lineno + editwinrows - 2 >=
openfile->filebot->lineno)
openfile->filebot->lineno) {
do_last_line();
else {
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico
* does. */
int i;
return;
}
/* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */
#ifndef NANO_SMALL
if (!ISSET(SMOOTH_SCROLL)) {
#endif
@ -164,8 +171,8 @@ void do_page_down(void)
}
#endif
for (i = editwinrows - 2; i > 0 && openfile->current->next !=
NULL; i--)
for (i = editwinrows - 2; i > 0 && openfile->current->next != NULL;
i--)
openfile->current = openfile->current->next;
openfile->current_x = actual_x(openfile->current->data,
@ -173,17 +180,15 @@ void do_page_down(void)
/* Scroll the edit window down a page. */
edit_scroll(DOWN, editwinrows - 2);
}
check_statusblank();
}
void do_up(void)
{
check_statusblank();
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
check_statusblank();
/* If we're at the top of the file, get out. */
if (openfile->current->prev == NULL)
@ -217,10 +222,11 @@ void do_up(void)
void do_down(void)
{
check_statusblank();
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
check_statusblank();
/* If we're at the bottom of the file, get out. */
if (openfile->current->next == NULL)
@ -256,6 +262,8 @@ void do_left(bool allow_update)
{
size_t pww_save = openfile->placewewant;
check_statusblank();
if (openfile->current_x > 0)
openfile->current_x = move_mbleft(openfile->current->data,
openfile->current_x);
@ -266,8 +274,6 @@ void do_left(bool allow_update)
openfile->placewewant = xplustabs();
check_statusblank();
if (allow_update && need_horizontal_update(pww_save))
update_line(openfile->current, openfile->current_x);
}
@ -281,6 +287,8 @@ void do_right(bool allow_update)
{
size_t pww_save = openfile->placewewant;
check_statusblank();
assert(openfile->current_x <= strlen(openfile->current->data));
if (openfile->current->data[openfile->current_x] != '\0')
@ -293,8 +301,6 @@ void do_right(bool allow_update)
openfile->placewewant = xplustabs();
check_statusblank();
if (allow_update && need_horizontal_update(pww_save))
update_line(openfile->current, openfile->current_x);
}