comparison src/testdir/test_tagjump.vim @ 18550:90e5812af76b v8.1.2269

patch 8.1.2269: tags file with very long line stops using binary search Commit: https://github.com/vim/vim/commit/dc9ef26845c6bf5ba63bfa8d00fc8a9bdc3b2de5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 7 23:08:42 2019 +0100 patch 8.1.2269: tags file with very long line stops using binary search Problem: Tags file with very long line stops using binary search. Solution: Reallocate the buffer if needed.
author Bram Moolenaar <Bram@vim.org>
date Thu, 07 Nov 2019 23:15:04 +0100
parents b0b37bd807ba
children b9240fe40dd4
comparison
equal deleted inserted replaced
18549:8ce88501264f 18550:90e5812af76b
457 tj /foo 457 tj /foo
458 catch /^Vim\%((\a\+)\)\=:E431/ 458 catch /^Vim\%((\a\+)\)\=:E431/
459 call assert_report(v:exception) 459 call assert_report(v:exception)
460 catch /.*/ 460 catch /.*/
461 endtry 461 endtry
462 call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1]) 462 call assert_equal('Searching tags file Xtags', split(execute('messages'), '\n')[-1])
463
463 call writefile([ 464 call writefile([
464 \ '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 django/contrib/admin/templates/admin/edit_inline/stacked.html 16;" j line:16 language:HTML' 465 \ '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 django/contrib/admin/templates/admin/edit_inline/stacked.html 16;" j line:16 language:HTML'
465 \ ], 'Xtags') 466 \ ], 'Xtags')
466 call assert_fails('tj /foo', 'E426') 467 call assert_fails('tj /foo', 'E426')
467 try 468 try
468 tj /foo 469 tj /foo
469 catch /^Vim\%((\a\+)\)\=:E431/ 470 catch /^Vim\%((\a\+)\)\=:E431/
470 call assert_report(v:exception) 471 call assert_report(v:exception)
471 catch /.*/ 472 catch /.*/
472 endtry 473 endtry
473 call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1]) 474 call assert_equal('Searching tags file Xtags', split(execute('messages'), '\n')[-1])
474 call delete('Xtags') 475
476 " binary search works in file with long line
477 call writefile([
478 \ 'asdfasfd nowhere 16',
479 \ 'foobar Xsomewhere 3; " 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567',
480 \ 'zasdfasfd nowhere 16',
481 \ ], 'Xtags')
482 call writefile([
483 \ 'one',
484 \ 'two',
485 \ 'trhee',
486 \ 'four',
487 \ ], 'Xsomewhere')
488 tag foobar
489 call assert_equal('Xsomewhere', expand('%'))
490 call assert_equal(3, getcurpos()[1])
491
492 call delete('Xtags')
493 call delete('Xsomewhere')
475 set tags& 494 set tags&
476 let &verbose = old_vbs 495 let &verbose = old_vbs
477 endfunc 496 endfunc
478 497
479 " Check that using :tselect does not run into the hit-enter prompt. 498 " Check that using :tselect does not run into the hit-enter prompt.