fix edit_redraw() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3571 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
561db3a7c4
commit
3c780e1d10
25
src/winio.c
25
src/winio.c
|
@ -2817,19 +2817,25 @@ void edit_redraw(const filestruct *old_current, size_t old_pww)
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* If the mark is on, update all the lines between old_current
|
/* If the mark is on, update all the lines between old_current
|
||||||
* and the old last line of the edit window. */
|
* and either the old first line or old last line (depending on
|
||||||
|
* whether we've scrolled up or down) of the edit window. */
|
||||||
if (openfile->mark_set) {
|
if (openfile->mark_set) {
|
||||||
ssize_t old_last_lineno = (old_edittop->lineno +
|
ssize_t old_lineno;
|
||||||
editwinrows <= openfile->filebot->lineno) ?
|
|
||||||
|
if (old_edittop->lineno < openfile->edittop->lineno)
|
||||||
|
old_lineno = old_edittop->lineno;
|
||||||
|
else
|
||||||
|
old_lineno = (old_edittop->lineno + editwinrows <=
|
||||||
|
openfile->filebot->lineno) ?
|
||||||
old_edittop->lineno + editwinrows :
|
old_edittop->lineno + editwinrows :
|
||||||
openfile->filebot->lineno;
|
openfile->filebot->lineno;
|
||||||
|
|
||||||
foo = old_current;
|
foo = old_current;
|
||||||
|
|
||||||
while (foo->lineno != old_last_lineno) {
|
while (foo->lineno != old_lineno) {
|
||||||
update_line(foo, 0);
|
update_line(foo, 0);
|
||||||
|
|
||||||
foo = (foo->lineno > old_last_lineno) ? foo->prev :
|
foo = (foo->lineno > old_lineno) ? foo->prev :
|
||||||
foo->next;
|
foo->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2861,13 +2867,14 @@ void edit_redraw(const filestruct *old_current, size_t old_pww)
|
||||||
edit_scroll(DOWN, nlines);
|
edit_scroll(DOWN, nlines);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* If the mark is on, update all the lines between the old last
|
/* If the mark is on, update all the lines between the old first
|
||||||
* line of the edit window and edittop. */
|
* line or old last line of the edit window (depending on
|
||||||
|
* whether we've scrolled up or down) and current. */
|
||||||
if (openfile->mark_set) {
|
if (openfile->mark_set) {
|
||||||
while (foo != openfile->edittop) {
|
while (foo->lineno != openfile->current->lineno) {
|
||||||
update_line(foo, 0);
|
update_line(foo, 0);
|
||||||
|
|
||||||
foo = (foo->lineno > openfile->edittop->lineno) ?
|
foo = (foo->lineno > openfile->current->lineno) ?
|
||||||
foo->prev : foo->next;
|
foo->prev : foo->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue