diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-23 17:41:26 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-23 17:41:26 +0200 |
commit | 789679cfc4f39505b135220672b43a260d8ca3b4 (patch) | |
tree | e31f7adc916fabe18f381ca0a488cf7b756a991f /src/testdir | |
parent | cd79f8fbd34cdb918153d9fa3821eb4092b7b5fc (diff) |
patch 9.1.0436: Crash when using '?' as separator for :sv9.1.0436
Problem: Crash when using '?' as separator for :s and pattern contains
escaped '?'s (after 9.1.0409).
Solution: Always compute startplen. (zeertzjq).
related: neovim/neovim#28935
closes: 14832
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_substitute.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim index cf2c73fb95..a2367cd233 100644 --- a/src/testdir/test_substitute.vim +++ b/src/testdir/test_substitute.vim @@ -173,6 +173,16 @@ func Test_substitute_repeat() call feedkeys("Qsc\<CR>y", 'tx') bwipe! endfunc + +" Test :s with ? as separator. +func Test_substitute_question_separator() + new + call setline(1, '??:??') + %s?\?\??!!?g + call assert_equal('!!:!!', getline(1)) + bwipe! +endfunc + " Test %s/\n// which is implemented as a special case to use a " more efficient join rather than doing a regular substitution. func Test_substitute_join() |