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

Cut off trailing spaces on filtering
Extra spaces might break matching. Vim doesn't normalize slashes on
`:p` for some reason.
Author: xaizek
Author date (UTC): 2018-04-03 20:20
Committer name: xaizek
Committer date (UTC): 2018-04-03 20:20
Parent(s): df8629f97184c229a3b48b861b27aa635dda35ff
Signing key: 99DC5E4DB05F6BE2
Tree: edeaa02c82c21048578a41203bacf9322fff5f10
File Lines added Lines deleted
plugin/inccomplete.vim 11 2
File plugin/inccomplete.vim changed (mode: 100644) (index 8692190..965d0aa)
1 1 " Name: inccomplete " Name: inccomplete
2 2 " Author: xaizek <xaizek@posteo.net> " Author: xaizek <xaizek@posteo.net>
3 " Version: 1.7.46
3 " Version: 1.7.47
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:ICFilter(user, inclst, base, dir)
292 292 " filter by subdirectory name " filter by subdirectory name
293 293 let l:dirend0 = a:base[:l:pos] let l:dirend0 = a:base[:l:pos]
294 294 if a:user if a:user
295 let l:dirend1 = fnamemodify(a:dir.'/'.l:dirend0, ':p')
295 let l:dirend1 = fnamemodify(s:ICChosp(a:dir).'/'.l:dirend0, ':p')
296 296 else else
297 297 let l:dirend1 = l:dirend0 let l:dirend1 = l:dirend0
298 298 endif endif
 
... ... function! s:ICFilter(user, inclst, base, dir)
324 324 return l:inclst return l:inclst
325 325 endfunction endfunction
326 326
327 " drops all trailing slashes from path
328 function! s:ICChosp(path)
329 let l:path = a:path
330 while len(l:path) > 1 && (l:path[-1:] == '/' || l:path[-1:] == '\')
331 let l:path = l:path[:-2]
332 endwhile
333 return l:path
334 endfunction
335
327 336 " searches for files that can be included in path " searches for files that can be included in path
328 337 " a:user determines search area, when it's not zero look only in '.', otherwise " a:user determines search area, when it's not zero look only in '.', otherwise
329 338 " everywhere in path except '.' " everywhere in path except '.'
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