aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/arglist_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
committerZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
commit043d8ff9f2389f8deab7934aa0ab4ce88a747f01 (patch)
tree4d6fa32d7c1ddaa99c15f80c1a4ba95d5f3ca2da /test/functional/legacy/arglist_spec.lua
parent5992cdf3c27ee9c73cea22e288c6ea6d54867394 (diff)
parent13352c00f1909d9296c5f276a3735f5e6f231b39 (diff)
downloadrneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.gz
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.bz2
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.zip
Merge branch 'master' into luaviml'/lua
Diffstat (limited to 'test/functional/legacy/arglist_spec.lua')
-rw-r--r--test/functional/legacy/arglist_spec.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua
index f5e3522972..b9075620dc 100644
--- a/test/functional/legacy/arglist_spec.lua
+++ b/test/functional/legacy/arglist_spec.lua
@@ -269,4 +269,33 @@ describe('argument list commands', function()
eq(0, eval('argidx()'))
execute('%argd')
end)
+
+
+ it('test for autocommand that redefines the argument list, when doing ":all"', function()
+ execute('autocmd BufReadPost Xxx2 next Xxx2 Xxx1')
+ execute("call writefile(['test file Xxx1'], 'Xxx1')")
+ execute("call writefile(['test file Xxx2'], 'Xxx2')")
+ execute("call writefile(['test file Xxx3'], 'Xxx3')")
+
+ execute('new')
+ -- redefine arglist; go to Xxx1
+ execute('next! Xxx1 Xxx2 Xxx3')
+ -- open window for all args
+ execute('all')
+ eq('test file Xxx1', eval('getline(1)'))
+ execute('wincmd w')
+ execute('wincmd w')
+ eq('test file Xxx1', eval('getline(1)'))
+ -- should now be in Xxx2
+ execute('rewind')
+ eq('test file Xxx2', eval('getline(1)'))
+
+ execute('autocmd! BufReadPost Xxx2')
+ execute('enew! | only')
+ execute("call delete('Xxx1')")
+ execute("call delete('Xxx2')")
+ execute("call delete('Xxx3')")
+ execute('argdelete Xxx*')
+ execute('bwipe! Xxx1 Xxx2 Xxx3')
+ end)
end)