[fzf#vim#complete#word] Respect &dictionary option (#1373)

This commit is contained in:
jiz4oh
2022-03-07 16:35:08 +08:00
committed by GitHub
parent 1f7bfa4007
commit b23e4bb8f8

View File

@@ -47,8 +47,9 @@ else
endif
function! fzf#vim#complete#word(...)
let sources = empty(&dictionary) ? ['/usr/share/dict/words'] : split(&dictionary, ',')
return fzf#vim#complete(s:extend({
\ 'source': 'cat /usr/share/dict/words'},
\ 'source': 'cat ' . join(map(sources, 'shellescape(v:val)'))},
\ get(a:000, 0, fzf#wrap())))
endfunction