File plugin/inccomplete.vim changed (mode: 100644) (index de48aec..e053608) |
... |
... |
function! ICComplete(findstart, base) |
129 |
129 |
let l:closebracket = '' |
let l:closebracket = '' |
130 |
130 |
endif |
endif |
131 |
131 |
|
|
|
132 |
|
let l:existend_list = s:ICListIncludes()[l:bracket == '"'] |
|
133 |
|
|
132 |
134 |
" form list of dictionaries |
" form list of dictionaries |
133 |
135 |
let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base) |
let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base) |
134 |
136 |
let l:comlst = [] |
let l:comlst = [] |
|
... |
... |
function! ICComplete(findstart, base) |
145 |
147 |
|
|
146 |
148 |
let l:strend = g:inccomplete_appendslash ? l:sl2 : '' |
let l:strend = g:inccomplete_appendslash ? l:sl2 : '' |
147 |
149 |
let l:slash = l:sl2 |
let l:slash = l:sl2 |
|
150 |
|
elseif index(l:existend_list, l:increc[1]) >= 0 |
|
151 |
|
continue |
148 |
152 |
else |
else |
149 |
153 |
let l:strend = l:closebracket |
let l:strend = l:closebracket |
150 |
154 |
let l:slash = '' |
let l:slash = '' |
|
... |
... |
function! ICComplete(findstart, base) |
171 |
175 |
endif |
endif |
172 |
176 |
endfunction |
endfunction |
173 |
177 |
|
|
|
178 |
|
function! s:ICListIncludes() |
|
179 |
|
let l:lines = getline(0, '$') |
|
180 |
|
call filter(l:lines, 'v:val =~? &include') |
|
181 |
|
call map(l:lines, 'matchstr(v:val, &include.''\s*\zs.*\ze$'')') |
|
182 |
|
|
|
183 |
|
let l:sys = [] |
|
184 |
|
let l:usr = [] |
|
185 |
|
for l:include in l:lines |
|
186 |
|
if l:include[0] == '<' |
|
187 |
|
call add(l:sys, l:include[1:]) |
|
188 |
|
else |
|
189 |
|
call add(l:usr, l:include[1:]) |
|
190 |
|
endif |
|
191 |
|
endfor |
|
192 |
|
unlet l:lines |
|
193 |
|
|
|
194 |
|
call map(l:sys, 'matchstr(v:val, ''^[^>]\+'')') |
|
195 |
|
call map(l:usr, 'matchstr(v:val, ''^[^"]\+'')') |
|
196 |
|
|
|
197 |
|
" echo l:sys |
|
198 |
|
" echo l:usr |
|
199 |
|
|
|
200 |
|
return [l:sys, l:usr] |
|
201 |
|
endfunction |
|
202 |
|
|
174 |
203 |
" sorts completion list |
" sorts completion list |
175 |
204 |
function s:SortList(lst) |
function s:SortList(lst) |
176 |
205 |
if g:inccomplete_sort == 'ignorecase' |
if g:inccomplete_sort == 'ignorecase' |