vim.opt_local.dictionary is only populated when entering the first buffer.
If the first is a "normal" buffer, completion keeps working for later buffers despite vim.opt_local.dictionary being empty, for unknown reasons.
However, if the first buffer is telescope or potentially other special buffers, completion won't work for the entire session.
To reproduce:
# Step
Operation
:setlocal dictionary
Has word completion?
1
start nvim
N/A
2
open a file and enter insert mode
/usr/share/dict/words
Y
3
open another file and enter insert mode
Y
# Step
Operation
:setlocal dictionary
Has word completion?
1
start nvim
N/A
2
:Telescope, then press \<esc> to switch to normal mode but not quit telescope
Env
My config looks like this, and
nvim-cmp
is loaded onInsertEnter
Since I set the dictionary path for spelllang=en only, the path will be appended to
vim.opt_local.dictionary
(notice that it's buffer-local!) onOptionSet
https://github.com/uga-rosa/cmp-dictionary/blob/f076c6b071e6117d2cbb26d53327ff21fc22fdb8/lua/cmp_dictionary/init.lua#L76-L82Issue
vim.opt_local.dictionary
is only populated when entering the first buffer. If the first is a "normal" buffer, completion keeps working for later buffers despitevim.opt_local.dictionary
being empty, for unknown reasons. However, if the first buffer is telescope or potentially other special buffers, completion won't work for the entire session.:setlocal dictionary
:setlocal dictionary
:Telescope
, then press \<esc> to switch to normal mode but not quit telescope