commit f8c75c43eda338a737a739a7359a9d6f6b82592c
parent af20d45bc132c9b9eaa27c3b79dd13a7a7f0a148
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 16 Oct 2017 15:02:53 -0500
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.
Diffstat:
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/search.c b/src/search.c
@@ -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 */