aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-15 01:06:00 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-15 01:06:00 +1200
commit73577d031d1fa9060f6bfef0fe18d6a217253f47 (patch)
tree480ba4b6e815cc1ae721b3c7a750ff84c1abe115
parentMerge branch 'hotfix/v0.3.1' (diff)
parentBump VERSION (diff)
downloadvim-spellfile-local-73577d031d1fa9060f6bfef0fe18d6a217253f47.tar.gz
vim-spellfile-local-73577d031d1fa9060f6bfef0fe18d6a217253f47.zip
Merge branch 'release/v1.0.0'v1.0.0
* release/v1.0.0: Use period separators for types, not path
-rw-r--r--VERSION2
-rw-r--r--autoload/spellfile_local.vim25
-rw-r--r--doc/spellfile_local.txt6
3 files changed, 20 insertions, 13 deletions
diff --git a/VERSION b/VERSION
index 9e11b32..3eefcb9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.3.1
+1.0.0
diff --git a/autoload/spellfile_local.vim b/autoload/spellfile_local.vim
index 9734988..596d997 100644
--- a/autoload/spellfile_local.vim
+++ b/autoload/spellfile_local.vim
@@ -15,18 +15,25 @@ function! spellfile_local#() abort
return
endif
let lang = split(spelllangs[0], '_')[0]
+ let encoding = &encoding
" Make a list of all the spellfile names for which we want to search in
" every directory; the first is the normal lang.encoding.add, the second is
" filename.lang.encoding.add, and the third, if there's a filetype set, is
" filetype.lang.encoding.add.
"
- let basenames = [
- \ s:Filename([lang, &encoding, 'add']),
- \ s:Filename([expand('<afile>:p'), lang, &encoding, 'add']),
- \]
- if &filetype !=# ''
- call add(basenames, s:Filename([&filetype, lang, &encoding, 'add']))
+ let basenames = [s:Filename([lang, encoding, 'add'])]
+ let path = expand('<afile>:p')
+ call add(
+ \ basenames,
+ \ s:Filename(['path', path, lang, encoding, 'add'])
+ \)
+ let filetype = &filetype
+ if filetype !=# ''
+ call add(
+ \ basenames,
+ \ s:Filename(['filetype', filetype, lang, encoding, 'add'])
+ \)
endif
" Now make a list of all of the directories in which those files will be
@@ -41,7 +48,7 @@ function! spellfile_local#() abort
"
if exists('g:spellfile_local_dirs') && !empty(g:spellfile_local_dirs)
for path in g:spellfile_local_dirs
- call add(dirnames, join([path, 'spell'], '/'))
+ call add(dirnames, path.'/spell')
endfor
" Failing that, do what Vim does by default: use the first *writeable* entry
@@ -52,7 +59,7 @@ function! spellfile_local#() abort
if filewritable(path) != 2
continue
endif
- call add(dirnames, join([path, 'spell'], '/'))
+ call add(dirnames, path.'/spell')
break
endfor
if empty(dirnames)
@@ -62,7 +69,7 @@ function! spellfile_local#() abort
endif
" Attempt to create the first directory in the list if it doesn't exist
- " already. Just let the error happen if it does.
+ " already. Just let any error happen and reach the user.
"
if !isdirectory(dirnames[0])
call mkdir(dirnames[0], 'p', 0700)
diff --git a/doc/spellfile_local.txt b/doc/spellfile_local.txt
index 486da43..2582783 100644
--- a/doc/spellfile_local.txt
+++ b/doc/spellfile_local.txt
@@ -1,4 +1,4 @@
-*spellfile_local.txt* For Vim version 7.0 Last change: 2020 May 14
+*spellfile_local.txt* For Vim version 7.0 Last change: 2020 May 15
DESCRIPTION *spellfile_local*
@@ -8,8 +8,8 @@ The 'spellfile' setting for a file named `test.vim` in one's home directory
while writing English in UTF-8 encoding might look like this:
>
spellfile=~/.vim/spell/en.utf-8.add
- ,~/.vim/spell/path/%home%user%test.vim.en.utf-8.add
- ,~/.vim/spell/filetype/vim.en.utf-8.add
+ ,~/.vim/spell/path.%home%user%test.vim.en.utf-8.add
+ ,~/.vim/spell/filetype.vim.en.utf-8.add
<
Words can then be added to the file's word list with `2zg`, or to the
filetype's list with `3zg`.