mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
updated for version 7.4.241
Problem: The string returned by submatch() does not distinguish between a
NL from a line break and a NL that stands for a NUL character.
Solution: Add a second argument to return a list. (ZyX)
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -117,6 +117,7 @@ STARTTEST
|
||||
:let y = substitute('jJj', 'J', '\=substitute(submatch(0), ".", "\\n", "")', '') | $put =y
|
||||
:let y = substitute('kKk', 'K', '\=substitute(submatch(0), ".", "\r", "")', '') | $put =y
|
||||
:let y = substitute('lLl', 'L', '\=substitute(submatch(0), ".", "\n", "")', '') | $put =y
|
||||
/^TEST_5
|
||||
ENDTEST
|
||||
|
||||
TEST_5:
|
||||
@@ -142,6 +143,7 @@ STARTTEST
|
||||
:$put =substitute('C', 'C', 'c', '')
|
||||
:$put =substitute('D', 'D', '%', '')
|
||||
/^TEST_7
|
||||
ENDTEST
|
||||
|
||||
TEST_7:
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ l
|
||||
a\a
|
||||
b\b
|
||||
c
|
||||
c
|
||||
d
|
||||
d
|
||||
e\
|
||||
@@ -103,6 +104,8 @@ TEST_7:
|
||||
l
|
||||
l
|
||||
|
||||
|
||||
TEST_5:
|
||||
A123456789987654321
|
||||
[['A123456789'], ['9'], ['8'], ['7'], ['6'], ['5'], ['4'], ['3'], ['2'], ['1']]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user