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:
parent
9e6a96c5b0
commit
b62a59e17b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue