commit 7fdbd05b413364bb0f1cb017926f0b75a1605e5e
parent d948edc4f31f2c7ec91ea94d8f4c1ad3ca059eb7
Author: Chris Allegretta <chrisa@asty.org>
Date: Tue, 2 Oct 2001 00:55:38 +0000
Readded DISABLE_CURPOS cause we can't get away without it (Search Wrapped msgs) and Ken's findnextr fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@807 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -26,6 +26,9 @@ CVS code -
by DLR.
- Call do_gotopos from do_alt_spell() to keep position
consistent when invoking alt speller (DLR).
+ - Readded DISABLE_CURPOS because in certain instances (like
+ all the "Search Wrapper" lines) the cursor position will
+ be different yet we don't want the cursor position displayed.
- cut.c:
cut_marked_segment()
- Add magic line when cutting a selection including filebot
@@ -64,6 +67,8 @@ CVS code -
bracketed, free-standing modifiers that do not imply a grammar,
and the (to replace) string separately. Hopefully this resolves
the i18n problems that this provoked.
+ findnextstr()
+ - Various fixes that need testing (Ken Tyler).
- winio.c:
- Add David Lawrence Ramsey to credits.
bottombars()
diff --git a/nano.c b/nano.c
@@ -3023,7 +3023,9 @@ int main(int argc, char *argv[])
}
do_char(kbinput);
}
- if (ISSET(CONSTUPDATE))
+ if (ISSET(DISABLE_CURPOS))
+ UNSET(DISABLE_CURPOS);
+ else if (ISSET(CONSTUPDATE))
if (current != oldcurrent || current_x != oldcurrent_x)
do_cursorpos();
diff --git a/nano.h b/nano.h
@@ -143,6 +143,7 @@ typedef struct rcoption {
#define DOS_FILE (1<<21)
#define MAC_FILE (1<<22)
#define SMOOTHSCROLL (1<<23)
+#define DISABLE_CURPOS (1<<24) /* Damn, we still need it */
/* Control key sequences, changing these would be very very bad */
diff --git a/search.c b/search.c
@@ -242,11 +242,11 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
if (!ISSET(REVERSE_SEARCH)) { /* forward search */
current_x_find = current_x + 1;
-
- /* Are we now back to the line where the search started) */
+#if 0
+ /* Are we now back to the place where the search started) */
if ((fileptr == begin) && (beginx > current_x_find))
search_last_line = 1;
-
+#endif
/* Make sure we haven't passed the end of the string */
if (strlen(fileptr->data) < current_x_find)
current_x_find--;
@@ -265,7 +265,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
fileptr = fileptr->next;
- if (!past_editbuff && (fileptr == editbot))
+ if (fileptr == editbot)
past_editbuff = 1;
/* EOF reached ?, wrap around once */
@@ -274,8 +274,10 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
return NULL;
fileptr = fileage;
past_editbuff = 1;
- if (!quiet)
+ if (!quiet) {
statusbar(_("Search Wrapped"));
+ SET(DISABLE_CURPOS);
+ }
}
/* Original start line reached */
@@ -287,19 +289,19 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
/* We found an instance */
current_x_find = found - fileptr->data;
-
+#if 0
/* Ensure we haven't wrapped around again! */
if ((search_last_line) && (current_x_find >= beginx)) {
if (!quiet)
not_found_msg(needle);
return NULL;
}
-
+#endif
} else { /* reverse search */
current_x_find = current_x - 1;
- /* Are we now back to the line where the search started) */
+ /* Are we now back to the place where the search started) */
if ((fileptr == begin) && (current_x_find > beginx))
search_last_line = 1;
@@ -323,7 +325,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
fileptr = fileptr->prev;
-/* ? */ if (!past_editbuff && (fileptr == edittop->prev))
+ if (fileptr == edittop->prev)
past_editbuff = 1;
/* SOF reached ?, wrap around once */
@@ -332,8 +334,10 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
return NULL;
fileptr = filebot;
past_editbuff = 1;
- if (!quiet)
+ if (!quiet) {
statusbar(_("Search Wrapped"));
+ SET(DISABLE_CURPOS);
+ }
}
/* Original start line reached */
@@ -346,13 +350,14 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
/* We found an instance */
current_x_find = found - fileptr->data;
-
+#if 0
/* Ensure we haven't wrapped around again! */
if ((search_last_line) && (current_x_find < beginx)) {
if (!quiet)
not_found_msg(needle);
return NULL;
}
+#endif
}
/* Set globals now that we are sure we found something */