aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2017-07-25 14:18:08 +0200
committerJames McCoy <jamessan@jamessan.com>2017-07-29 16:27:11 -0400
commitfe0bcc08003c82af7742636d3f7a95a1c91cf909 (patch)
tree10655943a978a072415b1447e07e4d0319ce68f3 /src/nvim/testdir
parentdc3c06e73dfd04948c59ea029daef1626e0386f8 (diff)
downloadrneovim-fe0bcc08003c82af7742636d3f7a95a1c91cf909.tar.gz
rneovim-fe0bcc08003c82af7742636d3f7a95a1c91cf909.tar.bz2
rneovim-fe0bcc08003c82af7742636d3f7a95a1c91cf909.zip
vim-patch:8.0.0020
Problem: The regexp engines are not reentrant. Solution: Add regexec_T and save/restore the state when needed. https://github.com/vim/vim/commit/6100d02aab7c8294b581cb299250eea164b50e9d
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_expr.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim
index 710eae9b8b..d32facaa98 100644
--- a/src/nvim/testdir/test_expr.vim
+++ b/src/nvim/testdir/test_expr.vim
@@ -384,9 +384,10 @@ func Test_substitute_expr()
\ {-> submatch(2) . submatch(3) . submatch(1)}, ''))
func Recurse()
- return substitute('yyy', 'y*', {-> g:val}, '')
+ return substitute('yyy', 'y\(.\)y', {-> submatch(1)}, '')
endfunc
- call assert_equal('--', substitute('xxx', 'x*', {-> '-' . Recurse() . '-'}, ''))
+ " recursive call works
+ call assert_equal('-y-x-', substitute('xxx', 'x\(.\)x', {-> '-' . Recurse() . '-' . submatch(1) . '-'}, ''))
endfunc
func Test_invalid_submatch()