File plugin/inccomplete.vim changed (mode: 100644) (index 62c1598..7a63c14) |
1 |
1 |
" Name: inccomplete |
" Name: inccomplete |
2 |
2 |
" Author: xaizek <xaizek@posteo.net> |
" Author: xaizek <xaizek@posteo.net> |
3 |
|
" Version: 1.8.50 |
|
|
3 |
|
" Version: 1.8.51 |
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:ICFindIncludes(user, pathlst) |
428 |
428 |
if empty(a:pathlst) |
if empty(a:pathlst) |
429 |
429 |
return [] |
return [] |
430 |
430 |
endif |
endif |
|
431 |
|
let l:exts = '\('.escape(join(s:ICGetExtensions(a:user), '\|'), '.').'\)' |
431 |
432 |
if !a:user |
if !a:user |
432 |
433 |
if empty(g:inccomplete_findcmd) |
if empty(g:inccomplete_findcmd) |
433 |
|
let l:regex = '.*[/\\][-_a-z0-9]\+\(\.hpp\|\.h\)\?$' |
|
|
434 |
|
let l:regex = '.*[/\\][-_a-z0-9]\+'.l:exts.'$' |
434 |
435 |
else |
else |
435 |
|
let l:regex = '.*[/\\][-_a-z0-9]+\(\.hpp\|\.h\)?$' |
|
|
436 |
|
let l:regex = '.*[/\\][-_a-z0-9]+'.l:exts.'$' |
436 |
437 |
endif |
endif |
437 |
438 |
else |
else |
438 |
|
let l:regex = '.*\(\.hpp\|\.h\)$' |
|
|
439 |
|
let l:regex = '.*'.l:exts.'$' |
439 |
440 |
endif |
endif |
440 |
441 |
|
|
441 |
442 |
" execute find |
" execute find |
|
... |
... |
function! s:ICFindIncludes(user, pathlst) |
502 |
503 |
return l:result |
return l:result |
503 |
504 |
endfunction |
endfunction |
504 |
505 |
|
|
|
506 |
|
" retrieves set of extensions acceptable for completion |
|
507 |
|
function s:ICGetExtensions(user) |
|
508 |
|
if s:ICIsCxxBuffer() |
|
509 |
|
return a:user ? ['.hpp', '.h'] : ['.hpp', '.h', ''] |
|
510 |
|
endif |
|
511 |
|
return ['.h'] |
|
512 |
|
endfunction |
|
513 |
|
|
|
514 |
|
" checks whether current buffer is of C++ kind |
|
515 |
|
function s:ICIsCxxBuffer() |
|
516 |
|
return index(split(&l:filetype, '\.'), 'cpp') != -1 |
|
517 |
|
endfunction |
|
518 |
|
|
505 |
519 |
" retrieves include directories from b:clang_user_options and |
" retrieves include directories from b:clang_user_options and |
506 |
520 |
" g:clang_user_options |
" g:clang_user_options |
507 |
521 |
" possible values of which: |
" possible values of which: |