File plugin/inccomplete.vim changed (mode: 100644) (index 1cc0fe2..dad8c07) |
1 |
1 |
" Name: inccomplete |
" Name: inccomplete |
2 |
2 |
" Author: xaizek <xaizek@gmail.com> |
" Author: xaizek <xaizek@gmail.com> |
3 |
|
" Version: 1.6.27 |
|
|
3 |
|
" Version: 1.6.28 |
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! ICComplete(findstart, base) |
101 |
101 |
return eval(s:oldomnifuncs[l:curbuf]. |
return eval(s:oldomnifuncs[l:curbuf]. |
102 |
102 |
\ "(".a:findstart.",'".a:base."')") |
\ "(".a:findstart.",'".a:base."')") |
103 |
103 |
else |
else |
|
104 |
|
let l:pos = match(getline('.'), '<\|"') |
|
105 |
|
let l:bracket = getline('.')[l:pos : l:pos] |
|
106 |
|
|
|
107 |
|
if empty(a:base) && l:bracket == '<' && exists('s:fullCached') |
|
108 |
|
return s:fullCached |
|
109 |
|
endif |
|
110 |
|
|
104 |
111 |
let l:old_cwd = getcwd() |
let l:old_cwd = getcwd() |
105 |
112 |
lcd %:p:h |
lcd %:p:h |
106 |
113 |
|
|
107 |
114 |
" get list of all candidates and reduce it to those starts with a:base |
" get list of all candidates and reduce it to those starts with a:base |
108 |
|
let l:pos = match(getline('.'), '<\|"') |
|
109 |
|
let l:bracket = getline('.')[l:pos : l:pos] |
|
110 |
115 |
let l:inclst = s:ICGetList(l:bracket == '"', a:base) |
let l:inclst = s:ICGetList(l:bracket == '"', a:base) |
111 |
116 |
let l:inclst = s:ICFilterIncLst(l:bracket == '"', l:inclst, a:base) |
let l:inclst = s:ICFilterIncLst(l:bracket == '"', l:inclst, a:base) |
112 |
117 |
|
|
|
... |
... |
function! ICComplete(findstart, base) |
129 |
134 |
endif |
endif |
130 |
135 |
|
|
131 |
136 |
if isdirectory(l:increc[0].'/'.l:increc[1]) |
if isdirectory(l:increc[0].'/'.l:increc[1]) |
132 |
|
let l:bracket = '' |
|
|
137 |
|
let l:strend = '' |
133 |
138 |
let l:slash = l:sl2 |
let l:slash = l:sl2 |
134 |
139 |
else |
else |
135 |
|
let l:bracket = l:closebracket |
|
|
140 |
|
let l:strend = l:closebracket |
136 |
141 |
let l:slash = '' |
let l:slash = '' |
137 |
142 |
endif |
endif |
138 |
143 |
|
|
139 |
144 |
let l:item = { |
let l:item = { |
140 |
|
\ 'word': l:increc[1].l:bracket, |
|
|
145 |
|
\ 'word': l:increc[1].l:strend, |
141 |
146 |
\ 'abbr': l:increc[1].l:slash, |
\ 'abbr': l:increc[1].l:slash, |
142 |
147 |
\ 'menu': s:ICModifyPath(l:increc[0]), |
\ 'menu': s:ICModifyPath(l:increc[0]), |
143 |
148 |
\ 'dup': 0 |
\ 'dup': 0 |
|
... |
... |
function! ICComplete(findstart, base) |
147 |
152 |
|
|
148 |
153 |
execute 'lcd' l:old_cwd |
execute 'lcd' l:old_cwd |
149 |
154 |
|
|
150 |
|
return s:SortList(l:comlst) |
|
|
155 |
|
let l:result = s:SortList(l:comlst) |
|
156 |
|
|
|
157 |
|
if empty(a:base) && l:bracket == '<' |
|
158 |
|
let s:fullCached = l:result |
|
159 |
|
endif |
|
160 |
|
|
|
161 |
|
return l:result |
151 |
162 |
endif |
endif |
152 |
163 |
endfunction |
endfunction |
153 |
164 |
|
|