Mercurial > vim-gutentags
comparison autoload/gutentags.vim @ 157:6b00f4383708
Support project root markers that are wildcard patterns.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 15 Feb 2017 17:14:12 -0800 |
parents | b178f2251982 |
children | 28d4dae03f2a |
comparison
equal
deleted
inserted
replaced
156:40153c7a1887 | 157:6b00f4383708 |
---|---|
95 return gutentags#validate_cmd(g:gutentags_file_list_command) | 95 return gutentags#validate_cmd(g:gutentags_file_list_command) |
96 elseif type(g:gutentags_file_list_command) == type({}) | 96 elseif type(g:gutentags_file_list_command) == type({}) |
97 let l:markers = get(g:gutentags_file_list_command, 'markers', []) | 97 let l:markers = get(g:gutentags_file_list_command, 'markers', []) |
98 if type(l:markers) == type({}) | 98 if type(l:markers) == type({}) |
99 for [marker, file_list_cmd] in items(l:markers) | 99 for [marker, file_list_cmd] in items(l:markers) |
100 if getftype(a:path . '/' . marker) != "" | 100 if !empty(globpath(a:path, marker, 1)) |
101 return gutentags#validate_cmd(file_list_cmd) | 101 return gutentags#validate_cmd(file_list_cmd) |
102 endif | 102 endif |
103 endfor | 103 endfor |
104 endif | 104 endif |
105 return get(g:gutentags_file_list_command, 'default', "") | |
105 endif | 106 endif |
106 return "" | 107 return "" |
107 endfunction | 108 endfunction |
108 | 109 |
109 " Finds the first directory with a project marker by walking up from the given | 110 " Finds the first directory with a project marker by walking up from the given |
123 endif | 124 endif |
124 endfor | 125 endfor |
125 endif | 126 endif |
126 while l:path != l:previous_path | 127 while l:path != l:previous_path |
127 for root in l:markers | 128 for root in l:markers |
128 if getftype(l:path . '/' . root) != "" | 129 if !empty(globpath(l:path, root)) |
129 let l:proj_dir = simplify(fnamemodify(l:path, ':p')) | 130 let l:proj_dir = simplify(fnamemodify(l:path, ':p')) |
130 let l:proj_dir = gutentags#stripslash(l:proj_dir) | 131 let l:proj_dir = gutentags#stripslash(l:proj_dir) |
131 if l:proj_dir == '' | 132 if l:proj_dir == '' |
132 call gutentags#trace("Found project marker '" . root . | 133 call gutentags#trace("Found project marker '" . root . |
133 \"' at the root of your file-system! " . | 134 \"' at the root of your file-system! " . |