mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
6b827bb664
commit
55821948cf
@ -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'
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user