fix(vim): match prefix when handling completion
This commit is contained in:
parent
356d01933d
commit
cf903619ea
4
.vimrc
4
.vimrc
|
@ -142,11 +142,15 @@ endfunction
|
|||
function! s:truncate_labels(options, matches) abort
|
||||
let l:items = []
|
||||
for [l:source_name, l:matches] in items(a:matches)
|
||||
let l:startcol = l:matches['startcol']
|
||||
let l:base = a:options['typed'][l:startcol - 1:]
|
||||
for l:item in l:matches['items']
|
||||
if stridx(l:item['word'], l:base) == 0
|
||||
if has_key(l:item, 'abbr')
|
||||
let l:item['abbr'] = s:truncate(l:item['abbr'])
|
||||
endif
|
||||
call add(l:items, l:item)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
|
|
Loading…
Reference in New Issue