Commit 2a4ef924 authored by Adam Rogoyski's avatar Adam Rogoyski
Browse files

- change findnextstr() to only edit_update if we have gone off the screen.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@95 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent a4d21620
Showing with 9 additions and 2 deletions
+9 -2
...@@ -128,6 +128,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) ...@@ -128,6 +128,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
{ {
filestruct *fileptr; filestruct *fileptr;
char *searchstr, *found = NULL, *tmp; char *searchstr, *found = NULL, *tmp;
int past_editbot = 0;
fileptr = current; fileptr = current;
...@@ -135,8 +136,12 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) ...@@ -135,8 +136,12 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
/* Look for searchstr until EOF */ /* Look for searchstr until EOF */
while (fileptr != NULL && while (fileptr != NULL &&
(found = strstrwrapper(searchstr, needle)) == NULL) { (found = strstrwrapper(searchstr, needle)) == NULL) {
if (!past_editbot && (fileptr == editbot))
past_editbot = 1;
fileptr = fileptr->next; fileptr = fileptr->next;
if (fileptr == begin) if (fileptr == begin)
return NULL; return NULL;
...@@ -151,7 +156,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) ...@@ -151,7 +156,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
for (tmp = fileptr->data; tmp != found; tmp++) for (tmp = fileptr->data; tmp != found; tmp++)
current_x++; current_x++;
edit_update(current); if (past_editbot)
edit_update(current);
reset_cursor(); reset_cursor();
} else { /* We're at EOF, go back to the top, once */ } else { /* We're at EOF, go back to the top, once */
...@@ -173,7 +179,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) ...@@ -173,7 +179,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
for (tmp = fileptr->data; tmp != found; tmp++) for (tmp = fileptr->data; tmp != found; tmp++)
current_x++; current_x++;
edit_update(current); if (past_editbot)
edit_update(current);
reset_cursor(); reset_cursor();
if (!quiet) if (!quiet)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment