Skip to content

Commit bcfa8e0

Browse files
committed
Add vsnip#completefunc()
1 parent a803997 commit bcfa8e0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

autoload/vsnip.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,25 @@ function! vsnip#get_context() abort
166166
return {}
167167
endfunction
168168

169+
"
170+
" vsnip#completefunc
171+
"
172+
function! vsnip#completefunc(findstart, base) abort
173+
if !a:findstart
174+
if a:base ==# ''
175+
return []
176+
endif
177+
return vsnip#get_complete_items(bufnr('%'))
178+
endif
179+
180+
let line = getline('.')
181+
let start = col('.') - 2
182+
while start >= 0 && line[start] =~# '\k'
183+
let start -= 1
184+
endwhile
185+
return start + 1
186+
endfunction
187+
169188
"
170189
" vsnip#get_complete_items
171190
"

0 commit comments

Comments
 (0)