Skip to content

Commit 87a77cb

Browse files
authored
Merge pull request #35 from bcl/master-spelllang
Set spelllang correctly
2 parents 14b9dbf + e805207 commit 87a77cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/wordy.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ function! wordy#init(...) abort
4949
if !isdirectory(l:spell_dir)
5050
call mkdir(expand(l:spell_dir), "p")
5151
endif
52-
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:lang . '.' . l:encoding . '.spl'
52+
" The dict name is the 'language' part of the filename
53+
let l:dst_path = l:spell_dir . '/' . l:dict . '.' . l:encoding . '.spl'
5354
if get(l:args, 'force', 0) ||
5455
\ !filereadable(l:dst_path) ||
5556
\ getftime(l:dst_path) < getftime(l:src_path)
@@ -69,7 +70,9 @@ function! wordy#init(...) abort
6970
let l:prefix = 'wordy: '
7071
if len(l:dst_paths) > 0
7172
let b:original_spl = &spelllang
72-
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
73+
" vim looks up the files in the ./spell/ directory using spell-load (see
74+
" the vim docs) so full paths are not allowed.
75+
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dicts, ',')
7376
setlocal spell
7477

7578
" the magic numbers derived empirically with MacVim

0 commit comments

Comments
 (0)