summaryrefslogtreecommitdiff
path: root/src/testdir/test_global.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-10 14:29:52 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-10 14:29:52 +0200
commitf84b122a99da75741ae686fabb6f81b8b4755998 (patch)
tree617a26feddb25a746ec6aa89e6865ebb3f28138c /src/testdir/test_global.vim
parent6b1da3312e15c065b373c9ec2732f31a77cee61f (diff)
downloadvim-git-f84b122a99da75741ae686fabb6f81b8b4755998.tar.gz
patch 8.0.0630: it is not easy to work on lines without a matchv8.0.0630
Problem: The :global command does not work recursively, which makes it difficult to execute a command on a line where one pattern matches and another does not match. (Miles Cranmer) Solution: Allow for recursion if it is for only one line. (closes #1760)
Diffstat (limited to 'src/testdir/test_global.vim')
-rw-r--r--src/testdir/test_global.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/test_global.vim b/src/testdir/test_global.vim
index be8aa6962..bdeaf8e2c 100644
--- a/src/testdir/test_global.vim
+++ b/src/testdir/test_global.vim
@@ -9,3 +9,12 @@ func Test_yank_put_clipboard()
set clipboard&
bwipe!
endfunc
+
+func Test_nested_global()
+ new
+ call setline(1, ['nothing', 'found', 'found bad', 'bad'])
+ call assert_fails('g/found/3v/bad/s/^/++/', 'E147')
+ g/found/v/bad/s/^/++/
+ call assert_equal(['nothing', '++found', 'found bad', 'bad'], getline(1, 4))
+ bwipe!
+endfunc