mirror of
https://github.com/preservim/vim-wordy.git
synced 2025-11-13 20:33:47 -05:00
Set spelllang correctly
Full paths are not allowed in spelllang, only the lang names. In the ./spell/ directory the files are named using the 'lang' which in the case of wordy is the dict name. This patch drops the actual lang from the .spl path, and only passes the dict names to spelllang. NOTE: I am not a vimscript expert, this solution works for me when loading vim-wordy using pathogen. Closes issue #33
This commit is contained in:
@@ -49,7 +49,8 @@ function! wordy#init(...) abort
|
|||||||
if !isdirectory(l:spell_dir)
|
if !isdirectory(l:spell_dir)
|
||||||
call mkdir(expand(l:spell_dir), "p")
|
call mkdir(expand(l:spell_dir), "p")
|
||||||
endif
|
endif
|
||||||
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:lang . '.' . l:encoding . '.spl'
|
" The dict name is the 'language' part of the filename
|
||||||
|
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:encoding . '.spl'
|
||||||
if get(l:args, 'force', 0) ||
|
if get(l:args, 'force', 0) ||
|
||||||
\ !filereadable(l:dst_path) ||
|
\ !filereadable(l:dst_path) ||
|
||||||
\ getftime(l:dst_path) < getftime(l:src_path)
|
\ getftime(l:dst_path) < getftime(l:src_path)
|
||||||
@@ -69,7 +70,9 @@ function! wordy#init(...) abort
|
|||||||
let l:prefix = 'wordy: '
|
let l:prefix = 'wordy: '
|
||||||
if len(l:dst_paths) > 0
|
if len(l:dst_paths) > 0
|
||||||
let b:original_spl = &spelllang
|
let b:original_spl = &spelllang
|
||||||
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
|
" vim looks up the files in the ./spell/ directory using spell-load (see
|
||||||
|
" the vim docs) so full paths are not allowed.
|
||||||
|
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dicts, ',')
|
||||||
setlocal spell
|
setlocal spell
|
||||||
|
|
||||||
" the magic numbers derived empirically with MacVim
|
" the magic numbers derived empirically with MacVim
|
||||||
|
|||||||
Reference in New Issue
Block a user