Mercurial > vim
comparison runtime/autoload/netrwFileHandlers.vim @ 4502:605c9ce57ec3
Updated runtime files, language files and translations.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 May 2013 21:01:10 +0200 |
parents | 22fa3049e934 |
children | 75ff30a78189 |
comparison
equal
deleted
inserted
replaced
4501:f4d9819ae32b | 4502:605c9ce57ec3 |
---|---|
1 " netrwFileHandlers: contains various extension-based file handlers for | 1 " netrwFileHandlers: contains various extension-based file handlers for |
2 " netrw's browsers' x command ("eXecute launcher") | 2 " netrw's browsers' x command ("eXecute launcher") |
3 " Author: Charles E. Campbell | 3 " Author: Charles E. Campbell |
4 " Date: Mar 14, 2012 | 4 " Date: May 03, 2013 |
5 " Version: 11a | 5 " Version: 11b ASTRO-ONLY |
6 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 | 6 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 |
7 " Permission is hereby granted to use and distribute this code, | 7 " Permission is hereby granted to use and distribute this code, |
8 " with or without modifications, provided that this copyright | 8 " with or without modifications, provided that this copyright |
9 " notice is copied with it. Like anything else that's free, | 9 " notice is copied with it. Like anything else that's free, |
10 " netrwFileHandlers.vim is provided *as is* and comes with no | 10 " netrwFileHandlers.vim is provided *as is* and comes with no |
18 " --------------------------------------------------------------------- | 18 " --------------------------------------------------------------------- |
19 " Load Once: {{{1 | 19 " Load Once: {{{1 |
20 if exists("g:loaded_netrwFileHandlers") || &cp | 20 if exists("g:loaded_netrwFileHandlers") || &cp |
21 finish | 21 finish |
22 endif | 22 endif |
23 let g:loaded_netrwFileHandlers= "v11a" | 23 let g:loaded_netrwFileHandlers= "v11b" |
24 if v:version < 702 | 24 if v:version < 702 |
25 echohl WarningMsg | 25 echohl WarningMsg |
26 echo "***warning*** this version of netrwFileHandlers needs vim 7.2" | 26 echo "***warning*** this version of netrwFileHandlers needs vim 7.2" |
27 echohl Normal | 27 echohl Normal |
28 finish | 28 finish |
32 | 32 |
33 " --------------------------------------------------------------------- | 33 " --------------------------------------------------------------------- |
34 " netrwFileHandlers#Invoke: {{{1 | 34 " netrwFileHandlers#Invoke: {{{1 |
35 fun! netrwFileHandlers#Invoke(exten,fname) | 35 fun! netrwFileHandlers#Invoke(exten,fname) |
36 " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") | 36 " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") |
37 let fname= a:fname | 37 let exten= a:exten |
38 " list of supported special characters. Consider rcs,v --- that can be | 38 " list of supported special characters. Consider rcs,v --- that can be |
39 " supported with a NFH_rcsCOMMAv() handler | 39 " supported with a NFH_rcsCOMMAv() handler |
40 if a:fname =~ '[@:,$!=\-+%?;~]' | 40 if exten =~ '[@:,$!=\-+%?;~]' |
41 let specials= { | 41 let specials= { |
42 \ '@' : 'AT', | 42 \ '@' : 'AT', |
43 \ ':' : 'COLON', | 43 \ ':' : 'COLON', |
44 \ ',' : 'COMMA', | 44 \ ',' : 'COMMA', |
45 \ '$' : 'DOLLAR', | 45 \ '$' : 'DOLLAR', |
49 \ '+' : 'PLUS', | 49 \ '+' : 'PLUS', |
50 \ '%' : 'PERCENT', | 50 \ '%' : 'PERCENT', |
51 \ '?' : 'QUESTION', | 51 \ '?' : 'QUESTION', |
52 \ ';' : 'SEMICOLON', | 52 \ ';' : 'SEMICOLON', |
53 \ '~' : 'TILDE'} | 53 \ '~' : 'TILDE'} |
54 let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') | 54 let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') |
55 " call Decho('fname<'.fname.'> done with dictionary') | 55 " call Decho('fname<'.fname.'> done with dictionary') |
56 endif | 56 endif |
57 | 57 |
58 if a:exten != "" && exists("*NFH_".a:exten) | 58 if a:exten != "" && exists("*NFH_".exten) |
59 " support user NFH_*() functions | 59 " support user NFH_*() functions |
60 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') | 60 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') |
61 exe "let ret= NFH_".a:exten.'("'.fname.'")' | 61 exe "let ret= NFH_".exten.'("'.a:fname.'")' |
62 elseif a:exten != "" && exists("*s:NFH_".a:exten) | 62 elseif a:exten != "" && exists("*s:NFH_".exten) |
63 " use builtin-NFH_*() functions | 63 " use builtin-NFH_*() functions |
64 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') | 64 " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') |
65 exe "let ret= s:NFH_".a:exten.'("'.fname.'")' | 65 exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")' |
66 endif | 66 endif |
67 | 67 |
68 " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) | 68 " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) |
69 return 0 | 69 return 0 |
70 endfun | 70 endfun |