- Add support for reading in UTF-8 sequences to the low-level
input routines. Changes to get_kbinput() and
get_translated_kbinput(). (DLR)
- - Reduce search_last_line to a local variable in findnextstr(),
- since it's always set to FALSE just before and after
- findnextstr() is called and isn't used anywhere except in
- findnextstr(). Changes to do_int_spell_fix(), findnextstr(),
- do_search(), do_research(), do_replace(), and
- do_find_bracket(). (DLR)
+ - Reduce search_last_line to a static variable in search.c, and
+ allow it to be set to FALSE via a function. New function
+ findnextstr_wrap_reset(); changes to do_int_spell_fix(),
+ findnextstr(), do_search(), do_research(), do_replace_loop(),
+ do_replace(), and do_find_bracket(). (DLR, problem with making
+ search_last_line local to findnextstr() found by Rocco)
- When saving or changing file positions, be sure not to ignore
placewewant. Changes to do_int_spell_fix(), findnextstr(),
do_replace_loop(), and do_replace(). (DLR)
placewewant = 0;
/* Find the first whole-word occurrence of word. */
+ findnextstr_wrap_reset();
while (findnextstr(TRUE, TRUE, FALSE, fileage, 0, word, NULL)) {
if (is_whole_word(current_x, current->data, word)) {
edit_refresh();
bool findnextstr(bool can_display_wrap, bool wholeword, bool
no_sameline, const filestruct *begin, size_t beginx, const char
*needle, size_t *needle_len);
+void findnextstr_wrap_reset(void);
void do_search(void);
#ifndef NANO_SMALL
void do_research(void);
#include "proto.h"
#include "nano.h"
+static bool search_last_line = FALSE;
+ /* Have we gone past the last line while searching? */
#ifdef HAVE_REGEX_H
static bool regexp_compiled = FALSE;
/* Have we compiled any regular expressions? */
size_t current_x_find = 0;
/* The location of the match we found. */
int current_y_find = current_y;
- bool search_last_line = FALSE;
- /* Have we gone past the last line while searching? */
/* rev_start might end up 1 character before the start or after the
* end of the line. This won't be a problem because strstrwrapper()
return TRUE;
}
+void findnextstr_wrap_reset(void)
+{
+ search_last_line = FALSE;
+}
+
/* Search for a string. */
void do_search(void)
{
update_history(&search_history, answer);
#endif
+ findnextstr_wrap_reset();
didfind = findnextstr(TRUE, FALSE, FALSE, current, current_x,
answer, NULL);
return;
#endif
+ findnextstr_wrap_reset();
didfind = findnextstr(TRUE, FALSE, FALSE, current, current_x,
last_search, NULL);
if (canceled != NULL)
*canceled = FALSE;
+ findnextstr_wrap_reset();
while (findnextstr(TRUE, wholewords,
#ifdef HAVE_REGEX_H
/* We should find a bol and/or eol regex only once per line. If
/* We constructed regexp_pat to be a valid expression. */
assert(regexp_compiled);
+ findnextstr_wrap_reset();
while (TRUE) {
if (findnextstr(FALSE, FALSE, FALSE, current, current_x,
regexp_pat, NULL)) {