annotate runtime/autoload/netrwFileHandlers.vim @ 29780:9f8dd1b77563 v9.0.0229

patch 9.0.0229: Vim9: error message for missing type is not clear Commit: https://github.com/vim/vim/commit/62e0e2e54b34b618500be4521ab1c33e1c378b42 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 20 12:07:58 2022 +0100 patch 9.0.0229: Vim9: error message for missing type is not clear Problem: Vim9: error message for missing type is not clear. Solution: Mention the context. (issue https://github.com/vim/vim/issues/10944)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Aug 2022 13:15:03 +0200
parents 75ff30a78189
children 02bd0fe77c68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
1 " netrwFileHandlers: contains various extension-based file handlers for
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
2 " netrw's browsers' x command ("eXecute launcher")
4339
22fa3049e934 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3456
diff changeset
3 " Author: Charles E. Campbell
22328
75ff30a78189 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4502
diff changeset
4 " Date: Sep 18, 2020
75ff30a78189 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4502
diff changeset
5 " Version: 11
4339
22fa3049e934 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3456
diff changeset
6 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
7 " Permission is hereby granted to use and distribute this code,
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
8 " with or without modifications, provided that this copyright
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
9 " notice is copied with it. Like anything else that's free,
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
10 " netrwFileHandlers.vim is provided *as is* and comes with no
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
11 " warranty of any kind, either expressed or implied. In no
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
12 " event will the copyright holder be liable for any damages
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
13 " resulting from the use of this software.
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
14 "
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
15 " Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
16 " is eternal life in Christ Jesus our Lord.
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
17
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
18 " ---------------------------------------------------------------------
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
19 " Load Once: {{{1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
20 if exists("g:loaded_netrwFileHandlers") || &cp
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
21 finish
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
22 endif
22328
75ff30a78189 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 4502
diff changeset
23 let g:loaded_netrwFileHandlers= "v11"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
24 if v:version < 702
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
25 echohl WarningMsg
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
26 echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
27 echohl Normal
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
28 finish
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
29 endif
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
30 let s:keepcpo= &cpo
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
31 set cpo&vim
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
32
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
33 " ---------------------------------------------------------------------
857
b933657f7c9d updated for version 7.0g01
vimboss
parents: 798
diff changeset
34 " netrwFileHandlers#Invoke: {{{1
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
35 fun! netrwFileHandlers#Invoke(exten,fname)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
36 " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
37 let exten= a:exten
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
38 " list of supported special characters. Consider rcs,v --- that can be
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
39 " supported with a NFH_rcsCOMMAv() handler
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
40 if exten =~ '[@:,$!=\-+%?;~]'
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
41 let specials= {
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
42 \ '@' : 'AT',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
43 \ ':' : 'COLON',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
44 \ ',' : 'COMMA',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
45 \ '$' : 'DOLLAR',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
46 \ '!' : 'EXCLAMATION',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
47 \ '=' : 'EQUAL',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
48 \ '-' : 'MINUS',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
49 \ '+' : 'PLUS',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
50 \ '%' : 'PERCENT',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
51 \ '?' : 'QUESTION',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
52 \ ';' : 'SEMICOLON',
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
53 \ '~' : 'TILDE'}
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
54 let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
55 " call Decho('fname<'.fname.'> done with dictionary')
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
56 endif
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
57
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
58 if a:exten != "" && exists("*NFH_".exten)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
59 " support user NFH_*() functions
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
60 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
61 exe "let ret= NFH_".exten.'("'.a:fname.'")'
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
62 elseif a:exten != "" && exists("*s:NFH_".exten)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
63 " use builtin-NFH_*() functions
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
64 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4339
diff changeset
65 exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")'
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
66 endif
3456
4dde9b516e72 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
67
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
68 " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
69 return 0
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
70 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
71
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
72 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
73 " s:NFH_html: handles html when the user hits "x" when the {{{1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
74 " cursor is atop a *.html file
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
75 fun! s:NFH_html(pagefile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
76 " call Dfunc("s:NFH_html(".a:pagefile.")")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
77
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
78 let page= substitute(a:pagefile,'^','file://','')
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
79
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
80 if executable("mozilla")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
81 " call Decho("executing !mozilla ".page)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
82 exe "!mozilla ".shellescape(page,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
83 elseif executable("netscape")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
84 " call Decho("executing !netscape ".page)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
85 exe "!netscape ".shellescape(page,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
86 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
87 " call Dret("s:NFH_html 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
88 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
89 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
90
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
91 " call Dret("s:NFH_html 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
92 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
93 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
94
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
95 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
96 " s:NFH_htm: handles html when the user hits "x" when the {{{1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
97 " cursor is atop a *.htm file
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
98 fun! s:NFH_htm(pagefile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
99 " call Dfunc("s:NFH_htm(".a:pagefile.")")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
100
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
101 let page= substitute(a:pagefile,'^','file://','')
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
102
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
103 if executable("mozilla")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
104 " call Decho("executing !mozilla ".page)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
105 exe "!mozilla ".shellescape(page,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
106 elseif executable("netscape")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
107 " call Decho("executing !netscape ".page)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
108 exe "!netscape ".shellescape(page,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
109 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
110 " call Dret("s:NFH_htm 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
111 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
112 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
113
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
114 " call Dret("s:NFH_htm 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
115 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
116 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
117
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
118 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
119 " s:NFH_jpg: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
120 fun! s:NFH_jpg(jpgfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
121 " call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
122
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
123 if executable("gimp")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
124 exe "silent! !gimp -s ".shellescape(a:jpgfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
125 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
126 " call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
127 exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
128 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
129 " call Dret("s:NFH_jpg 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
130 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
131 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
132
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
133 " call Dret("s:NFH_jpg 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
134 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
135 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
136
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
137 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
138 " s:NFH_gif: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
139 fun! s:NFH_gif(giffile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
140 " call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
141
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
142 if executable("gimp")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
143 exe "silent! !gimp -s ".shellescape(a:giffile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
144 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
145 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
146 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
147 " call Dret("s:NFH_gif 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
148 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
149 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
150
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
151 " call Dret("s:NFH_gif 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
152 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
153 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
154
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
155 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
156 " s:NFH_png: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
157 fun! s:NFH_png(pngfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
158 " call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
159
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
160 if executable("gimp")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
161 exe "silent! !gimp -s ".shellescape(a:pngfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
162 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
163 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
164 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
165 " call Dret("s:NFH_png 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
166 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
167 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
168
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
169 " call Dret("s:NFH_png 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
170 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
171 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
172
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
173 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
174 " s:NFH_pnm: {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
175 fun! s:NFH_pnm(pnmfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
176 " call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
177
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
178 if executable("gimp")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
179 exe "silent! !gimp -s ".shellescape(a:pnmfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
180 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
181 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
182 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
183 " call Dret("s:NFH_pnm 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
184 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
185 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
186
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
187 " call Dret("s:NFH_pnm 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
188 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
189 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
190
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
191 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
192 " s:NFH_bmp: visualize bmp files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
193 fun! s:NFH_bmp(bmpfile)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
194 " call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
195
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
196 if executable("gimp")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
197 exe "silent! !gimp -s ".a:bmpfile
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
198 elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
199 exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
200 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
201 " call Dret("s:NFH_bmp 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
202 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
203 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
204
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
205 " call Dret("s:NFH_bmp 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
206 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
207 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
208
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
209 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
210 " s:NFH_pdf: visualize pdf files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
211 fun! s:NFH_pdf(pdf)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
212 " call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
213 if executable("gs")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
214 exe 'silent! !gs '.shellescape(a:pdf,1)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
215 elseif executable("pdftotext")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
216 exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
217 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
218 " call Dret("s:NFH_pdf 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
219 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
220 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
221
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
222 " call Dret("s:NFH_pdf 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
223 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
224 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
225
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
226 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
227 " s:NFH_doc: visualize doc files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
228 fun! s:NFH_doc(doc)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
229 " call Dfunc("s:NFH_doc(doc<".a:doc.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
230
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
231 if executable("oowriter")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
232 exe 'silent! !oowriter '.shellescape(a:doc,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
233 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
234 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
235 " call Dret("s:NFH_doc 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
236 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
237 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
238
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
239 " call Dret("s:NFH_doc 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
240 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
241 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
242
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
243 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
244 " s:NFH_sxw: visualize sxw files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
245 fun! s:NFH_sxw(sxw)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
246 " call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
247
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
248 if executable("oowriter")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
249 exe 'silent! !oowriter '.shellescape(a:sxw,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
250 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
251 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
252 " call Dret("s:NFH_sxw 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
253 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
254 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
255
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
256 " call Dret("s:NFH_sxw 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
257 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
258 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
259
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
260 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
261 " s:NFH_xls: visualize xls files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
262 fun! s:NFH_xls(xls)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
263 " call Dfunc("s:NFH_xls(xls<".a:xls.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
264
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
265 if executable("oocalc")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
266 exe 'silent! !oocalc '.shellescape(a:xls,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
267 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
268 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
269 " call Dret("s:NFH_xls 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
270 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
271 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
272
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
273 " call Dret("s:NFH_xls 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
274 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
275 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
276
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
277 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
278 " s:NFH_ps: handles PostScript files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
279 fun! s:NFH_ps(ps)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
280 " call Dfunc("s:NFH_ps(ps<".a:ps.">)")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
281 if executable("gs")
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
282 " call Decho("exe silent! !gs ".a:ps)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
283 exe "silent! !gs ".shellescape(a:ps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
284 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
285 elseif executable("ghostscript")
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
286 " call Decho("exe silent! !ghostscript ".a:ps)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
287 exe "silent! !ghostscript ".shellescape(a:ps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
288 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
289 elseif executable("gswin32")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
290 " call Decho("exe silent! !gswin32 ".shellescape(a:ps,1))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
291 exe "silent! !gswin32 ".shellescape(a:ps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
292 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
293 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
294 " call Dret("s:NFH_ps 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
295 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
296 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
297
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
298 " call Dret("s:NFH_ps 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
299 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
300 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
301
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
302 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
303 " s:NFH_eps: handles encapsulated PostScript files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
304 fun! s:NFH_eps(eps)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
305 " call Dfunc("s:NFH_eps()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
306 if executable("gs")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
307 exe "silent! !gs ".shellescape(a:eps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
308 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
309 elseif executable("ghostscript")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
310 exe "silent! !ghostscript ".shellescape(a:eps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
311 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
312 elseif executable("ghostscript")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
313 exe "silent! !ghostscript ".shellescape(a:eps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
314 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
315 elseif executable("gswin32")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
316 exe "silent! !gswin32 ".shellescape(a:eps,1)
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
317 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
318 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
319 " call Dret("s:NFH_eps 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
320 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
321 endif
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
322 " call Dret("s:NFH_eps 0")
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
323 return 1
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
324 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
325
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
326 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
327 " s:NFH_fig: handles xfig files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
328 fun! s:NFH_fig(fig)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
329 " call Dfunc("s:NFH_fig()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
330 if executable("xfig")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
331 exe "silent! !xfig ".a:fig
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
332 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
333 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
334 " call Dret("s:NFH_fig 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
335 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
336 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
337
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
338 " call Dret("s:NFH_fig 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
339 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
340 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
341
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
342 " ---------------------------------------------------------------------
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
343 " s:NFH_obj: handles tgif's obj files {{{1
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
344 fun! s:NFH_obj(obj)
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
345 " call Dfunc("s:NFH_obj()")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
346 if has("unix") && executable("tgif")
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
347 exe "silent! !tgif ".a:obj
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
348 redraw!
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
349 else
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
350 " call Dret("s:NFH_obj 0")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
351 return 0
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
352 endif
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
353
720
e180933b876a updated for version 7.0219
vimboss
parents: 555
diff changeset
354 " call Dret("s:NFH_obj 1")
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
355 return 1
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
356 endfun
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
357
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
358 let &cpo= s:keepcpo
3456
4dde9b516e72 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
359 unlet s:keepcpo
555
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
360 " ---------------------------------------------------------------------
a5efb97bc104 updated for version 7.0157
vimboss
parents:
diff changeset
361 " Modelines: {{{1
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 857
diff changeset
362 " vim: fdm=marker