Ticket #1843: vim-7.0-spellfile-1.patch

File vim-7.0-spellfile-1.patch, 1.2 KB (added by alexander@…, 18 years ago)

The fix

  • vim70/runtime/autoload/spellfile.vim

    Submitted By: Alexander E. Patrakov
    Date: 2006-07-25
    Initial Package Version: 7.0
    Origin: Alexander E. Patrakov
    Upstream Status: Sent
    Description: Allows downloading spellfiles via HTTP,
    thus reverting the negative effect of ftp://ftp.vim.org/pub/vim/patches/7.0/7.0.010
    
    old new  
    110110  endif
    111111endfunc
    112112
    113 " Read "fname" from the ftp server.
     113" Read "fname" from the server.
    114114function! spellfile#Nread(fname)
    115   let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '')
    116   let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '')
    117   exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"'
     115  if strpart(g:spellfile_URL, 0, 6) == 'ftp://'
     116    " Avoid the password prompt by providing the default username and password
     117    let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '')
     118    let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '')
     119    exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"'
     120  else
     121     exe 'Nread "' . g:spellfile_URL . '/' . a:fname . '"'
     122  endif
    118123endfunc