Mercurial > vim
comparison src/testdir/test_substitute.vim @ 16686:6ea3f93b4428 v8.1.1345
patch 8.1.1345: stuck in sandbox with ":s/../=Function/gn"
commit https://github.com/vim/vim/commit/6349e9411fd17f80c7aff9c678a8800647d34cfa
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 18 13:41:22 2019 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 May 2019 13:45:04 +0200 |
parents | aebcd20a8a3f |
children | 5a541d459ef7 |
comparison
equal
deleted
inserted
replaced
16685:8afb13c6a0d9 | 16686:6ea3f93b4428 |
---|---|
636 let error_caught = 1 | 636 let error_caught = 1 |
637 endtry | 637 endtry |
638 call assert_equal(1, error_caught) | 638 call assert_equal(1, error_caught) |
639 call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3)) | 639 call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3)) |
640 | 640 |
641 " Same, but using "n" flag so that "sandbox" gets set | |
642 call setline(1, ['1 aaa', '2 aaa', '3 aaa']) | |
643 let error_caught = 0 | |
644 try | |
645 %s/aaa/\=Foo()/gn | |
646 catch | |
647 let error_caught = 1 | |
648 endtry | |
649 call assert_equal(1, error_caught) | |
650 call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3)) | |
651 | |
641 bwipe! | 652 bwipe! |
642 endfunc | 653 endfunc |
643 | 654 |
644 " Test ":s/pat/sub/" with different ~s in sub. | 655 " Test ":s/pat/sub/" with different ~s in sub. |
645 func Test_replace_with_tilde() | 656 func Test_replace_with_tilde() |