Use search pattern as delimiter if empty regex is given

Close #78
This commit is contained in:
Junegunn Choi
2016-03-06 13:47:17 +09:00
parent dd98d0a895
commit 0cb6b98fc1
2 changed files with 12 additions and 3 deletions

View File

@@ -829,10 +829,11 @@ function! s:valid_regexp(regexp)
endfunction
function! s:test_regexp(regexp)
if !s:valid_regexp(a:regexp)
call s:exit('Invalid regular expression: '. a:regexp)
let regexp = empty(a:regexp) ? @/ : a:regexp
if !s:valid_regexp(regexp)
call s:exit('Invalid regular expression: '. regexp)
endif
return a:regexp
return regexp
endfunction
let s:shorthand_regex =