From 1573aa0b0a0a17da93e4fb2220fd5d6ecbd6d267 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 12:26:03 +0200 Subject: vim-patch:7.4.1119 Problem: argidx() has a wrong value after ":%argdelete". (Yegappan Lakshmanan) Solution: Correct the value of w_arg_idx. Add a test. https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e --- test/functional/legacy/arglist_spec.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/functional/legacy/arglist_spec.lua (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua new file mode 100644 index 0000000000..a569479b62 --- /dev/null +++ b/test/functional/legacy/arglist_spec.lua @@ -0,0 +1,31 @@ +-- Test argument list commands + +local helpers = require('test.functional.helpers') +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local execute, expect = helpers.execute, helpers.expect +local eq, eval = helpers.eq, helpers.eval + +describe('argument list commands', function() + before_each(clear) + + it('is working', function() + execute('args a b c') + execute('last') + eq(2, eval('argidx()')) + execute('%argdelete') + eq(0, eval('argidx()')) + + execute('args a b c') + eq(0, eval('argidx()')) + execute('next') + eq(1, eval('argidx()')) + execute('next') + eq(2, eval('argidx()')) + execute('1argdelete') + eq(1, eval('argidx()')) + execute('1argdelete') + eq(0, eval('argidx()')) + execute('1argdelete') + eq(0, eval('argidx()')) + end) +end) -- cgit