othree / eregex.vim

Perl/Ruby style regexp notation for Vim
http://www.vim.org/scripts/script.php?script_id=3282
214 stars 18 forks source link

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

Closed chocolateboy closed 9 years ago

chocolateboy commented 9 years ago

before (breaks &smartcase):

after (honours &ignorecase and &smartcase):

othree commented 9 years ago

I think I should remove both &ignorecase and &smartcase to match perl re. But keep an option to let user have a choice(your pr). What do you think about it?

chocolateboy commented 9 years ago

I think the behaviour implemented in this pull request should be the default, since I have things set up to DWIM with &ignorecase and &smartcase and the current behaviour breaks this.

Also, this PR implements the behaviour requested in #4 and doesn't break #7, whereas the current version doesn't fully implement #4 (because it breaks &smartcase). IMO, in this context, preserving vim compatibility is more important than preserving Perl compatibility. After all, we can change vim's settings, but we can't change perl's defaults (not in vim, at least).

That said, I don't mind if the behaviour in this PR is enabled by an option. I just think the other way round makes more sense :-)

othree commented 9 years ago

I will add an option in case people want to match all lowercase and follow perl re

chocolateboy commented 9 years ago

Thanks!