mirror of
https://github.com/neovim/neovim.git
synced 2025-11-15 23:01:24 +00:00
- prefer `stdpath(data)/site/spell` instead of looking for random dirs in 'runtimepath'. - drop unused functions `choose_directory`, `setup`, etc.
17 lines
496 B
Lua
17 lines
496 B
Lua
vim.g.loaded_spellfile_plugin = true
|
|
|
|
--- Downloads missing .spl file.
|
|
---
|
|
--- @param args { bufnr: integer, match: string }
|
|
local function on_spellfile_missing(args)
|
|
local spellfile = require('nvim.spellfile')
|
|
spellfile.load_file(args.match)
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd('SpellFileMissing', {
|
|
group = vim.api.nvim_create_augroup('nvim_spellfile', { clear = true }),
|
|
pattern = '*',
|
|
desc = 'Download missing spell files when setting spelllang',
|
|
callback = on_spellfile_missing,
|
|
})
|