mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 04:41:21 +03:00
Eliding an unneeded variable and adjusting some wrappings and whitespace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5559 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
8f463778d1
commit
8a9f71639f
@ -2,6 +2,8 @@
|
|||||||
* doc/nanorc.sample.in: Remove a reference to an obsolete file.
|
* doc/nanorc.sample.in: Remove a reference to an obsolete file.
|
||||||
Reported by Mike Frysinger.
|
Reported by Mike Frysinger.
|
||||||
* src/winio.c (edit_redraw): Delete an 'if' that is always FALSE.
|
* src/winio.c (edit_redraw): Delete an 'if' that is always FALSE.
|
||||||
|
* src/winio.c (edit_redraw): Elide an unneeded variable and adjust
|
||||||
|
some wrappings and whitespace.
|
||||||
|
|
||||||
2016-01-13 Benno Schulenberg <bensberg@justemail.net>
|
2016-01-13 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/files.c (save_poshistory): Reduce the indentation.
|
* src/files.c (save_poshistory): Reduce the indentation.
|
||||||
|
20
src/winio.c
20
src/winio.c
@ -2977,10 +2977,9 @@ void edit_redraw(filestruct *old_current, size_t pww_save)
|
|||||||
/* If either old_current or current is offscreen, scroll the edit
|
/* If either old_current or current is offscreen, scroll the edit
|
||||||
* window until it's onscreen and get out. */
|
* window until it's onscreen and get out. */
|
||||||
if (old_current->lineno < openfile->edittop->lineno ||
|
if (old_current->lineno < openfile->edittop->lineno ||
|
||||||
old_current->lineno >= openfile->edittop->lineno +
|
old_current->lineno >= openfile->edittop->lineno + maxrows ||
|
||||||
maxrows || openfile->current->lineno <
|
openfile->current->lineno < openfile->edittop->lineno ||
|
||||||
openfile->edittop->lineno || openfile->current->lineno >=
|
openfile->current->lineno >= openfile->edittop->lineno + maxrows) {
|
||||||
openfile->edittop->lineno + maxrows) {
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "edit_redraw(): line %ld was offscreen, oldcurrent = %ld edittop = %ld",
|
fprintf(stderr, "edit_redraw(): line %ld was offscreen, oldcurrent = %ld edittop = %ld",
|
||||||
(long)openfile->current->lineno, (long)old_current->lineno, (long)openfile->edittop->lineno);
|
(long)openfile->current->lineno, (long)old_current->lineno, (long)openfile->edittop->lineno);
|
||||||
@ -2992,20 +2991,19 @@ void edit_redraw(filestruct *old_current, size_t pww_save)
|
|||||||
* whether we've scrolled up or down) of the edit window. */
|
* whether we've scrolled up or down) of the edit window. */
|
||||||
if (openfile->mark_set) {
|
if (openfile->mark_set) {
|
||||||
ssize_t old_lineno;
|
ssize_t old_lineno;
|
||||||
filestruct *old_edittop = openfile->edittop;
|
|
||||||
|
|
||||||
old_lineno = (old_edittop->lineno + maxrows <=
|
if (openfile->edittop->lineno + maxrows <= openfile->filebot->lineno)
|
||||||
openfile->filebot->lineno) ?
|
old_lineno = openfile->edittop->lineno + editwinrows;
|
||||||
old_edittop->lineno + editwinrows :
|
else
|
||||||
openfile->filebot->lineno;
|
old_lineno = openfile->filebot->lineno;
|
||||||
|
|
||||||
foo = old_current;
|
foo = old_current;
|
||||||
|
|
||||||
while (foo->lineno != old_lineno) {
|
while (foo->lineno != old_lineno) {
|
||||||
update_line(foo, 0);
|
update_line(foo, 0);
|
||||||
|
|
||||||
foo = (foo->lineno > old_lineno) ? foo->prev :
|
foo = (foo->lineno > old_lineno) ?
|
||||||
foo->next;
|
foo->prev : foo->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
Loading…
Reference in New Issue
Block a user