comparison src/testdir/test_tagjump.vim @ 19033:f0312cf3c792 v8.2.0077

patch 8.2.0077: settagstack() cannot truncate at current index Commit: https://github.com/vim/vim/commit/271fa08a35b8d320d3a40db4ddae83b698fdd4fb Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 2 14:02:16 2020 +0100 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 https://github.com/vim/vim/issues/5417)
author Bram Moolenaar <Bram@vim.org>
date Thu, 02 Jan 2020 14:15:05 +0100
parents 068337e86133
children 8645b73b3645
comparison
equal deleted inserted replaced
19032:02dcaab77547 19033:f0312cf3c792
346 call assert_equal(20, gettagstack().length) 346 call assert_equal(20, gettagstack().length)
347 call settagstack(1, 347 call settagstack(1,
348 \ {'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 'a') 348 \ {'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 'a')
349 call assert_equal('abc', gettagstack().items[19].tagname) 349 call assert_equal('abc', gettagstack().items[19].tagname)
350 350
351 " truncate the tag stack
352 call settagstack(1,
353 \ {'curidx' : 9,
354 \ 'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 't')
355 let t = gettagstack()
356 call assert_equal(9, t.length)
357 call assert_equal(10, t.curidx)
358
359 " truncate the tag stack without pushing any new items
360 call settagstack(1, {'curidx' : 5}, 't')
361 let t = gettagstack()
362 call assert_equal(4, t.length)
363 call assert_equal(5, t.curidx)
364
365 " truncate an empty tag stack and push new items
366 call settagstack(1, {'items' : []})
367 call settagstack(1,
368 \ {'items' : [{'tagname' : 'abc', 'from' : [1, 10, 1, 0]}]}, 't')
369 let t = gettagstack()
370 call assert_equal(1, t.length)
371 call assert_equal(2, t.curidx)
372
351 " Tag with multiple matches 373 " Tag with multiple matches
352 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", 374 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
353 \ "two\tXfile1\t1", 375 \ "two\tXfile1\t1",
354 \ "two\tXfile2\t3", 376 \ "two\tXfile2\t3",
355 \ "two\tXfile3\t2"], 377 \ "two\tXfile3\t2"],