comparison runtime/tutor/tutor.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 a62eeee5f116
children 7688bff96a8c
comparison
equal deleted inserted replaced
14371:2fb503a18f12 14372:2a4a2dc35c55
57 57
58 if s:ext =~? '\.en' 58 if s:ext =~? '\.en'
59 let s:ext = "" 59 let s:ext = ""
60 endif 60 endif
61 61
62 " The japanese tutor is available in two encodings, guess which one to use 62 " The Japanese tutor is available in three encodings, guess which one to use
63 " The "sjis" one is actually "cp932", it doesn't matter for this text. 63 " The "sjis" one is actually "cp932", it doesn't matter for this text.
64 if s:ext =~? '\.ja' 64 if s:ext =~? '\.ja'
65 if &enc =~ "euc" 65 if &enc =~ "euc"
66 let s:ext = ".ja.euc" 66 let s:ext = ".ja.euc"
67 elseif &enc != "utf-8" 67 elseif &enc != "utf-8"
68 let s:ext = ".ja.sjis" 68 let s:ext = ".ja.sjis"
69 endif 69 endif
70 endif 70 endif
71 71
72 " The korean tutor is available in two encodings, guess which one to use 72 " The Korean tutor is available in two encodings, guess which one to use
73 if s:ext =~? '\.ko' 73 if s:ext =~? '\.ko'
74 if &enc != "utf-8" 74 if &enc != "utf-8"
75 let s:ext = ".ko.euc" 75 let s:ext = ".ko.euc"
76 endif 76 endif
77 endif 77 endif
167 elseif &enc =~ 'iso-8859-2' 167 elseif &enc =~ 'iso-8859-2'
168 let s:ext = '.hr' 168 let s:ext = '.hr'
169 endif 169 endif
170 endif 170 endif
171 171
172 " Esperanto is only available in utf-8
173 if s:ext =~? '\.eo'
174 let s:ext = ".eo.utf-8"
175 endif
176 " Vietnamese is only available in utf-8
177 if s:ext =~? '\.vi'
178 let s:ext = ".vi.utf-8"
179 endif
180
181 " If 'encoding' is utf-8 s:ext must end in utf-8. 172 " If 'encoding' is utf-8 s:ext must end in utf-8.
182 if &enc == 'utf-8' && s:ext !~ '\.utf-8' 173 if &enc == 'utf-8' && s:ext !~ '\.utf-8'
183 let s:ext .= '.utf-8' 174 let s:ext .= '.utf-8'
184 endif 175 endif
185 176
188 let s:tutorxx = $VIMRUNTIME . s:tutorfile . s:ext 179 let s:tutorxx = $VIMRUNTIME . s:tutorfile . s:ext
189 180
190 " 3. Finding the file: 181 " 3. Finding the file:
191 if filereadable(s:tutorxx) 182 if filereadable(s:tutorxx)
192 let $TUTOR = s:tutorxx 183 let $TUTOR = s:tutorxx
184 elseif s:ext !~ '\.utf-8' && filereadable(s:tutorxx . ".utf-8")
185 " Fallback to utf-8 if available.
186 let $TUTOR = s:tutorxx . ".utf-8"
193 else 187 else
194 let $TUTOR = $VIMRUNTIME . s:tutorfile 188 let $TUTOR = $VIMRUNTIME . s:tutorfile
195 echo "The file " . s:tutorxx . " does not exist.\n" 189 echo "The file " . s:tutorxx . " does not exist.\n"
196 echo "Copying English version: " . $TUTOR 190 echo "Copying English version: " . $TUTOR
197 4sleep 191 4sleep