mirror of
https://github.com/neovim/neovim.git
synced 2026-05-01 11:34:56 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user