[2692] in BarnOwl Developers
[PATCH] If popless:start-search is passed "", continue search
daemon@ATHENA.MIT.EDU (David Benjamin)
Thu Sep 30 20:24:24 2010
From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Thu, 30 Sep 2010 20:24:19 -0400
Matches behavior with pressing / RET in both the recwin and less itself.
Reported-By: Anders Kaseorg <andersk@mit.edu>
---
viewwin.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/viewwin.c b/viewwin.c
index 4a97c74..32effdb 100644
--- a/viewwin.c
+++ b/viewwin.c
@@ -172,11 +172,17 @@ typedef struct _owl_viewwin_search_data { /*noproto*/
static void owl_viewwin_callback_search(owl_editwin *e)
{
+ int consider_current = false;
const char *line = owl_editwin_get_text(e);
owl_viewwin_search_data *data = owl_editwin_get_cbdata(e);
- owl_function_set_search(line);
+
+ /* Given an empty string, just continue the current search. */
+ if (line && *line) {
+ owl_function_set_search(line);
+ consider_current = true;
+ }
if (!owl_viewwin_search(data->v, owl_global_get_search_re(&g),
- true, data->direction))
+ consider_current, data->direction))
owl_function_error("No matches");
}
--
1.7.3.1.g716de