commit 0532296a101482b451df072e481b043d3dc6b915
parent 443a766fe292c648fe267674d3dac72fcc8b3a43
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 14 Jul 2005 23:51:52 +0000
more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2864 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -96,8 +96,9 @@ CVS code -
do_replace()
- Blank out last_replace properly again just before displaying
the "Replace" prompt. (DLR, found by Mike Frysinger)
+ - Remove unnecessary renumber(). (DLR)
- winio.c:
- edit_scroll()
+ edit_scroll(), edit_refresh()
- Clean up and simplify. (DLR)
do_statusbar_next_word()
- Rework to be more like do_statusbar_prev_word(), to avoid a
diff --git a/src/nano.c b/src/nano.c
@@ -191,7 +191,7 @@ void renumber(filestruct *fileptr)
assert(fileptr != fileptr->next);
for (; fileptr != NULL; fileptr = fileptr->next)
- fileptr->lineno = line++;
+ fileptr->lineno = ++line;
}
/* Partition a filestruct so it begins at (top, top_x) and ends at (bot,
diff --git a/src/search.c b/src/search.c
@@ -956,7 +956,6 @@ void do_replace(void)
openfile->current_x = begin_x;
openfile->placewewant = pww_save;
- renumber(openfile->fileage);
edit_refresh();
if (numreplaced >= 0)
diff --git a/src/winio.c b/src/winio.c
@@ -3624,13 +3624,11 @@ void edit_refresh(void)
fprintf(stderr, "edit_refresh(): edittop->lineno = %ld\n", (long)openfile->edittop->lineno);
#endif
- while (nlines < editwinrows) {
+ while (nlines < editwinrows && foo != NULL) {
update_line(foo, (foo == openfile->current) ?
openfile->current_x : 0);
- nlines++;
- if (foo->next == NULL)
- break;
foo = foo->next;
+ nlines++;
}
while (nlines < editwinrows) {
blank_line(edit, nlines, 0, COLS);