Mercurial > vim
comparison runtime/autoload/spellfile.vim @ 14372:2a4a2dc35c55
Update runtime files.
commit https://github.com/vim/vim/commit/a9604e61451707b38fdcb088fbfaeea2b922fef6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 21 05:56:22 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Jul 2018 06:00:09 +0200 |
parents | ba708ee8d69d |
children | 21fb2a3ad3ca |
comparison
equal
deleted
inserted
replaced
14371:2fb503a18f12 | 14372:2a4a2dc35c55 |
---|---|
20 if &verbose | 20 if &verbose |
21 echomsg 'spellfile#LoadFile(): Nread command is not available.' | 21 echomsg 'spellfile#LoadFile(): Nread command is not available.' |
22 endif | 22 endif |
23 return | 23 return |
24 endif | 24 endif |
25 let lang = tolower(a:lang) | |
25 | 26 |
26 " If the URL changes we try all files again. | 27 " If the URL changes we try all files again. |
27 if s:spellfile_URL != g:spellfile_URL | 28 if s:spellfile_URL != g:spellfile_URL |
28 let s:donedict = {} | 29 let s:donedict = {} |
29 let s:spellfile_URL = g:spellfile_URL | 30 let s:spellfile_URL = g:spellfile_URL |
30 endif | 31 endif |
31 | 32 |
32 " I will say this only once! | 33 " I will say this only once! |
33 if has_key(s:donedict, a:lang . &enc) | 34 if has_key(s:donedict, lang . &enc) |
34 if &verbose | 35 if &verbose |
35 echomsg 'spellfile#LoadFile(): Tried this language/encoding before.' | 36 echomsg 'spellfile#LoadFile(): Tried this language/encoding before.' |
36 endif | 37 endif |
37 return | 38 return |
38 endif | 39 endif |
39 let s:donedict[a:lang . &enc] = 1 | 40 let s:donedict[lang . &enc] = 1 |
40 | 41 |
41 " Find spell directories we can write in. | 42 " Find spell directories we can write in. |
42 let [dirlist, dirchoices] = spellfile#GetDirChoices() | 43 let [dirlist, dirchoices] = spellfile#GetDirChoices() |
43 if len(dirlist) == 0 | 44 if len(dirlist) == 0 |
44 let dir_to_create = spellfile#WritableSpellDir() | 45 let dir_to_create = spellfile#WritableSpellDir() |
55 if len(dirlist) == 0 | 56 if len(dirlist) == 0 |
56 return | 57 return |
57 endif | 58 endif |
58 endif | 59 endif |
59 | 60 |
60 let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc | 61 let msg = 'Cannot find spell file for "' . lang . '" in ' . &enc |
61 let msg .= "\nDo you want me to try downloading it?" | 62 let msg .= "\nDo you want me to try downloading it?" |
62 if confirm(msg, "&Yes\n&No", 2) == 1 | 63 if confirm(msg, "&Yes\n&No", 2) == 1 |
63 let enc = &encoding | 64 let enc = &encoding |
64 if enc == 'iso-8859-15' | 65 if enc == 'iso-8859-15' |
65 let enc = 'latin1' | 66 let enc = 'latin1' |
66 endif | 67 endif |
67 let fname = a:lang . '.' . enc . '.spl' | 68 let fname = lang . '.' . enc . '.spl' |
68 | 69 |
69 " Split the window, read the file into a new buffer. | 70 " Split the window, read the file into a new buffer. |
70 " Remember the buffer number, we check it below. | 71 " Remember the buffer number, we check it below. |
71 new | 72 new |
72 let newbufnr = winbufnr(0) | 73 let newbufnr = winbufnr(0) |
93 g/^/d | 94 g/^/d |
94 else | 95 else |
95 let newbufnr = winbufnr(0) | 96 let newbufnr = winbufnr(0) |
96 endif | 97 endif |
97 | 98 |
98 let fname = a:lang . '.ascii.spl' | 99 let fname = lang . '.ascii.spl' |
99 echo 'Could not find it, trying ' . fname . '...' | 100 echo 'Could not find it, trying ' . fname . '...' |
100 call spellfile#Nread(fname) | 101 call spellfile#Nread(fname) |
101 if getline(2) !~ 'VIMspell' | 102 if getline(2) !~ 'VIMspell' |
102 echo 'Sorry, downloading failed' | 103 echo 'Sorry, downloading failed' |
103 exe newbufnr . "bwipe!" | 104 exe newbufnr . "bwipe!" |