vim-patch:7.4.2355

Problem:    Regexp fails to match when using "\>\)\?". (Ramel)
Solution:   When a state is already in the list, but addstate_here() is used
            and the existing state comes later, add the new state anyway.

16b3578f35
This commit is contained in:
Justin M. Keyes
2017-03-21 13:11:10 +01:00
parent 53ccd07fa1
commit 929859ed81
3 changed files with 54 additions and 18 deletions

View File

@@ -97,3 +97,12 @@ func Test_recursive_substitute()
call setwinvar(1, 'myvar', 1)
bwipe!
endfunc
func Test_eow_with_optional()
let expected = ['abc def', 'abc', 'def', '', '', '', '', '', '', '']
for re in range(0, 2)
exe 'set re=' . re
let actual = matchlist('abc def', '\(abc\>\)\?\s*\(def\)')
call assert_equal(expected, actual)
endfor
endfunc