0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0938: NFA regexp uses tolower ()to compare ignore-case

Problem:    NFA regexp uses tolower() to compare ignore-case. (Thayne McCombs)
Solution:   Use utf_fold() when possible. (ref. neovim #12456)
This commit is contained in:
Bram Moolenaar
2020-06-09 19:34:54 +02:00
parent dcf59c37d0
commit 59de417b90
5 changed files with 30 additions and 8 deletions

View File

@@ -355,4 +355,23 @@ func Test_ambiwidth()
set regexpengine& ambiwidth&
endfunc
func Run_regexp_ignore_case()
call assert_equal('iIİ', substitute('iIİ', '\([iIİ]\)', '\1', 'g'))
call assert_equal('iIx', substitute('iIİ', '\c\([İ]\)', 'x', 'g'))
call assert_equal('xxİ', substitute('iIİ', '\(i\c\)', 'x', 'g'))
call assert_equal('iIx', substitute('iIİ', '\(İ\c\)', 'x', 'g'))
call assert_equal('iIx', substitute('iIİ', '\c\(\%u0130\)', 'x', 'g'))
call assert_equal('iIx', substitute('iIİ', '\c\([\u0130]\)', 'x', 'g'))
call assert_equal('iIx', substitute('iIİ', '\c\([\u012f-\u0131]\)', 'x', 'g'))
endfunc
func Test_regexp_ignore_case()
set regexpengine=1
call Run_regexp_ignore_case()
set regexpengine=2
call Run_regexp_ignore_case()
set regexpengine&
endfunc
" vim: shiftwidth=2 sts=2 expandtab