From 43b418cd55954230df86bb3538c21f86ace32e17 Mon Sep 17 00:00:00 2001 From: othree Date: Thu, 21 Feb 2013 00:52:26 +0800 Subject: [PATCH] Fix #2, set v:searchforward outside function --- plugin/eregex.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/eregex.vim b/plugin/eregex.vim index db7800e..969a229 100644 --- a/plugin/eregex.vim +++ b/plugin/eregex.vim @@ -209,7 +209,7 @@ let loaded_eregex=1 "============================================================================= "Commands And Mappings: command! -nargs=? -range E2v :,call ExtendedRegex2VimRegexLineWise() -command! -nargs=? M :call Ematch() +command! -nargs=? -count M :let v:searchforward = Ematch() "command! -nargs=? -range S :,call Esubstitute() command! -nargs=? -range S :,call Esubstitute() :noh @@ -727,6 +727,11 @@ function! s:Ematch(...) echo v:errmsg endif + if delim == '?' + return 0 + else + return 1 + endif endfunction "end s:Ematch() "-----------------------------------------------------------------------------