in the same short and quick way as above.
* src/nano.c (main): Initialize the search and replace strings in
a central place, to get rid of a bunch of ifs.
+ * src/search.c (search_init_globals): Elide this tiny function.
2015-04-20 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (need_horizontal_update, need_vertical_update): Fuse
#endif
void not_found_msg(const char *str);
void search_replace_abort(void);
-void search_init_globals(void);
int search_init(bool replacing, bool use_answer);
bool findnextstr(
#ifndef DISABLE_SPELLER
#endif
}
-/* Initialize the global search and replace strings. */
-void search_init_globals(void)
-{
- focusing = TRUE;
-}
-
/* Set up the system variables for a search or replace. If use_answer
* is TRUE, only set backupstring to answer. Return -2 to run the
* opposite program (search -> replace, replace -> search), return -1 if
* do_search() or do_replace() and be called again. In that case,
* we should put the same search string back up. */
- search_init_globals();
+ focusing = TRUE;
if (last_search[0] != '\0') {
char *disp = display_string(last_search, 0, COLS / 3, FALSE);
size_t pww_save = openfile->placewewant;
bool didfind;
- search_init_globals();
+ focusing = TRUE;
if (last_search[0] != '\0') {
#ifdef HAVE_REGEX_H
#endif
/* Save the current search/replace strings. */
- search_init_globals();
save_search = last_search;
save_replace = last_replace;
last_search = mallocstrcpy(NULL, word);
last_replace = mallocstrcpy(NULL, word);
+ focusing = TRUE;
+
#ifndef NANO_TINY
if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it