diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-07-13 17:41:49 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-07-13 17:41:49 +0000 |
commit | c236c16d0884c7d6cdc4dbaddb8cb3992085f83e (patch) | |
tree | 7d87344cdf07b6b9234abe26ccef39fbbee54f63 /runtime/autoload | |
parent | b316376b4893ac3ae62f7f33c483b28b7fc147c0 (diff) |
updated for version 7.2b-000v7.2b.000
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/ada.vim | 87 | ||||
-rw-r--r-- | runtime/autoload/adacomplete.vim | 4 | ||||
-rw-r--r-- | runtime/autoload/decada.vim | 8 | ||||
-rw-r--r-- | runtime/autoload/getscript.vim | 20 | ||||
-rw-r--r-- | runtime/autoload/gnat.vim | 28 | ||||
-rw-r--r-- | runtime/autoload/gzip.vim | 10 | ||||
-rw-r--r-- | runtime/autoload/netrw.vim | 895 | ||||
-rw-r--r-- | runtime/autoload/netrwSettings.vim | 19 | ||||
-rw-r--r-- | runtime/autoload/rubycomplete.vim | 14 | ||||
-rw-r--r-- | runtime/autoload/tar.vim | 90 | ||||
-rw-r--r-- | runtime/autoload/zip.vim | 68 |
11 files changed, 665 insertions, 578 deletions
diff --git a/runtime/autoload/ada.vim b/runtime/autoload/ada.vim index 46257010d0..ffd0ff84cc 100644 --- a/runtime/autoload/ada.vim +++ b/runtime/autoload/ada.vim @@ -2,13 +2,15 @@ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id$ -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> +" Taylor Venable <taylor@metasyntax.net> " Neil Bird <neil@fnxweb.com> +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK ' should not be in iskeyword. " 16.07.2006 MK Ada-Mode as vim-ball @@ -17,6 +19,10 @@ " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces +" 08.07.2007 TV fix mapleader problems. +" 09.05.2007 MK Session just won't work no matter how much +" tweaking is done +" 19.09.2007 NO still some mapleader problems " Help Page: ft-ada-functions "------------------------------------------------------------------------------ @@ -425,30 +431,49 @@ function ada#Create_Tags (option) execute '!ctags --excmd=number ' . l:Filename endfunction ada#Create_Tags -function ada#Switch_Session (New_Session) "{{{1 - if a:New_Session != v:this_session - " - " We actualy got a new session - otherwise there - " is nothing to do. - " - if strlen (v:this_session) > 0 - execute 'mksession! ' . v:this_session - endif +" Section: ada#Switch_Session {{{1 +" +function ada#Switch_Session (New_Session) + " + " you should not save to much date into the seession since they will + " be sourced + " + let l:sessionoptions=&sessionoptions - let v:this_session = a:New_Session + try + set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize - if filereadable (v:this_session) - execute 'source ' . v:this_session - endif + if a:New_Session != v:this_session + " + " We actualy got a new session - otherwise there + " is nothing to do. + " + if strlen (v:this_session) > 0 + execute 'mksession! ' . v:this_session + endif - augroup ada_session - autocmd! - autocmd VimLeavePre * execute 'mksession! ' . v:this_session - augroup END - endif + let v:this_session = a:New_Session + + "if filereadable (v:this_session) + "execute 'source ' . v:this_session + "endif + + augroup ada_session + autocmd! + autocmd VimLeavePre * execute 'mksession! ' . v:this_session + augroup END + + "if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open + "TlistOpen + "endif + + endif + finally + let &sessionoptions=l:sessionoptions + endtry return -endfunction ada#Switch_Session "}}}1 +endfunction ada#Switch_Session " Section: GNAT Pretty Printer folding {{{1 " @@ -546,18 +571,23 @@ function ada#Map_Menu (Text, Keys, Command) \ a:Keys . \" <C-O>:" . a:Command . "<CR>" else + if exists("g:mapleader") + let l:leader = g:mapleader + else + let l:leader = '\' + endif execute \ "50amenu " . \ "Ada." . escape(a:Text, ' ') . - \ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "<CR>" execute \ "nnoremap <buffer>" . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" :" . a:Command execute \ "inoremap <buffer>" . - \ escape(g:mapleader . "a" . a:Keys , '\') . + \ escape(l:leader . "a" . a:Keys , '\') . \" <C-O>:" . a:Command endif return @@ -566,10 +596,15 @@ endfunction " Section: ada#Map_Popup {{{2 " function ada#Map_Popup (Text, Keys, Command) + if exists("g:mapleader") + let l:leader = g:mapleader + else + let l:leader = '\' + endif execute \ "50amenu " . \ "PopUp." . escape(a:Text, ' ') . - \ "<Tab>" . escape(g:mapleader . "a" . a:Keys , '\') . + \ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') . \ " :" . a:Command . "<CR>" call ada#Map_Menu (a:Text, a:Keys, a:Command) diff --git a/runtime/autoload/adacomplete.vim b/runtime/autoload/adacomplete.vim index 28d68f63dc..8db4351ffd 100644 --- a/runtime/autoload/adacomplete.vim +++ b/runtime/autoload/adacomplete.vim @@ -5,9 +5,9 @@ " Maintainer: Martin Krischik " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ " History: 24.05.2006 MK Unified Headers " 26.05.2006 MK improved search for begin of word. " 16.07.2006 MK Ada-Mode as vim-ball diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim index 9f8aaf260d..fb5400e179 100644 --- a/runtime/autoload/decada.vim +++ b/runtime/autoload/decada.vim @@ -3,12 +3,12 @@ " Language: Ada (Dec Ada) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischik <krischik@users.sourceforge.net> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ " History: 21.07.2006 MK New Dec Ada " 15.10.2006 MK Bram's suggestion for runtime integration " 05.11.2006 MK Bram suggested not to use include protection for @@ -45,7 +45,7 @@ function decada#Set_Session (...) dict " {{{1 call ada#Switch_Session (a:1) elseif argc() == 0 && strlen (v:servername) > 0 call ada#Switch_Session ( - \ expand('~')[0:-2] . ".vimfiles.session]" . + \ expand('~')[0:-2] . ".vimfiles.session]decada_" . \ v:servername . ".vim") endif return diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index c1e1aa34a5..5a466cb88b 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -1,8 +1,8 @@ " --------------------------------------------------------------------- " getscript.vim " Author: Charles E. Campbell, Jr. -" Date: May 30, 2008 -" Version: 30 +" Date: Jul 10, 2008 +" Version: 31 " Installing: :help glvs-install " Usage: :help glvs " @@ -23,7 +23,7 @@ set cpo&vim if exists("g:loaded_getscript") finish endif -let g:loaded_getscript= "v30" +let g:loaded_getscript= "v31" " --------------------------- " Global Variables: {{{1 @@ -140,6 +140,12 @@ fun! getscript#GetLatestVimScripts() return endif + " insure that fnameescape() is available + if !exists("*fnameescape") + echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)" + return + endif + " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") @@ -181,7 +187,8 @@ fun! getscript#GetLatestVimScripts() " don't let any events interfere (like winmanager's, taglist's, etc) let eikeep= &ei - set ei=all + let hlskeep= &hls + set ei=all hls&vim " record current directory, change to datadir, open split window with " datafile @@ -316,6 +323,7 @@ fun! getscript#GetLatestVimScripts() " restore events and current directory exe "cd ".fnameescape(substitute(origdir,'\','/','ge')) let &ei= eikeep + let &hls= hlskeep setlocal nolz " call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") " call Dret("GetLatestVimScripts : did ".s:downloads." downloads") @@ -506,14 +514,14 @@ fun! s:GetOneScript(...) new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)|q else " call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=')) - exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=') + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=').latestsrcid endif " AutoInstall: only if doautoinstall has been requested by the plugin itself if doautoinstall " call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) if filereadable(sname) - call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)) +" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)) exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall) let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") let installdir= curdir."/Installed" diff --git a/runtime/autoload/gnat.vim b/runtime/autoload/gnat.vim index 5f99450ef1..cebde8e1a4 100644 --- a/runtime/autoload/gnat.vim +++ b/runtime/autoload/gnat.vim @@ -3,12 +3,13 @@ " Language: Ada (GNAT) " $Id$ " Copyright: Copyright (C) 2006 Martin Krischik -" Maintainer: Martin Krischik +" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k +" Ned Okie <nokie@radford.edu> " $Author$ " $Date$ -" Version: 4.2 +" Version: 4.6 " $Revision$ -" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ +" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $ " History: 24.05.2006 MK Unified Headers " 16.07.2006 MK Ada-Mode as vim-ball " 05.08.2006 MK Add session support @@ -16,6 +17,7 @@ " 05.11.2006 MK Bram suggested not to use include protection for " autoload " 05.11.2006 MK Bram suggested to save on spaces +" 19.09.2007 NO use project file only when there is a project " Help Page: compiler-gnat "------------------------------------------------------------------------------ @@ -71,13 +73,19 @@ function gnat#Set_Project_File (...) dict " {{{1 execute 'mksession! ' . v:this_session endif - if strlen (self.Project_File) > 0 - call ada#Switch_Session ( - \ expand('~') . "/vimfiles/session/" . - \ fnamemodify (self.Project_File, ":t:r") . ".vim") - else - call ada#Switch_Session ('') - endif + "if strlen (self.Project_File) > 0 + "if has("vms") + "call ada#Switch_Session ( + "\ expand('~')[0:-2] . ".vimfiles.session]gnat_" . + "\ fnamemodify (self.Project_File, ":t:r") . ".vim") + "else + "call ada#Switch_Session ( + "\ expand('~') . "/vimfiles/session/gnat_" . + "\ fnamemodify (self.Project_File, ":t:r") . ".vim") + "endif + "else + "call ada#Switch_Session ('') + "endif return endfunction gnat#Set_Project_File " }}}1 diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim index 1ad29eaaa3..1245fdddc9 100644 --- a/runtime/autoload/gzip.vim +++ b/runtime/autoload/gzip.vim @@ -1,6 +1,6 @@ " Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2008 May 29 +" Last Change: 2008 Jul 04 " These functions are used by the gzip plugin. @@ -153,9 +153,9 @@ fun gzip#write(cmd) let nmt = s:tempname(nm) if rename(nm, nmt) == 0 if exists("b:gzip_comp_arg") - call system(a:cmd . " " . b:gzip_comp_arg . " " . s:escape(nmt)) + call system(a:cmd . " " . b:gzip_comp_arg . " -- " . s:escape(nmt)) else - call system(a:cmd . " " . s:escape(nmt)) + call system(a:cmd . " -- " . s:escape(nmt)) endif call rename(nmt . "." . expand("<afile>:e"), nm) endif @@ -180,10 +180,10 @@ fun gzip#appre(cmd) if rename(nm, nmte) == 0 if &patchmode != "" && getfsize(nm . &patchmode) == -1 " Create patchmode file by creating the decompressed file new - call system(a:cmd . " -c " . s:escape(nmte) . " > " . s:escape(nmt)) + call system(a:cmd . " -c -- " . s:escape(nmte) . " > " . s:escape(nmt)) call rename(nmte, nm . &patchmode) else - call system(a:cmd . " " . s:escape(nmte)) + call system(a:cmd . " -- " . s:escape(nmte)) endif call rename(nmt, nm) endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 6064a6570d..6221294bbd 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jun 12, 2008 -" Version: 125 +" Date: Jul 12, 2008 +" Version: 127 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 @@ -27,19 +27,13 @@ if !exists("s:NOTE") let s:WARNING = 1 let s:ERROR = 2 endif -let g:loaded_netrw = "v125" +let g:loaded_netrw = "v127" " sanity checks if v:version < 700 call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1) finish endif -if !exists("*shellescape") - call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has shellescape()",64) -endif -if !exists("*fnameescape") - call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has fnameescape()",65) -endif let s:keepcpo= &cpo setlocal cpo&vim @@ -312,6 +306,9 @@ if !exists("g:netrw_sort_by") " alternatives: date size let g:netrw_sort_by= "name" endif +if !exists("g:netrw_sort_options") + let g:netrw_sort_options= "" +endif if !exists("g:netrw_sort_direction") " alternative: reverse (z y x ...) let g:netrw_sort_direction= "normal" @@ -415,7 +412,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_twkeep = &l:tw " textwidth let {a:vt}netrw_wigkeep = &l:wig " wildignore if has("win32") && !has("win95") - let {a:vt}netrw_swfkeep= &l:swf " swapfile + let {a:vt}netrw_swfkeep = &l:swf " swapfile endif if &go =~ 'a' | silent! let {a:vt}netrw_regstar = @* | endif silent! let {a:vt}netrw_regslash= @/ @@ -428,7 +425,7 @@ endfun fun! s:NetrwOptionRestore(vt) " call Dfunc("s:NetrwOptionRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")) if !exists("{a:vt}netrw_optionsave") -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist") return endif @@ -492,7 +489,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) " call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("s:NetrwOptionRestore : win#".winnr()." buf#".bufnr("%")) endfun @@ -536,12 +533,12 @@ fun! netrw#NetrwClean(sys) for dir in split(&rtp,',') if filereadable(dir."/plugin/netrwPlugin.vim") " call Decho("removing netrw-related files from ".dir) - if s:System("delete",dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif - if s:System("delete",dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif - if s:System("delete",dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif - if s:System("delete",dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif - if s:System("delete",dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif - if s:System("delete",dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif + if s:NetrwDelete(dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif + if s:NetrwDelete(dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif + if s:NetrwDelete(dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif + if s:NetrwDelete(dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif let diddir= dir let diddel= diddel + 1 if !a:sys|break|endif @@ -704,8 +701,8 @@ fun! netrw#NetRead(mode,...) let uid_machine = g:netrw_machine endif endif -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile) +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -725,18 +722,18 @@ fun! netrw#NetRead(mode,...) exe "put ='".'get \"'.netrw_fname.'\" '.tmpfile."'" " call Decho("filter input: ".getline('.')) if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine." ".g:netrw_port,1) else -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying ' - let debugkeep= &debug + let debugkeep = &debug setlocal debug=msg call netrw#ErrorMsg(s:ERROR,getline(1),4) - let &debug= debugkeep + let &debug = debugkeep endif call s:SaveBufVars()|bd!|call s:RestoreBufVars() let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) @@ -806,8 +803,8 @@ fun! netrw#NetRead(mode,...) else let useport= "" endif -" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile +" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -823,23 +820,22 @@ fun! netrw#NetRead(mode,...) return endif - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if match(b:netrw_fname,"#") == -1 - " simple wget -" call Decho('using simple wget (# not in b:netrw_fname<'.b:netrw_fname.">)") -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname) + " using g:netrw_http_cmd (usually wget or curl) +" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)") +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) else - " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) + " wget/curl plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) " call Decho(("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)") - let netrw_html= substitute(netrw_fname,"#.*$","","") - let netrw_tag = substitute(netrw_fname,"^.*#","","") + let netrw_html= substitute(b:netrw_fname,"#.*$","","") + let netrw_tag = substitute(b:netrw_fname,"^.*#","","") " call Decho("netrw_html<".netrw_html.">") " call Decho("netrw_tag <".netrw_tag.">") -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html)) - exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1)) + exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1) let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) " call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/') exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>" @@ -877,9 +873,8 @@ fun! netrw#NetRead(mode,...) " rsync: NetRead Method #7 {{{3 elseif b:netrw_method == 7 " call Decho("read via rsync (method #7)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1) let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -888,7 +883,6 @@ fun! netrw#NetRead(mode,...) " fetch://[user@]host[:http]/path elseif b:netrw_method == 8 " call Decho("read via fetch (method #8)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_fetch_cmd == "" if !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"fetch command not available",7) @@ -903,11 +897,11 @@ fun! netrw#NetRead(mode,...) " call Decho("read via fetch for ".netrw_option) if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != "" -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1) else -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1) endif let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) @@ -918,9 +912,8 @@ fun! netrw#NetRead(mode,...) " sftp: NetRead Method #9 {{{3 elseif b:netrw_method == 9 " call Decho("read via sftp (method #9)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile) - exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile) + exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice @@ -939,7 +932,7 @@ fun! netrw#NetRead(mode,...) endif if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' " call Decho("cleanup by deleting tmpfile<".tmpfile.">") - call s:System("delete",fnameescape(tmpfile)) + call s:NetrwDelete(fnameescape(tmpfile)) endif call s:NetrwOptionRestore("w:") @@ -975,17 +968,17 @@ fun! netrw#NetWrite(...) range " For binary writes, always write entire file. " (line numbers don't really make sense for that). " Also supports the writing of tar and zip files. -" call Decho("(write entire file) silent exe w! ".v:cmdarg." ".tmpfile) - silent exe "w! ".v:cmdarg." ".tmpfile +" call Decho("(write entire file) silent exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) elseif g:netrw_cygwin " write (selected portion of) file to temporary let cygtmpfile= substitute(tmpfile,'/cygdrive/\(.\)','\1:','') -" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".v:cmdarg." ".cygtmpfile) - silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".cygtmpfile +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile) else " write (selected portion of) file to temporary -" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile) - silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile +" call Decho("(write selected portion) silent exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)) + silent exe a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile) endif if curbufname == "" @@ -1079,9 +1072,8 @@ fun! netrw#NetWrite(...) range let uid_machine = g:netrw_machine endif endif - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname) +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1101,12 +1093,12 @@ fun! netrw#NetWrite(...) range exe "put ='".'put \"'.tmpfile.'\" \"'.netrw_fname.'\"'."'" " call Decho("filter input: ".getline('.')) if exists("g:netrw_port") && g:netrw_port != "" -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1) else " call Decho("filter input window#".winnr()) -" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine) - exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine +" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1) endif " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar) if getline(1) !~ "^$" @@ -1167,14 +1159,13 @@ fun! netrw#NetWrite(...) range " scp: NetWrite Method #4 {{{4 elseif b:netrw_method == 4 " call Decho("write via scp (method #4)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if exists("g:netrw_port") && g:netrw_port != "" - let useport= " ".g:netrw_scpport." ".g:netrw_port + let useport= " ".g:netrw_scpport." ".fnameescape(g:netrw_port) else let useport= "" endif -" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname)) - exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname) +" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1215,9 +1206,8 @@ fun! netrw#NetWrite(...) range " rsync: NetWrite Method #7 {{{4 elseif b:netrw_method == 7 " call Decho("write via rsync (method #7)") - let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) -" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname) - exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname +" call Decho("executing: !".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)) + exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1) let b:netrw_lastfile = choice "......................................... @@ -1235,8 +1225,8 @@ fun! netrw#NetWrite(...) range put ='put \"'.escape(tmpfile,'\').'\" '.netrw_fname " call Decho("filter input: ".getline('.')) norm! 1Gdd -" call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine) - exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine +" call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1)) + exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1) bd! let b:netrw_lastfile= choice @@ -1251,7 +1241,7 @@ fun! netrw#NetWrite(...) range " call Decho("cleanup") if s:FileReadable(tmpfile) " call Decho("tmpfile<".tmpfile."> readable, will now delete it") - call s:System("delete",tmpfile) + call s:NetrwDelete(tmpfile) endif call s:NetrwOptionRestore("w:") @@ -1312,7 +1302,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " readcmd=='t': simply do nothing if a:readcmd == 't' -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("NetrwGetFile : skip read of <".a:tfile.">") return endif @@ -1336,8 +1326,8 @@ fun! s:NetrwGetFile(readcmd, tfile, method) else let tfile= a:tfile endif -" " call Decho("exe silent! keepalt file ".tfile) - exe "silent! keepalt file ".tfile +" call Decho("exe silent! keepalt file ".fnameescape(tfile)) + exe "silent! keepalt file ".fnameescape(tfile) " edit temporary file (ie. read the temporary file in) if rfile =~ '\.zip$' @@ -1358,8 +1348,8 @@ fun! s:NetrwGetFile(readcmd, tfile, method) endif " rename buffer back to remote filename -" call Decho("exe silent! keepalt file ".escape(rfile,' ')) - exe "silent! keepalt file ".escape(rfile,' ') +" call Decho("exe silent! keepalt file ".fnameescape(rfile)) + exe "silent! keepalt file ".fnameescape(rfile) if a:method == 5 set ft=html else @@ -1374,14 +1364,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " call Decho("read file<".a:tfile."> after current line") let curline = line(".") let lastline= line("$") -" call Decho("exe<".a:readcmd." ".v:cmdarg." ".a:tfile."> line#".curline) - exe a:readcmd." ".v:cmdarg." ".a:tfile +" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline) + exe a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile) let line1= curline + 1 let line2= line("$") - lastline + 1 else " not readable -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Decho("tfile<".a:tfile."> not readable") call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9) " call Dret("NetrwGetFile : tfile<".a:tfile."> not readable") @@ -1406,7 +1396,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " make sure file is being displayed " redraw! -" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap) +" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) " call Dret("NetrwGetFile") endfun @@ -1704,6 +1694,7 @@ fun! s:BrowserMaps(islocal) nnoremap <buffer> <silent> U :<c-u>call <S |