xaizek / vim-inccomplete (License: Vim) (since 2018-12-07)
Vim plugin for #include directive completion in C family of languages.
Commit f1ecca04beb330252e2f39116eb56cfbb3e397ce

Fix parsing of directories several times
Before it could include for example /usr/include two times,
which resulted in performance penalty.
Author: xaizek
Author date (UTC): 2012-04-15 18:27
Committer name: xaizek
Committer date (UTC): 2012-04-15 18:27
Parent(s): 87ace4396941557cf91d757e4f5d8800e335ce24
Signing key:
Tree: 14f68fa518928f37c3f97b38f6b75495794f87d8
File Lines added Lines deleted
plugin/inccomplete.vim 14 7
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 :
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vim-inccomplete

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vim-inccomplete

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master