vim-patch:8.1.0945: internal error when using pattern with NL in the range

Problem:    Internal error when using pattern with NL in the range.
Solution:   Use an actual newline for the range. (closes vim/vim#3989)  Also fix
            error message.  (Dominique Pelle)
a5483448cb
This commit is contained in:
Jan Edmund Lazo 2019-02-17 19:03:25 -05:00
parent 6b827bb664
commit 55821948cf
2 changed files with 10 additions and 1 deletions

View File

@ -1692,7 +1692,8 @@ collection:
MB_PTR_ADV(regparse);
if (*regparse == 'n')
startc = reg_string ? NL : NFA_NEWL;
startc = (reg_string || emit_range || regparse[1] == '-')
? NL : NFA_NEWL;
else if (*regparse == 'd'
|| *regparse == 'o'
|| *regparse == 'x'

View File

@ -30,3 +30,11 @@ func Test_equivalence_re2()
set re=2
call s:equivalence_test()
endfunc
func Test_range_with_newline()
new
call setline(1, "a")
call assert_equal(0, search("[ -*\\n- ]"))
call assert_equal(0, search("[ -*\\t-\\n]"))
bwipe!
endfunc