Add option g:eregex_force_case

This commit is contained in:
othree 2015-01-23 13:27:47 +08:00
parent 543ff4c2cb
commit 574091de5d

View File

@ -295,6 +295,12 @@ if !exists('g:eregex_backward_delim')
let g:eregex_backward_delim = '?' let g:eregex_backward_delim = '?'
endif endif
"v262
if !exists('g:eregex_force_case')
let g:eregex_force_case = 0
endif
let s:enable = 0 let s:enable = 0
function! eregex#toggle(...) function! eregex#toggle(...)
@ -742,6 +748,12 @@ function! s:Ematch(...)
let offset = substitute(offset, '\C[' . s:str_modifiers . ']\+', "", "g") let offset = substitute(offset, '\C[' . s:str_modifiers . ']\+', "", "g")
endif endif
if g:eregex_force_case == 1
if match(modifiers, 'i') == -1 && match(modifiers, 'I') == -1
let modifiers .= 'I'
endif
endif
let regex = s:ExtendedRegex2VimRegex(regex, modifiers) let regex = s:ExtendedRegex2VimRegex(regex, modifiers)
"v130 "v130
"set s:bakregex "set s:bakregex
@ -803,6 +815,12 @@ function! s:Esubstitute(...) range
let options = substitute(options, '\C[SCDmM]', "", "g") let options = substitute(options, '\C[SCDmM]', "", "g")
endif endif
if g:eregex_force_case == 1
if match(modifiers, 'i') == -1 && match(modifiers, 'I') == -1
let modifiers .= 'I'
endif
endif
let regex = s:ExtendedRegex2VimRegex(regex, modifiers) let regex = s:ExtendedRegex2VimRegex(regex, modifiers)
"v130 "v130
"set s:bakregex "set s:bakregex