Eliding another tiny function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5213 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
1cf22d4d4f
commit
ca1983adb4
|
@ -7,6 +7,7 @@
|
|||
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
|
||||
|
|
|
@ -579,7 +579,6 @@ void regexp_cleanup(void);
|
|||
#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
|
||||
|
|
10
src/search.c
10
src/search.c
|
@ -116,12 +116,6 @@ void search_replace_abort(void)
|
|||
#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
|
||||
|
@ -153,7 +147,7 @@ int search_init(bool replacing, bool use_answer)
|
|||
* 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);
|
||||
|
@ -496,7 +490,7 @@ void do_research(void)
|
|||
size_t pww_save = openfile->placewewant;
|
||||
bool didfind;
|
||||
|
||||
search_init_globals();
|
||||
focusing = TRUE;
|
||||
|
||||
if (last_search[0] != '\0') {
|
||||
#ifdef HAVE_REGEX_H
|
||||
|
|
|
@ -2356,7 +2356,6 @@ bool do_int_spell_fix(const char *word)
|
|||
#endif
|
||||
|
||||
/* Save the current search/replace strings. */
|
||||
search_init_globals();
|
||||
save_search = last_search;
|
||||
save_replace = last_replace;
|
||||
|
||||
|
@ -2364,6 +2363,8 @@ bool do_int_spell_fix(const char *word)
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue