spellfile.vim: use :keeppatterns before :global

This commit is contained in:
Justin M. Keyes 2017-10-23 22:25:35 +02:00
parent 73fabf4f15
commit 8cb77acb44

View File

@ -88,8 +88,8 @@ function! spellfile#LoadFile(lang)
endif
endif
if newbufnr == winbufnr(0)
" We are back the old buffer, remove any (half-finished) download.
g/^/d_
" We are back to the old buffer, remove any (half-finished) download.
keeppatterns g/^/d_
else
let newbufnr = winbufnr(0)
endif
@ -127,7 +127,7 @@ function! spellfile#LoadFile(lang)
exe "write " . dirname . '/' . fname
" Also download the .sug file.
g/^/d_
keeppatterns g/^/d_
let fname = substitute(fname, '\.spl$', '.sug', '')
echo 'Downloading ' . fname . '...'
call spellfile#Nread(fname)