comparison src/testdir/test_tagjump.vim @ 16164:213b88f89597 v8.1.1087

patch 8.1.1087: tag stack is incorrect after CTRL-T and then :tag commit https://github.com/vim/vim/commit/7559dcef6cfd0ba13271088fff51b8979fee950b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 30 19:12:02 2019 +0100 patch 8.1.1087: tag stack is incorrect after CTRL-T and then :tag Problem: tag stack is incorrect after CTRL-T and then :tag Solution: Handle DT_TAG differently. (test by Andy Massimino, closes https://github.com/vim/vim/issues/3944, closes #4177)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Mar 2019 19:15:04 +0100
parents c338c91086b9
children a8689ea2e869
comparison
equal deleted inserted replaced
16163:9478a3d8b3f7 16164:213b88f89597
364 call delete('Xfile3') 364 call delete('Xfile3')
365 call delete('Xtags') 365 call delete('Xtags')
366 set tags& 366 set tags&
367 endfunc 367 endfunc
368 368
369 func Test_tag_with_count()
370 call writefile([
371 \ 'test Xtest.h /^void test();$/;" p typeref:typename:void signature:()',
372 \ ], 'Xtags')
373 call writefile([
374 \ 'main Xtest.c /^int main()$/;" f typeref:typename:int signature:()',
375 \ 'test Xtest.c /^void test()$/;" f typeref:typename:void signature:()',
376 \ ], 'Ytags')
377 cal writefile([
378 \ 'int main()',
379 \ 'void test()',
380 \ ], 'Xtest.c')
381 cal writefile([
382 \ 'void test();',
383 \ ], 'Xtest.h')
384 set tags=Xtags,Ytags
385
386 new Xtest.c
387 let tl = taglist('test', 'Xtest.c')
388 call assert_equal(tl[0].filename, 'Xtest.c')
389 call assert_equal(tl[1].filename, 'Xtest.h')
390
391 tag test
392 call assert_equal(bufname('%'), 'Xtest.c')
393 1tag test
394 call assert_equal(bufname('%'), 'Xtest.c')
395 2tag test
396 call assert_equal(bufname('%'), 'Xtest.h')
397
398 set tags&
399 call delete('Xtags')
400 call delete('Ytags')
401 bwipe Xtest.h
402 bwipe Xtest.c
403 call delete('Xtest.h')
404 call delete('Xtest.c')
405 endfunc
406
407 func Test_tagnr_recall()
408 call writefile([
409 \ 'test Xtest.h /^void test();$/;" p',
410 \ 'main Xtest.c /^int main()$/;" f',
411 \ 'test Xtest.c /^void test()$/;" f',
412 \ ], 'Xtags')
413 cal writefile([
414 \ 'int main()',
415 \ 'void test()',
416 \ ], 'Xtest.c')
417 cal writefile([
418 \ 'void test();',
419 \ ], 'Xtest.h')
420 set tags=Xtags
421
422 new Xtest.c
423 let tl = taglist('test', 'Xtest.c')
424 call assert_equal(tl[0].filename, 'Xtest.c')
425 call assert_equal(tl[1].filename, 'Xtest.h')
426
427 2tag test
428 call assert_equal(bufname('%'), 'Xtest.h')
429 pop
430 call assert_equal(bufname('%'), 'Xtest.c')
431 tag
432 call assert_equal(bufname('%'), 'Xtest.h')
433
434 set tag&
435 call delete('Xtags')
436 bwipe Xtest.h
437 bwipe Xtest.c
438 call delete('Xtest.h')
439 call delete('Xtest.c')
440 endfunc
441
369 " vim: shiftwidth=2 sts=2 expandtab 442 " vim: shiftwidth=2 sts=2 expandtab