Support new return value of completions operator
This commit is contained in:
parent
04ce1b64af
commit
874505e9f2
@ -91,11 +91,12 @@ function! fireplace#omnicomplete(findstart, base) abort
|
|||||||
if fireplace#op_available('complete')
|
if fireplace#op_available('complete')
|
||||||
let response = fireplace#message({'op': 'complete', 'symbol': a:base})
|
let response = fireplace#message({'op': 'complete', 'symbol': a:base})
|
||||||
let trans = '(v:val =~# ''\.'' ? "" : matchstr(a:base, ''^.\+/'')) . v:val'
|
let trans = '(v:val =~# ''\.'' ? "" : matchstr(a:base, ''^.\+/'')) . v:val'
|
||||||
if type(get(response[0], 'value')) == type([])
|
let value = get(response[0], 'value', get(response[0], 'completions'))
|
||||||
if type(get(response[0].value, 0)) == type([])
|
if type(value) == type([])
|
||||||
return map(response[0].value[0], trans)
|
if type(get(value, 0)) == type([])
|
||||||
elseif type(get(response[0].value, 0)) == type('')
|
return map(value[0], trans)
|
||||||
return map(response[0].value, trans)
|
elseif type(get(value, 0)) == type('')
|
||||||
|
return map(value, trans)
|
||||||
else
|
else
|
||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user