Mercurial > vim
comparison src/testdir/test_tagjump.vim @ 28027:d59552ad3f36 v8.2.4538
patch 8.2.4538: the find_tags_in_file() function is too long
Commit: https://github.com/vim/vim/commit/bf40e90dfeb1d3d0280077e65782beb3fee31c9f
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Thu Mar 10 18:36:54 2022 +0000
patch 8.2.4538: the find_tags_in_file() function is too long
Problem: The find_tags_in_file() function is too long.
Solution: Refactor into smaller functions. (Yegappan Lakshmanan,
closes #9920)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 10 Mar 2022 19:45:02 +0100 |
parents | c724906134a3 |
children | 12a256140887 |
comparison
equal
deleted
inserted
replaced
28026:09c8bfcf2761 | 28027:d59552ad3f36 |
---|---|
809 set tags& | 809 set tags& |
810 endfunc | 810 endfunc |
811 | 811 |
812 " Test for an unsorted tags file | 812 " Test for an unsorted tags file |
813 func Test_tag_sort() | 813 func Test_tag_sort() |
814 call writefile([ | 814 let l = [ |
815 \ "first\tXfoo\t1", | 815 \ "first\tXfoo\t1", |
816 \ "ten\tXfoo\t3", | 816 \ "ten\tXfoo\t3", |
817 \ "six\tXfoo\t2"], | 817 \ "six\tXfoo\t2"] |
818 \ 'Xtags') | 818 call writefile(l, 'Xtags') |
819 set tags=Xtags | 819 set tags=Xtags |
820 let code =<< trim [CODE] | 820 let code =<< trim [CODE] |
821 int first() {} | 821 int first() {} |
822 int six() {} | 822 int six() {} |
823 int ten() {} | 823 int ten() {} |
824 [CODE] | 824 [CODE] |
825 call writefile(code, 'Xfoo') | 825 call writefile(code, 'Xfoo') |
826 | 826 |
827 call assert_fails('tag first', 'E432:') | 827 call assert_fails('tag first', 'E432:') |
828 | 828 |
829 call delete('Xtags') | 829 " When multiple tag files are not sorted, then message should be displayed |
830 " multiple times | |
831 call writefile(l, 'Xtags2') | |
832 set tags=Xtags,Xtags2 | |
833 call assert_fails('tag first', ['E432:', 'E432:']) | |
834 | |
835 call delete('Xtags') | |
836 call delete('Xtags2') | |
830 call delete('Xfoo') | 837 call delete('Xfoo') |
831 set tags& | 838 set tags& |
832 %bwipe | 839 %bwipe |
833 endfunc | 840 endfunc |
834 | 841 |