Tuesday, January 25, 2011

Re: Two search patterns

On 01/24/2011 11:01 AM, Christian Brabandt wrote:
> Here is a patch:
> diff --git a/src/search.c b/src/search.c
> --- a/src/search.c
> +++ b/src/search.c
> @@ -1161,9 +1161,13 @@
> {
> if (spats[RE_SEARCH].pat == NULL) /* no previous pattern */
> {
> - EMSG(_(e_noprevre));
> - retval = 0;
> - goto end_do_search;
> + pat = last_search_pat();
> + if (pat == NULL)
> + {
> + EMSG(_(e_noprevre));
> + retval = 0;
> + goto end_do_search;
> + }
> }
> /* make search_regcomp() use spats[RE_SEARCH].pat */
> searchstr = (char_u *)"";

Christian,

Thanks -- I figured it was a mere couple lines of code to fix,
though I guess the meta-question also pertained to "what's the
right behavior?" My leaning is that the patch is for the better
and should go live (instead of documenting the weirdness). I see
you CC'd vim-dev (where I don't subscribe, so am not CCing), so
I'd be interested in others' thoughts.

Thanks again!

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: