search: don't bother saving and restoring the search direction

Most people who make use of 'do_findprevious' and 'do_findnext'
will not make use of 'do_search' (the default binding of M-W),
so for them it is superfluous to remember the state of the
Backwards toggle in the Search menu.  For the people that do
mix the usage of Alt+Up/Down with M-W, it means that M-W will
always search in the same direction as the last search.  It is
a small change in behavior.
master
David Lawrence Ramsey 2017-10-16 15:02:53 -05:00 committed by Benno Schulenberg
parent af20d45bc1
commit f8c75c43ed
1 changed files with 4 additions and 13 deletions

View File

@ -392,24 +392,15 @@ void do_search_backward(void)
/* Search in the backward direction for the next occurrence. */
void do_findprevious(void)
{
if ISSET(BACKWARDS_SEARCH)
do_research();
else {
SET(BACKWARDS_SEARCH);
do_research();
UNSET(BACKWARDS_SEARCH);
}
SET(BACKWARDS_SEARCH);
do_research();
}
/* Search in the forward direction for the next occurrence. */
void do_findnext(void)
{
if ISSET(BACKWARDS_SEARCH) {
UNSET(BACKWARDS_SEARCH);
do_research();
SET(BACKWARDS_SEARCH);
} else
do_research();
UNSET(BACKWARDS_SEARCH);
do_research();
}
#endif /* !NANO_TINY */