[2695] in BarnOwl Developers
Re: [PATCH] If popless:start-search is passed "", continue search
daemon@ATHENA.MIT.EDU (Nelson Elhage)
Sat Oct 2 14:30:57 2010
From: Nelson Elhage <nelhage@MIT.EDU>
To: David Benjamin <davidben@mit.edu>, barnowl-dev@mit.edu
In-Reply-To: <1285892659-20100-1-git-send-email-davidben@mit.edu>
Date: Sat, 02 Oct 2010 14:30:54 -0400
lgtm. Should we maybe rename the function popless:search for
parallelism?
(In fact, it looks like the "usage" line for popless:start-search
already thinks it's called popless:search).
- Nelson
On Thu, 30 Sep 2010 20:24:19 -0400, David Benjamin <davidben@MIT.EDU> wrote:
> 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
>
>