correctly handle &ignorecase and &smartcase (re-fixes #4 and #7)

before (breaks &smartcase):

    default modifier to /i if &ignorecase and not /I

after (honours &ignorecase and &smartcase):

    no default modifier i.e. vim default
    override defaults with (?i), (?I), \c, \C, /i and /I
This commit is contained in:
chocolateboy 2015-01-17 06:45:23 +00:00
parent 64c2e53af2
commit 134ba2be25

View File

@ -742,10 +742,6 @@ function! s:Ematch(...)
let offset = substitute(offset, '\C[' . s:str_modifiers . ']\+', "", "g")
endif
if &ignorecase && match(modifiers, 'I') == -1
let modifiers .= 'i'
endif
let regex = s:ExtendedRegex2VimRegex(regex, modifiers)
"v130
"set s:bakregex
@ -806,9 +802,6 @@ function! s:Esubstitute(...) range
let modifiers = substitute(options, '\C[^' . s:str_modifiers . ']\+', "", "g")
let options = substitute(options, '\C[SCDmM]', "", "g")
endif
if &ignorecase && match(modifiers, 'I') == -1
let modifiers .= 'i'
endif
let regex = s:ExtendedRegex2VimRegex(regex, modifiers)
"v130