diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2023-04-06 15:58:59 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2023-04-06 15:58:59 +1200 |
commit | 20c2abd540369be54c6fddaafbf1421b9f811b70 (patch) | |
tree | d2c367da4fcc1001ef3caea13acf58d1dcd8bc64 /autoload/spellfile_local.vim | |
parent | Require Vim version 8.0, inline OptionSet (diff) | |
download | vim-spellfile-local-20c2abd540369be54c6fddaafbf1421b9f811b70.tar.gz vim-spellfile-local-20c2abd540369be54c6fddaafbf1421b9f811b70.zip |
Adjust logic and comments for picking paths
Diffstat (limited to 'autoload/spellfile_local.vim')
-rw-r--r-- | autoload/spellfile_local.vim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/autoload/spellfile_local.vim b/autoload/spellfile_local.vim index 7573c45..dc9d2cc 100644 --- a/autoload/spellfile_local.vim +++ b/autoload/spellfile_local.vim @@ -15,24 +15,24 @@ 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 + " every directory; first is the normal lang.encoding.add, then if there's + " a path set filename.lang.encoding.add, and then if there's a filetype set, " filetype.lang.encoding.add. " - let basenames = [s:Filename([lang, encoding, 'add'])] + let basenames = [s:Filename([lang, &encoding, 'add'])] let path = expand('%:p') - call add( - \ basenames, - \ s:Filename(['path', path, lang, encoding, 'add']) - \) - let filetype = &filetype - if filetype !=# '' + if path !=# '' + call add( + \ basenames, + \ s:Filename(['path', path, lang, &encoding, 'add']) + \) + endif + if &filetype !=# '' call add( \ basenames, - \ s:Filename(['filetype', filetype, lang, encoding, 'add']) + \ s:Filename(['filetype', &filetype, lang, &encoding, 'add']) \) endif |