mirror of git://git.sv.gnu.org/nano.git
in do_scroll_up() and do_scroll_down(), fix problems where, after
scrolling, the previous and current lines would not be updated properly if the current line was not the first or last line of the edit window git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3762 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
ec15fdb30b
commit
bf104950fd
|
@ -71,6 +71,12 @@ CVS code -
|
|||
- help.c:
|
||||
do_help()
|
||||
- Simplify screen update handling and exiting. (DLR)
|
||||
- move.c:
|
||||
do_scroll_up(), do_scroll_down()
|
||||
- Fix problems where, after scrolling, the previous and current
|
||||
lines would not be updated properly if the current line was
|
||||
not the first or last line of the edit window. (DLR, found by
|
||||
Mike Frysinger)
|
||||
- winio.c:
|
||||
display_string()
|
||||
- Properly handle buf[start_index]'s being a null terminator.
|
||||
|
|
20
src/move.c
20
src/move.c
|
@ -522,6 +522,16 @@ void do_scroll_up(void)
|
|||
|
||||
/* Scroll the edit window up one line. */
|
||||
edit_scroll(UP, 1);
|
||||
|
||||
/* If we're not on the first line of the edit window, update the
|
||||
* line we were on before and the line we're on now. The former
|
||||
* needs to be redrawn if we're not on the first page, and the
|
||||
* latter needs to be drawn unconditionally. */
|
||||
if (openfile->current_y > 0) {
|
||||
if (need_vertical_update(0))
|
||||
update_line(openfile->current->next, 0);
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
|
@ -576,6 +586,16 @@ void do_scroll_down(void)
|
|||
|
||||
/* Scroll the edit window down one line. */
|
||||
edit_scroll(DOWN, 1);
|
||||
|
||||
/* If we're not on the last line of the edit window, update the line
|
||||
* we were on before and the line we're on now. The former needs to
|
||||
* be redrawn if we're not on the first page, and the latter needs
|
||||
* to be drawn unconditionally. */
|
||||
if (openfile->current_y < editwinrows - 1) {
|
||||
if (need_vertical_update(0))
|
||||
update_line(openfile->current->prev, 0);
|
||||
update_line(openfile->current, openfile->current_x);
|
||||
}
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
|
|
Loading…
Reference in New Issue