nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 2a4ef924c8c924852356535a646ff2b85636697b
parent a4d2162091a12bb7bdc500d5d77a804e78b21d95
Author: Adam Rogoyski <rogoyski@cs.utexas.edu>
Date:   Sun,  9 Jul 2000 00:15:11 +0000

- 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

Diffstat:
Msearch.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/search.c b/search.c @@ -128,6 +128,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) { filestruct *fileptr; char *searchstr, *found = NULL, *tmp; + int past_editbot = 0; fileptr = current; @@ -135,8 +136,12 @@ 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 (fileptr == begin) return NULL; @@ -151,7 +156,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) for (tmp = fileptr->data; tmp != found; tmp++) current_x++; - edit_update(current); + if (past_editbot) + edit_update(current); reset_cursor(); } else { /* We're at EOF, go back to the top, once */ @@ -173,7 +179,8 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle) for (tmp = fileptr->data; tmp != found; tmp++) current_x++; - edit_update(current); + if (past_editbot) + edit_update(current); reset_cursor(); if (!quiet)