From 3574126b89b7162136e57a33fa5efccebefdaf37 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 18 May 2019 12:09:22 -0400 Subject: vim-patch:8.1.1345: stuck in sandbox with ":s/../\=Function/gn" Problem: Stuck in sandbox with ":s/../\=Function/gn". Solution: Don't skip over code to restore sandbox. (Christian Brabandt) https://github.com/vim/vim/commit/6349e9411fd17f80c7aff9c678a8800647d34cfa --- src/nvim/testdir/test_substitute.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim index e074a85530..8b306192f0 100644 --- a/src/nvim/testdir/test_substitute.vim +++ b/src/nvim/testdir/test_substitute.vim @@ -639,6 +639,17 @@ func Test_nocatch_sub_failure_handling() call assert_equal(1, error_caught) call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3)) + " Same, but using "n" flag so that "sandbox" gets set + call setline(1, ['1 aaa', '2 aaa', '3 aaa']) + let error_caught = 0 + try + %s/aaa/\=Foo()/gn + catch + let error_caught = 1 + endtry + call assert_equal(1, error_caught) + call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3)) + bwipe! endfunc -- cgit