File plugin/inccomplete.vim changed (mode: 100644) (index 0d9600b..1cc0fe2) |
1 |
1 |
" Name: inccomplete |
" Name: inccomplete |
2 |
2 |
" Author: xaizek <xaizek@gmail.com> |
" Author: xaizek <xaizek@gmail.com> |
3 |
|
" Version: 1.6.26 |
|
|
3 |
|
" Version: 1.6.27 |
4 |
4 |
" License: Same terms as Vim itself (see :help license) |
" License: Same terms as Vim itself (see :help license) |
5 |
5 |
" |
" |
6 |
6 |
" See :help inccomplete for documentation. |
" See :help inccomplete for documentation. |
|
... |
... |
function! s:ICGetList(user, base) |
237 |
237 |
endif |
endif |
238 |
238 |
|
|
239 |
239 |
" prepare list of directories |
" prepare list of directories |
240 |
|
let l:pathlst = s:ICAddNoDups(split(&path, ','), s:ICGetClangIncludes()) |
|
241 |
|
let l:pathlst = s:ICAddNoDups(l:pathlst, s:ICGetSubDirs(l:pathlst, a:base)) |
|
242 |
|
call filter(l:pathlst, 'v:val != "" && v:val !~ "^\.$"') |
|
243 |
|
call map(l:pathlst, 'fnamemodify(v:val, ":p")') |
|
|
240 |
|
let l:pathlst = s:ICAddNoDupPaths(split(&path, ','), s:ICGetClangIncludes()) |
|
241 |
|
let l:pathlst = s:ICAddNoDupPaths(l:pathlst, |
|
242 |
|
\ s:ICGetSubDirs(l:pathlst, a:base)) |
244 |
243 |
call reverse(sort(l:pathlst)) |
call reverse(sort(l:pathlst)) |
245 |
244 |
|
|
246 |
245 |
" divide it into sublists |
" divide it into sublists |
|
... |
... |
function! s:ICParsePath(path) |
387 |
386 |
return [l:pos, l:sl1, l:sl2] |
return [l:pos, l:sl1, l:sl2] |
388 |
387 |
endfunction |
endfunction |
389 |
388 |
|
|
390 |
|
" adds one list to another without duplicating items |
|
391 |
|
function! s:ICAddNoDups(lista, listb) |
|
|
389 |
|
" adds one list of paths to another without duplicating items |
|
390 |
|
function! s:ICAddNoDupPaths(lista, listb) |
392 |
391 |
let l:result = [] |
let l:result = [] |
|
392 |
|
call s:ICPrepPaths(a:lista) |
|
393 |
|
call s:ICPrepPaths(a:listb) |
393 |
394 |
for l:item in a:lista + a:listb |
for l:item in a:lista + a:listb |
394 |
395 |
if index(l:result, l:item) == -1 |
if index(l:result, l:item) == -1 |
395 |
396 |
call add(l:result, l:item) |
call add(l:result, l:item) |
|
... |
... |
function! s:ICAddNoDups(lista, listb) |
398 |
399 |
return l:result |
return l:result |
399 |
400 |
endfunction |
endfunction |
400 |
401 |
|
|
|
402 |
|
" converts list of paths to a list of absolute paths and excudes '.' directory |
|
403 |
|
function! s:ICPrepPaths(lst) |
|
404 |
|
call filter(a:lst, '!empty(v:val) && v:val != "."') |
|
405 |
|
return map(a:lst, 'fnamemodify(v:val, ":p")') |
|
406 |
|
endfunction |
|
407 |
|
|
401 |
408 |
" vim: set foldmethod=syntax foldlevel=0 : |
" vim: set foldmethod=syntax foldlevel=0 : |