diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-29 20:44:23 -0500 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-29 21:00:11 -0500 |
| commit | 31f31b40a8af67a3a55e85fa5dfa63d5a5999acc (patch) | |
| tree | 705f39a1649e74e8fd0b107f2f5dca9349bc4bb1 /src/nvim/testdir | |
| parent | f719b8898ba8aa18f0411be1924eea132a3b103e (diff) | |
| download | rneovim-31f31b40a8af67a3a55e85fa5dfa63d5a5999acc.tar.gz rneovim-31f31b40a8af67a3a55e85fa5dfa63d5a5999acc.tar.bz2 rneovim-31f31b40a8af67a3a55e85fa5dfa63d5a5999acc.zip | |
vim-patch:8.2.0077: settagstack() cannot truncate at current index
Problem: settagstack() cannot truncate at current index.
Solution: Add the "t" action. (Yegappan Lakshmanan, closes vim/vim#5417)
https://github.com/vim/vim/commit/271fa08a35b8d320d3a40db4ddae83b698fdd4fb
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_tagjump.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim index fe98ef1ae2..5fd71d8bfc 100644 --- a/src/nvim/testdir/test_tagjump.vim +++ b/src/nvim/testdir/test_tagjump.vim @@ -340,6 +340,28 @@ func Test_getsettagstack() \ {'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 'a') call assert_equal('abc', gettagstack().items[19].tagname) + " truncate the tag stack + call settagstack(1, + \ {'curidx' : 9, + \ 'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 't') + let t = gettagstack() + call assert_equal(9, t.length) + call assert_equal(10, t.curidx) + + " truncate the tag stack without pushing any new items + call settagstack(1, {'curidx' : 5}, 't') + let t = gettagstack() + call assert_equal(4, t.length) + call assert_equal(5, t.curidx) + + " truncate an empty tag stack and push new items + call settagstack(1, {'items' : []}) + call settagstack(1, + \ {'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 't') + let t = gettagstack() + call assert_equal(1, t.length) + call assert_equal(2, t.curidx) + " Tag with multiple matches call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", \ "two\tXfile1\t1", |