nvim/plug/cmp-spell: fix path expansion

Silly mistakes:

1. Only running `vim.fn.expand/1` in the if check
2. Using `vim.fn.exists/1` for file checks (it doesn't do this)

Just rip the whole loop out, as probably a user isn't expecting
`[count]spell-action` to select different files depending on whether
they (and how many of them) exist.

Still leaves the problem of file creation, but ¯\_(ツ)_/¯
This commit is contained in:
Paul Stemmet 2022-10-08 15:05:07 +00:00
parent 9e6a96c5b0
commit b62a59e17b
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 1 additions and 6 deletions

View File

@ -35,12 +35,7 @@ return function()
-- 3. $PSOXIZSH/nvim/spellfile
if repo_root then table.insert(checked, repo_root .. '/.vim') end
vim.list_extend(checked, { '~/.config/nvim', vim.env.PSOXIZSH .. '/nvim/spellfile' })
for i, path in ipairs(checked) do
if path and fn.exists(fn.expand(path)) then
checked[i] = path .. '/' .. cfg.spell_fname
end
end
checked = vim.tbl_map(function(p) return fn.expand(p) .. '/' .. cfg.spell_fname end, checked)
l.spell = true
l.spelllang = merged.languages