diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-05-13 12:25:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-05-13 12:25:55 +0000 |
commit | c9a99918bd0e5de15ed12b9b73cb1458f5fed64f (patch) | |
tree | ce6afb60f21ec20071440c4a345f03ea1d07983d /runtime | |
parent | 5dd95a1058261de5efe778e2fca3159ef6c7244e (diff) |
updated for version 7.0-010v7.0.010
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/spellfile.vim | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/runtime/autoload/spellfile.vim b/runtime/autoload/spellfile.vim index 387f189eb9..405202da1c 100644 --- a/runtime/autoload/spellfile.vim +++ b/runtime/autoload/spellfile.vim @@ -1,9 +1,9 @@ " Vim script to download a missing spell file " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2006 Feb 01 +" Last Change: 2006 May 10 if !exists('g:spellfile_URL') - let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell' + let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell' endif let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset. @@ -61,13 +61,13 @@ function! spellfile#LoadFile(lang) new setlocal bin echo 'Downloading ' . fname . '...' - exe 'Nread ' g:spellfile_URL . '/' . fname + call spellfile#Nread(fname) if getline(2) !~ 'VIMspell' " Didn't work, perhaps there is an ASCII one. g/^/d let fname = a:lang . '.ascii.spl' echo 'Could not find it, trying ' . fname . '...' - exe 'Nread ' g:spellfile_URL . '/' . fname + call spellfile#Nread(fname) if getline(2) !~ 'VIMspell' echo 'Sorry, downloading failed' bwipe! @@ -95,7 +95,7 @@ function! spellfile#LoadFile(lang) g/^/d let fname = substitute(fname, '\.spl$', '.sug', '') echo 'Downloading ' . fname . '...' - exe 'Nread ' g:spellfile_URL . '/' . fname + call spellfile#Nread(fname) if getline(2) !~ 'VIMsug' echo 'Sorry, downloading failed' else @@ -109,3 +109,10 @@ function! spellfile#LoadFile(lang) bwipe endif endfunc + +" Read "fname" from the ftp server. +function! spellfile#Nread(fname) + let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '') + let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '') + exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"' +endfunc |