diff --git a/search.c b/search.c
index a14cb60c60edfe8147934b872622f8ca5d897e73..41dcfdb523dd26097823263e47938a5e6e6d6b10 100644
--- a/search.c
+++ b/search.c
@@ -136,11 +136,11 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
     /* Look for searchstr until EOF */
     while (fileptr != NULL &&
 	   (found = strstrwrapper(searchstr, needle)) == NULL) {
-	if (!past_editbot && (fileptr == editbot))
-	    past_editbot = 1;
 
 	fileptr = fileptr->next;
 
+	if (!past_editbot && (fileptr == editbot))
+	    past_editbot = 1;
 
 	if (fileptr == begin)
 	    return NULL;
@@ -179,8 +179,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
 	    for (tmp = fileptr->data; tmp != found; tmp++)
 		current_x++;
 
-	    if (past_editbot)
-		edit_update(current);
+	    edit_update(current);
 	    reset_cursor();
 
 	    if (!quiet)