summaryrefslogtreecommitdiff
path: root/src/testdir/test_tagjump.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-07 23:08:42 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-07 23:08:42 +0100
commitdc9ef26845c6bf5ba63bfa8d00fc8a9bdc3b2de5 (patch)
tree22b7a9a9ebbdb2b086da692a29c58fa2c2807cbd /src/testdir/test_tagjump.vim
parent3d2a47c7823b934e1a85d773b68758c87c3ddc90 (diff)
downloadvim-git-dc9ef26845c6bf5ba63bfa8d00fc8a9bdc3b2de5.tar.gz
patch 8.1.2269: tags file with very long line stops using binary searchv8.1.2269
Problem: Tags file with very long line stops using binary search. Solution: Reallocate the buffer if needed.
Diffstat (limited to 'src/testdir/test_tagjump.vim')
-rw-r--r--src/testdir/test_tagjump.vim23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim
index 81d3e80a1..34a3c3055 100644
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -459,7 +459,8 @@ func Test_tag_line_toolong()
call assert_report(v:exception)
catch /.*/
endtry
- call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1])
+ call assert_equal('Searching tags file Xtags', split(execute('messages'), '\n')[-1])
+
call writefile([
\ '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 django/contrib/admin/templates/admin/edit_inline/stacked.html 16;" j line:16 language:HTML'
\ ], 'Xtags')
@@ -470,8 +471,26 @@ func Test_tag_line_toolong()
call assert_report(v:exception)
catch /.*/
endtry
- call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1])
+ call assert_equal('Searching tags file Xtags', split(execute('messages'), '\n')[-1])
+
+ " binary search works in file with long line
+ call writefile([
+ \ 'asdfasfd nowhere 16',
+ \ 'foobar Xsomewhere 3; " 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567',
+ \ 'zasdfasfd nowhere 16',
+ \ ], 'Xtags')
+ call writefile([
+ \ 'one',
+ \ 'two',
+ \ 'trhee',
+ \ 'four',
+ \ ], 'Xsomewhere')
+ tag foobar
+ call assert_equal('Xsomewhere', expand('%'))
+ call assert_equal(3, getcurpos()[1])
+
call delete('Xtags')
+ call delete('Xsomewhere')
set tags&
let &verbose = old_vbs
endfunc