aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--autoload/spellfile_local.vim13
2 files changed, 6 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 6d7de6e..9084fa2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.2
+1.1.0
diff --git a/autoload/spellfile_local.vim b/autoload/spellfile_local.vim
index 1ae937b..a7f7a7d 100644
--- a/autoload/spellfile_local.vim
+++ b/autoload/spellfile_local.vim
@@ -90,15 +90,12 @@ function! spellfile_local#() abort
endfunction
" Escape a path for use as a valid option file name; replace any characters
-" not in 'isfname' with percent symbols
+" that won't work nicely as filenames with percent signs
function! s:Filename(parts) abort
- let filename = ''
- for char in split(join(a:parts, '.'), '\zs')
- let filename .= (char !=# '_' && char !=# '/' && char =~# '^\f$')
- \ ? char
- \ : '%'
- endfor
- return filename
+ let pat = has('win32') || has('win64')
+ \ ? '\c[^[:filename:]]\|[\\/:*?"<>|]'
+ \ : '\c[^[:filename:]]\|[_/]'
+ return substitute(join(a:parts, '.'), pat, '%', 'g')
endfunction
" Join a list of strings into a comma-separated option