mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-30 00:23:28 +03:00
tweaks: move the tyding-up-after-a-search to a single exit point
This commit is contained in:
parent
8720cfcce9
commit
f0bc94fd02
19
src/search.c
19
src/search.c
@ -114,9 +114,7 @@ void search_init(bool replacing, bool keep_the_answer)
|
||||
* nothing was searched for yet during this session, get out. */
|
||||
if (i == -1 || (i == -2 && *last_search == '\0')) {
|
||||
statusbar(_("Cancelled"));
|
||||
tidy_up_after_search();
|
||||
free(thedefault);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
/* If Enter was pressed, prepare to do a replace or a search. */
|
||||
@ -139,9 +137,7 @@ void search_init(bool replacing, bool keep_the_answer)
|
||||
go_looking();
|
||||
}
|
||||
|
||||
tidy_up_after_search();
|
||||
free(thedefault);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
func = func_from_key(&i);
|
||||
@ -157,20 +153,19 @@ void search_init(bool replacing, bool keep_the_answer)
|
||||
} else if (func == flip_replace) {
|
||||
if (ISSET(VIEW_MODE)) {
|
||||
print_view_warning();
|
||||
tidy_up_after_search();
|
||||
free(thedefault);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
replacing = !replacing;
|
||||
} else {
|
||||
if (func == flip_goto)
|
||||
do_gotolinecolumn(openfile->current->lineno,
|
||||
openfile->placewewant + 1, TRUE, TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tidy_up_after_search();
|
||||
free(thedefault);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Look for needle, starting at (current, current_x). begin is the line
|
||||
|
Loading…
Reference in New Issue
Block a user