Mercurial > vim
comparison src/testdir/test_substitute.vim @ 33197:f17604cf816b v9.0.1877
patch 9.0.1877: missing test for patch 9.0.1873
Commit: https://github.com/vim/vim/commit/18d2709aa12ffa3f6ae1a13059990558c5f8e406
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Sep 6 19:53:36 2023 +0200
patch 9.0.1877: missing test for patch 9.0.1873
Problem: missing test for patch 9.0.1873
Solution: add a test trying to exchange windows
Add a test, making sure that switching windows is not allowed when
textlock is active, e.g. when running `:s/<pat>/\=func()/`
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 06 Sep 2023 20:15:08 +0200 |
parents | 695b50472e85 |
children | def9fc5c92d1 |
comparison
equal
deleted
inserted
replaced
33196:8bc48ca90534 | 33197:f17604cf816b |
---|---|
1437 endfunc | 1437 endfunc |
1438 silent! s/\%')/\=SubExpr() | 1438 silent! s/\%')/\=SubExpr() |
1439 delfunc SubExpr | 1439 delfunc SubExpr |
1440 endfunc | 1440 endfunc |
1441 | 1441 |
1442 func Test_substitute_expr_switch_win() | |
1443 func R() | |
1444 wincmd x | |
1445 return 'XXXX' | |
1446 endfunc | |
1447 new Xfoobar | |
1448 let bufnr = bufnr('%') | |
1449 put ="abcdef" | |
1450 silent! s/\%')/\=R() | |
1451 call assert_fails(':%s/./\=R()/g', 'E565') | |
1452 delfunc R | |
1453 exe bufnr .. "bw!" | |
1454 endfunc | |
1455 | |
1442 " vim: shiftwidth=2 sts=2 expandtab | 1456 " vim: shiftwidth=2 sts=2 expandtab |