diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-03-22 21:02:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-03-22 21:02:50 +0100 |
commit | a68783751647e3243ca6f22df62907efbdbccb02 (patch) | |
tree | 372908fd79defec22190b6d2a48bbc6155bb22e7 /runtime | |
parent | ed287f9a4e3f4ed5528ad2af65b7b23bce14a688 (diff) |
Updated runtime files.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/netrw.vim | 3538 | ||||
-rw-r--r-- | runtime/autoload/phpcomplete.vim | 7315 | ||||
-rw-r--r-- | runtime/colors/delek.vim | 12 | ||||
-rw-r--r-- | runtime/colors/industry.vim | 40 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 12 | ||||
-rw-r--r-- | runtime/doc/index.txt | 6 | ||||
-rw-r--r-- | runtime/doc/os_vms.txt | 2 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 227 | ||||
-rw-r--r-- | runtime/doc/quickfix.txt | 6 | ||||
-rw-r--r-- | runtime/doc/tags | 12 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 65 | ||||
-rw-r--r-- | runtime/ftplugin/clojure.vim | 19 | ||||
-rw-r--r-- | runtime/ftplugin/j.vim | 7 | ||||
-rw-r--r-- | runtime/indent/clojure.vim | 83 | ||||
-rw-r--r-- | runtime/indent/j.vim | 15 | ||||
-rw-r--r-- | runtime/plugin/netrwPlugin.vim | 24 | ||||
-rw-r--r-- | runtime/syntax/euphoria4.vim | 11 | ||||
-rw-r--r-- | runtime/syntax/j.vim | 78 | ||||
-rw-r--r-- | runtime/syntax/netrw.vim | 10 | ||||
-rw-r--r-- | runtime/syntax/sh.vim | 65 | ||||
-rw-r--r-- | runtime/syntax/tex.vim | 98 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 144 | ||||
-rw-r--r-- | runtime/syntax/yacc.vim | 6 |
23 files changed, 4881 insertions, 6914 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 4634a343c5..5b1c27a8a2 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: Jan 21, 2014 -" Version: 150 +" Date: Mar 20, 2014 +" Version: 151 " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v150" +let g:loaded_netrw = "v151" if !exists("s:NOTE") let s:NOTE = 0 let s:WARNING = 1 @@ -30,7 +30,8 @@ if !exists("s:NOTE") endif let s:keepcpo= &cpo -set cpo&vim +setl cpo&vim +"let g:dechofuncname=1 "DechoRemOn "call Decho("doing autoload/netrw.vim version ".g:loaded_netrw) @@ -43,7 +44,7 @@ set cpo&vim " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Jan 03, 2014 : max errnum currently is 95 +" Mar 04, 2014 : max errnum currently is 96 fun! netrw#ErrorMsg(level,msg,errnum) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) @@ -98,7 +99,7 @@ fun! netrw#ErrorMsg(level,msg,errnum) hi link netrwMesgWarning WarningMsg hi link netrwMesgError Error endif -" call Decho("(ErrorMsg) setl noma ro bh=wipe") +" call Decho("setl noma ro bh=wipe") setl noma ro bh=wipe else @@ -297,7 +298,7 @@ if !exists("g:netrw_list_cmd") " provide a scp-based default listing command let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa" else -" call Decho(g:netrw_ssh_cmd." is not executable") +" call Decho("g:netrw_ssh_cmd." is not executable") let g:netrw_list_cmd= "" endif endif @@ -379,8 +380,17 @@ call s:NetrwInit("g:netrw_sshport" , "-p") call s:NetrwInit("g:netrw_rename_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME mv") call s:NetrwInit("g:netrw_rm_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm") call s:NetrwInit("g:netrw_rmdir_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rmdir") -call s:NetrwInit("g:netrw_rmf_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm -f") -" Default values - s ---------- {{{3 +call s:NetrwInit("g:netrw_rmf_cmd" , g:netrw_ssh_cmd." USEPORT HOSTNAME rm -f ") +" Default values - q-s ---------- {{{3 +call s:NetrwInit("g:netrw_quickhelp",0) +let s:QuickHelp= ["-:go up dir D:delete R:rename s:sort-by x:special", + \ "%:create new file d:create new directory", + \ "o:split&open v:vert-split&open", + \ "i:style qf:file info O:obtain r:reverse p:preview", + \ "mf:mark file mt:set target mm:move mc:copy", + \ "-bookmarks- mb:make mB:delete qb:list gb:go to", + \ "-history- qb:list u:go up U:go down", + \ "-targets- mt:target Tb:use bookmark Th:use history"] " g:netrw_sepchr: picking a character that doesn't appear in filenames that can be used to separate priority from filename call s:NetrwInit("g:netrw_sepchr" , (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>") call s:NetrwInit("s:netrw_silentxfer" , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil keepj " : "keepj ") @@ -396,7 +406,7 @@ if !exists("g:netrw_sort_sequence") endif call s:NetrwInit("g:netrw_special_syntax" , 0) call s:NetrwInit("g:netrw_ssh_browse_reject", '^total\s\+\d\+$') -call s:NetrwInit("g:netrw_use_noswf" , 0) +call s:NetrwInit("g:netrw_use_noswf" , 1) " Default values - t-w ---------- {{{3 call s:NetrwInit("g:netrw_timefmt","%c") if !exists("g:netrw_xstrlen") @@ -426,7 +436,7 @@ endif call s:NetrwInit("g:netrw_menu_escape",'.&? \') call s:NetrwInit("g:netrw_tmpfile_escape",' &;') call s:NetrwInit("s:netrw_map_escape","<|\n\r\\\<C-V>\"") -if &enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4' +if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') let s:treedepthstring= "│ " else let s:treedepthstring= "| " @@ -442,8 +452,8 @@ endif " ====================== if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") " call Decho("installed beval events") - let &l:bexpr = "netrw#NetrwBalloonHelp()" - au FileType netrw set beval + let &l:bexpr = "netrw#BalloonHelp()" + au FileType netrw setl beval au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif au VimEnter * let s:initbeval= &beval "else " Decho @@ -461,10 +471,10 @@ au WinEnter * if &ft == "netrw"|call s:NetrwInsureWinVars()|endif " ============================== " --------------------------------------------------------------------- -" netrw#NetrwBalloonHelp: {{{2 +" netrw#BalloonHelp: {{{2 if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_on") && !exists("g:netrw_nobeval") " call Decho("loading netrw#BalloonHelp()") - fun! netrw#NetrwBalloonHelp() + fun! netrw#BalloonHelp() if &ft != "netrw" return "" endif @@ -498,262 +508,6 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_ endif " ------------------------------------------------------------------------ -" s:NetrwOptionSave: save options prior to setting to "netrw-buffer-standard" form {{{2 -" Options get restored by s:NetrwOptionRestore() -" 06/08/07 : removed call to NetrwSafeOptions(), either placed -" immediately after NetrwOptionSave() calls in NetRead -" and NetWrite, or after the s:NetrwEnew() call in -" NetrwBrowse. -" vt: normally its "w:" or "s:" (a variable type) -fun! s:NetrwOptionSave(vt) -" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma) -" call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist")) -" call Decho("(s:NetrwOptionSave) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt) - - if !exists("{a:vt}netrw_optionsave") - let {a:vt}netrw_optionsave= 1 - else -" call Dret("s:NetrwOptionSave : options already saved") - return - endif -" call Decho("(s:NetrwOptionSave) prior to save: fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." diff=".&l:diff) - - " Save current settings and current directory -" call Decho("saving current settings and current directory") - let s:yykeep = @@ - if exists("&l:acd")|let {a:vt}netrw_acdkeep = &l:acd|endif - let {a:vt}netrw_aikeep = &l:ai - let {a:vt}netrw_awkeep = &l:aw - let {a:vt}netrw_bhkeep = &l:bh - let {a:vt}netrw_blkeep = &l:bl - let {a:vt}netrw_btkeep = &l:bt - let {a:vt}netrw_bombkeep = &l:bomb - let {a:vt}netrw_cedit = &cedit - let {a:vt}netrw_cikeep = &l:ci - let {a:vt}netrw_cinkeep = &l:cin - let {a:vt}netrw_cinokeep = &l:cino - let {a:vt}netrw_comkeep = &l:com - let {a:vt}netrw_cpokeep = &l:cpo - let {a:vt}netrw_diffkeep = &l:diff - let {a:vt}netrw_fenkeep = &l:fen - let {a:vt}netrw_ffkeep = &l:ff - let {a:vt}netrw_fokeep = &l:fo " formatoptions - let {a:vt}netrw_gdkeep = &l:gd " gdefault - let {a:vt}netrw_hidkeep = &l:hidden - let {a:vt}netrw_imkeep = &l:im - let {a:vt}netrw_iskkeep = &l:isk - let {a:vt}netrw_lskeep = &l:ls - let {a:vt}netrw_makeep = &l:ma - let {a:vt}netrw_magickeep = &l:magic - let {a:vt}netrw_modkeep = &l:mod - let {a:vt}netrw_nukeep = &l:nu - let {a:vt}netrw_repkeep = &l:report - let {a:vt}netrw_rokeep = &l:ro - let {a:vt}netrw_selkeep = &l:sel - let {a:vt}netrw_spellkeep = &l:spell - let {a:vt}netrw_starkeep = @* - let {a:vt}netrw_tskeep = &l:ts - let {a:vt}netrw_twkeep = &l:tw " textwidth - let {a:vt}netrw_wigkeep = &l:wig " wildignore - let {a:vt}netrw_wrapkeep = &l:wrap - let {a:vt}netrw_writekeep = &l:write - if g:netrw_use_noswf && has("win32") && !has("win95") - let {a:vt}netrw_swfkeep = &l:swf - endif - - " save a few selected netrw-related variables -" call Decho("saving a few selected netrw-related variables") - if g:netrw_keepdir - let {a:vt}netrw_dirkeep = getcwd() - endif - if has("win32") && !has("win95") - let {a:vt}netrw_swfkeep = &l:swf " swapfile - endif - if &go =~# 'a' | sil! let {a:vt}netrw_regstar = @* | endif - sil! let {a:vt}netrw_regslash= @/ - -" call Decho("(s:NetrwOptionSave) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt) -" call Dret("s:NetrwOptionSave : tab#".tabpagenr()." win#".winnr()) -endfun - -" ------------------------------------------------------------------------ -" s:NetrwOptionRestore: restore options (based on prior s:NetrwOptionSave) {{{2 -fun! s:NetrwOptionRestore(vt) -" call Dfunc("s:NetrwOptionRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$")) -" call Decho("(NetrwOptionRestore) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt) - if !exists("{a:vt}netrw_optionsave") - if exists("s:nbcd_curpos_{bufnr('%')}") -" call Decho("(NetrwOptionRestore) restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)") - keepj call netrw#NetrwRestorePosn(s:nbcd_curpos_{bufnr('%')}) -" call Decho("(NetrwOptionRestore) win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$")) -" call Decho("(NetrwOptionRestore) unlet s:nbcd_curpos_".bufnr('%')) - unlet s:nbcd_curpos_{bufnr('%')} - else -" call Decho("(NetrwOptionRestore) no previous position") - endif -" call Decho("(NetrwOptionRestore) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt) -" call Decho("(NetrwOptionRestore) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") -" call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist") - return - endif - unlet {a:vt}netrw_optionsave - - if exists("+acd") - if exists("{a:vt}netrw_acdkeep") -" call Decho("(NetrwOptionRestore) g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) - let curdir = getcwd() - let &l:acd = {a:vt}netrw_acdkeep - unlet {a:vt}netrw_acdkeep - if &l:acd -" call Decho("exe keepj lcd ".fnameescape(curdir)) " NOTE: was g:netrw_fname_escape for some reason - try - if !exists("&l:acd") && !&l:acd - exe 'keepj lcd '.fnameescape(curdir) - endif - catch /^Vim\%((\a\+)\)\=:E472/ - call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".curdir."> (permissions?)",61) - endtry - endif - endif - endif - if exists("{a:vt}netrw_aikeep") |let &l:ai = {a:vt}netrw_aikeep |unlet {a:vt}netrw_aikeep |endif - if exists("{a:vt}netrw_awkeep") |let &l:aw = {a:vt}netrw_awkeep |unlet {a:vt}netrw_awkeep |endif - if g:netrw_liststyle != s:TREELIST - if exists("{a:vt}netrw_bhkeep") |let &l:bh = {a:vt}netrw_bhkeep |unlet {a:vt}netrw_bhkeep |endif - endif - if exists("{a:vt}netrw_blkeep") |let &l:bl = {a:vt}netrw_blkeep |unlet {a:vt}netrw_blkeep |endif - if exists("{a:vt}netrw_btkeep") |let &l:bt = {a:vt}netrw_btkeep |unlet {a:vt}netrw_btkeep |endif - if exists("{a:vt}netrw_bombkeep") |let &l:bomb = {a:vt}netrw_bombkeep |unlet {a:vt}netrw_bombkeep |endif - if exists("{a:vt}netrw_cedit") |let &cedit = {a:vt}netrw_cedit |unlet {a:vt}netrw_cedit |endif - if exists("{a:vt}netrw_cikeep") |let &l:ci = {a:vt}netrw_cikeep |unlet {a:vt}netrw_cikeep |endif - if exists("{a:vt}netrw_cinkeep") |let &l:cin = {a:vt}netrw_cinkeep |unlet {a:vt}netrw_cinkeep |endif - if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif - if exists("{a:vt}netrw_comkeep") |let &l:com = {a:vt}netrw_comkeep |unlet {a:vt}netrw_comkeep |endif - if exists("{a:vt}netrw_cpokeep") |let &l:cpo = {a:vt}netrw_cpokeep |unlet {a:vt}netrw_cpokeep |endif - if exists("{a:vt}netrw_diffkeep") |let &l:diff = {a:vt}netrw_diffkeep |unlet {a:vt}netrw_diffkeep |endif - if exists("{a:vt}netrw_fenkeep") |let &l:fen = {a:vt}netrw_fenkeep |unlet {a:vt}netrw_fenkeep |endif - if exists("{a:vt}netrw_ffkeep") |let &l:ff = {a:vt}netrw_ffkeep |unlet {a:vt}netrw_ffkeep |endif - if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif - if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif - if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif - if exists("{a:vt}netrw_imkeep") |let &l:im = {a:vt}netrw_imkeep |unlet {a:vt}netrw_imkeep |endif - if exists("{a:vt}netrw_iskkeep") |let &l:isk = {a:vt}netrw_iskkeep |unlet {a:vt}netrw_iskkeep |endif - if exists("{a:vt}netrw_lskeep") |let &l:ls = {a:vt}netrw_lskeep |unlet {a:vt}netrw_lskeep |endif - if exists("{a:vt}netrw_makeep") |let &l:ma = {a:vt}netrw_makeep |unlet {a:vt}netrw_makeep |endif - if exists("{a:vt}netrw_magickeep")|let &l:magic = {a:vt}netrw_magickeep |unlet {a:vt}netrw_magickeep|endif - if exists("{a:vt}netrw_modkeep") |let &l:mod = {a:vt}netrw_modkeep |unlet {a:vt}netrw_modkeep |endif - if exists("{a:vt}netrw_nukeep") |let &l:nu = {a:vt}netrw_nukeep |unlet {a:vt}netrw_nukeep |endif - if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif - if exists("{a:vt}netrw_rokeep") |let &l:ro = {a:vt}netrw_rokeep |unlet {a:vt}netrw_rokeep |endif - if exists("{a:vt}netrw_selkeep") |let &l:sel = {a:vt}netrw_selkeep |unlet {a:vt}netrw_selkeep |endif - if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif - if exists("{a:vt}netrw_starkeep") |let @* = {a:vt}netrw_starkeep |unlet {a:vt}netrw_starkeep |endif - " Problem: start with liststyle=0; press <i> : result, following line resets l:ts. -" if exists("{a:vt}netrw_tskeep") |let &l:ts = {a:vt}netrw_tskeep |unlet {a:vt}netrw_tskeep |endif - if exists("{a:vt}netrw_twkeep") |let &l:tw = {a:vt}netrw_twkeep |unlet {a:vt}netrw_twkeep |endif - if exists("{a:vt}netrw_wigkeep") |let &l:wig = {a:vt}netrw_wigkeep |unlet {a:vt}netrw_wigkeep |endif - if exists("{a:vt}netrw_wrapkeep") |let &l:wrap = {a:vt}netrw_wrapkeep |unlet {a:vt}netrw_wrapkeep |endif - if exists("{a:vt}netrw_writekeep")|let &l:write = {a:vt}netrw_writekeep |unlet {a:vt}netrw_writekeep|endif - if exists("s:yykeep") |let @@ = s:yykeep |unlet s:yykeep |endif - if exists("{a:vt}netrw_swfkeep") - if &directory == "" - " user hasn't specified a swapfile directory; - " netrw will temporarily set the swapfile directory - " to the current directory as returned by getcwd(). - let &l:directory= getcwd() - sil! let &l:swf = {a:vt}netrw_swfkeep - setl directory= - unlet {a:vt}netrw_swfkeep - elseif &l:swf != {a:vt}netrw_swfkeep - " following line causes a Press ENTER in windows -- can't seem to work around it!!! - sil! let &l:swf= {a:vt}netrw_swfkeep - unlet {a:vt}netrw_swfkeep - endif - endif - if exists("{a:vt}netrw_dirkeep") && isdirectory({a:vt}netrw_dirkeep) && g:netrw_keepdir - let dirkeep = substitute({a:vt}netrw_dirkeep,'\\','/','g') - if exists("{a:vt}netrw_dirkeep") |exe "keepj lcd ".fnameescape(dirkeep)|unlet {a:vt}netrw_dirkeep |endif - endif - if exists("{a:vt}netrw_regstar") |sil! let @*= {a:vt}netrw_regstar |unlet {a:vt}netrw_regstar |endif - if exists("{a:vt}netrw_regslash")|sil! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif - if exists("s:nbcd_curpos_{bufnr('%')}") -" call Decho("(NetrwOptionRestore) restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)") - keepj call netrw#NetrwRestorePosn(s:nbcd_curpos_{bufnr('%')}) -" call Decho("(NetrwOptionRestore) unlet s:nbcd_curpos_".bufnr('%')) - if exists("s:nbcd_curpos_".bufnr('%')) - unlet s:nbcd_curpos_{bufnr('%')} - endif - else -" call Decho("no previous position") - endif - -" call Decho("(NetrwOptionRestore) g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) -" call Decho("(NetrwOptionRestore) fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")) -" call Decho("(NetrwOptionRestore) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") -" call Decho("(NetrwOptionRestore) diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist")) -" call Decho("(NetrwOptionRestore) ts=".&l:ts) - " Moved the filetype detect here from NetrwGetFile() because remote files - " were having their filetype detect-generated settings overwritten by - " NetrwOptionRestore. - if &ft != "netrw" -" call Decho("(NetrwOptionRestore) filetype detect (ft=".&ft.")") - filetype detect - endif -" call Decho("(s:NetrwOptionRestore) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt) -" call Dret("s:NetrwOptionRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) -endfun - -" --------------------------------------------------------------------- -" s:NetrwSafeOptions: sets options to help netrw do its job {{{2 -" Use s:NetrwSaveOptions() to save user settings -" Use s:NetrwOptionRestore() to restore user settings -fun! s:NetrwSafeOptions() -" call Dfunc("s:NetrwSafeOptions() win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%"))."> winnr($)=".winnr("$")) -" call Decho("(s:NetrwSafeOptions) win#".winnr()."'s ft=".&ft) -" call Decho("(s:NetrwSafeOptions) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo) - if exists("+acd") | setl noacd | endif - setl noai - setl noaw - setl nobl - setl nobomb - setl noci - setl nocin - if g:netrw_liststyle == s:TREELIST - setl bh=hide - endif - setl cino= - setl com= - setl cpo-=a - setl cpo-=A - setl fo=nroql2 - setl nohid - setl noim - setl isk+=@ isk+=* isk+=/ - setl magic - setl report=10000 - setl sel=inclusive - setl nospell - setl tw=0 - setl wig= - set cedit& - if g:netrw_use_noswf && has("win32") && !has("win95") - setl noswf - endif - call s:NetrwCursor() - - " allow the user to override safe options -" call Decho("(s:NetrwSafeOptions) ft<".&ft."> ei=".&ei) - if &ft == "netrw" -" call Decho("(s:NetrwSafeOptions) do any netrw FileType autocmds (doau FileType netrw)") - sil! keepalt keepj doau FileType netrw - endif - -" call Decho("(s:NetrwSafeOptions) fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh) -" call Decho("(s:NetrwSafeOptions) settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo) -" call Dret("s:NetrwSafeOptions") -endfun - -" --------------------------------------------------------------------- " netrw#Explore: launch the local browser in the directory of the current file {{{2 " indx: == -1: Nexplore " == -2: Pexplore @@ -774,25 +528,52 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%")) if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() -" call Decho("(Explore) set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") +" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)") endif + + " record current file for Rexplore's benefit + if &ft != "netrw" + let w:netrw_rexfile= expand("%:p") + endif + + " record current directory let curdir = simplify(b:netrw_curdir) let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16")) let curdir= substitute(curdir,'\','/','g') endif -" call Decho("(Explore) curdir<".curdir."> curfiledir<".curfiledir.">") +" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">") + + " using completion, directories with spaces in their names (thanks, Bill Gates, for a truly dumb idea) + " will end up with backslashes here. Solution: strip off backslashes that precede white space and + " try Explore again. + if a:0 > 0 +" call Decho('considering retry: a:1<'.a:1.'>: '. + \ ((a:1 =~ "\\\s")? 'has backslash whitespace' : 'does not have backslash whitespace').', '. + \ ((filereadable(a:1))? 'is readable' : 'is not readable').', '. + \ ((isdirectory(a:1))? 'is a directory' : 'is not a directory')) + if a:1 =~ "\\\s" && !filereadable(a:1) && !isdirectory(a:1) +" call Decho("re-trying Explore with <".substitute(a:1,'\\\(\s\)','\1','g').">") + call netrw#Explore(a:indx,a:dosplit,a:style,substitute(a:1,'\\\(\s\)','\1','g')) +" call Dret("netrw#Explore : returning from retry") + return +" else " Decho +" call Decho("retry not needed") + endif + endif " save registers - sil! let keepregstar = @* - sil! let keepregplus = @+ + if has("clipboard") + sil! let keepregstar = @* + sil! let keepregplus = @+ + endif sil! let keepregslash= @/ " if dosplit " -or- file has been modified AND file not hidden when abandoned " -or- Texplore used if a:dosplit || (&modified && &hidden == 0 && &bufhidden != "hide") || a:style == 6 -" call Decho("(Explore) case dosplit=".a:dosplit." modified=".&modified." a:style=".a:style.": dosplit or file has been modified") +" call Decho("case dosplit=".a:dosplit." modified=".&modified." a:style=".a:style.": dosplit or file has been modified") call s:SaveWinVars() let winsz= g:netrw_winsize if a:indx > 0 @@ -800,106 +581,106 @@ fun! netrw#Explore(indx,dosplit,style,...) endif if a:style == 0 " Explore, Sexplore -" call Decho("(Explore) style=0: Explore or Sexplore") +" call Decho("style=0: Explore or Sexplore") let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz exe winsz."wincmd s" elseif a:style == 1 "Explore!, Sexplore! -" call Decho("(Explore) style=1: Explore! or Sexplore!") +" call Decho("style=1: Explore! or Sexplore!") let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz exe "keepalt ".winsz."wincmd v" elseif a:style == 2 " Hexplore -" call Decho("(Explore) style=2: Hexplore") +" call Decho("style=2: Hexplore") let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz exe "keepalt bel ".winsz."wincmd s" elseif a:style == 3 " Hexplore! -" call Decho("(Explore) style=3: Hexplore!") +" call Decho("style=3: Hexplore!") let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz exe "keepalt abo ".winsz."wincmd s" elseif a:style == 4 " Vexplore -" call Decho("(Explore) style=4: Vexplore") +" call Decho("style=4: Vexplore") let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz exe "keepalt lefta ".winsz."wincmd v" elseif a:style == 5 " Vexplore! -" call Decho("(Explore) style=5: Vexplore!") +" call Decho("style=5: Vexplore!") let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz exe "keepalt rightb ".winsz."wincmd v" elseif a:style == 6 " Texplore call s:SaveBufVars() -" call Decho("(Explore) style = 6: Texplore") +" call Decho("style = 6: Texplore") exe "keepalt tabnew ".fnameescape(curdir) call s:RestoreBufVars() endif call s:RestoreWinVars() " else " Decho -" call Decho("(Explore) case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6") +" call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6") endif keepj norm! 0 if a:0 > 0 -" call Decho("(Explore) case [a:0=".a:0."] > 0: a:1<".a:1.">") +" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">") if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) -" call Decho("(Explore) ..case a:1<".a:1.">: starts with ~ and unix or cygwin") +" call Decho("..case a:1<".a:1.">: starts with ~ and unix or cygwin") let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),'')) -" call Decho("(Explore) ..using dirname<".dirname."> (case: ~ && unix||cygwin)") +" call Decho("..using dirname<".dirname."> (case: ~ && unix||cygwin)") elseif a:1 == '.' -" call Decho("(Explore) ..case a:1<".a:1.">: matches .") +" call Decho("..case a:1<".a:1.">: matches .") let dirname= simplify(exists("b:netrw_curdir")? b:netrw_curdir : getcwd()) if dirname !~ '/$' let dirname= dirname."/" endif -" call Decho("(Explore) ..using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") +" call Decho("..using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") elseif a:1 =~ '\$' -" call Decho("(Explore) ..case a:1<".a:1.">: matches ending $") +" call Decho("..case a:1<".a:1.">: matches ending $") let dirname= simplify(expand(a:1)) -" call Decho("(Explore) ..using user-specified dirname<".dirname."> with $env-var") +" call Decho("..using user-specified dirname<".dirname."> with $env-var") elseif a:1 !~ '^\*\{1,2}/' && a:1 !~ '^\a\{3,}://' -" call Decho("(Explore) ..case a:1<".a:1.">: other, not pattern or filepattern") +" call Decho("..case a:1<".a:1.">: other, not pattern or filepattern") let dirname= simplify(a:1) -" call Decho("(Explore) ..using user-specified dirname<".dirname.">") +" call Decho("..using user-specified dirname<".dirname.">") else -" call Decho("(Explore) ..case a:1: pattern or filepattern") +" call Decho("..case a:1: pattern or filepattern") let dirname= a:1 endif else " clear explore -" call Decho("(Explore) case a:0=".a:0.": clearing Explore list") +" call Decho("case a:0=".a:0.": clearing Explore list") call s:NetrwClearExplore() " call Dret("netrw#Explore : cleared list") return endif -" call Decho("(Explore) dirname<".dirname.">") +" call Decho("dirname<".dirname.">") if dirname =~ '\.\./\=$' let dirname= simplify(fnamemodify(dirname,':p:h')) elseif dirname =~ '\.\.' || dirname == '.' let dirname= simplify(fnamemodify(dirname,':p')) endif -" call Decho("(Explore) dirname<".dirname."> (after simplify)") +" call Decho("dirname<".dirname."> (after simplify)") if dirname =~ '^\*//' " starpat=1: Explore *//pattern (current directory only search for files containing pattern) -" call Decho("(Explore) case starpat=1: Explore *//pattern") +" call Decho("case starpat=1: Explore *//pattern") let pattern= substitute(dirname,'^\*//\(.*\)$','\1','') let starpat= 1 -" call Decho("(Explore) ..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") +" call Decho("..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif elseif dirname =~ '^\*\*//' " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) -" call Decho("(Explore) case starpat=2: Explore **//pattern") +" call Decho("case starpat=2: Explore **//pattern") let pattern= substitute(dirname,'^\*\*//','','') let starpat= 2 -" call Decho("(Explore) ..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") +" call Decho("..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">") elseif dirname =~ '/\*\*/' " handle .../**/.../filepat -" call Decho("(Explore) case starpat=4: Explore .../**/.../filepat") +" call Decho("case starpat=4: Explore .../**/.../filepat") let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','') if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16"))) let b:netrw_curdir = prefixdir @@ -908,30 +689,30 @@ fun! netrw#Explore(indx,dosplit,style,...) endif let dirname= substitute(dirname,'^.\{-}\(\*\*/.*\)$','\1','') let starpat= 4 -" call Decho("(Explore) ..pwd<".getcwd()."> dirname<".dirname.">") -" call Decho("(Explore) ..case Explore ../**/../filepat (starpat=".starpat.")") +" call Decho("..pwd<".getcwd()."> dirname<".dirname.">") +" call Decho("..case Explore ../**/../filepat (starpat=".starpat.")") elseif dirname =~ '^\*/' " case starpat=3: Explore */filepat (search in current directory for filenames matching filepat) let starpat= 3 -" call Decho("(Explore) case starpat=3: Explore */filepat (starpat=".starpat.")") +" call Decho("case starpat=3: Explore */filepat (starpat=".starpat.")") elseif dirname=~ '^\*\*/' " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) let starpat= 4 -" call Decho("(Explore) case starpat=4: Explore **/filepat (starpat=".starpat.")") +" call Decho("case starpat=4: Explore **/filepat (starpat=".starpat.")") else let starpat= 0 -" call Decho("(Explore) case starpat=0: default") +" call Decho("case starpat=0: default") endif if starpat == 0 && a:indx >= 0 " [Explore Hexplore Vexplore Sexplore] [dirname] -" call Decho("(Explore) case starpat==0 && a:indx=".a:indx.": dirname<".dirname.">, handles Explore Hexplore Vexplore Sexplore") +" call Decho("case starpat==0 && a:indx=".a:indx.": dirname<".dirname.">, handles Explore Hexplore Vexplore Sexplore") if dirname == "" let dirname= curfiledir -" call Decho("(Explore) ..empty dirname, using current file's directory<".dirname.">") +" call Decho("..empty dirname, using current file's directory<".dirname.">") endif if dirname =~ '^scp://' || dirname =~ '^ftp://' call netrw#Nread(2,dirname) @@ -940,15 +721,17 @@ fun! netrw#Explore(indx,dosplit,style,...) if dirname == "" let dirname= getcwd() elseif (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin - if dirname !~ '^[a-zA-Z]:' + " Windows : check for a drive specifier, or else for a remote share name ('\\Foo' or '//Foo', + " depending on whether backslashes have been converted to forward slashes by earlier code). + if dirname !~ '^[a-zA-Z]:' && dirname !~ '^\\\\\w\+' && dirname !~ '^//\w\+' let dirname= b:netrw_curdir."/".dirname endif elseif dirname !~ '^/' let dirname= b:netrw_curdir."/".dirname endif -" call Decho("(Explore) ..calling LocalBrowseCheck(dirname<".dirname.">)") +" call Decho("..calling LocalBrowseCheck(dirname<".dirname.">)") call netrw#LocalBrowseCheck(dirname) -" call Decho("(Explore) win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) +" call Decho("win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) endif if exists("w:netrw_bannercnt") " done to handle P08-Ingelrest. :Explore will _Always_ go to the line just after the banner. @@ -956,7 +739,7 @@ fun! netrw#Explore(indx,dosplit,style,...) exe w:netrw_bannercnt endif -" call Decho("(Explore) curdir<".curdir.">") +" call Decho("curdir<".curdir.">") " --------------------------------------------------------------------- " Jan 24, 2013: not sure why the following was present. See P08-Ingelrest " if has("win32") || has("win95") || has("win64") || has("win16") @@ -972,30 +755,32 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) elseif a:indx <= 0 " Nexplore, Pexplore, Explore: handle starpat -" call Decho("(Explore) case a:indx<=0: Nexplore, Pexplore, <s-down>, <s-up> starpat=".starpat." a:indx=".a:indx) +" call Decho("case a:indx<=0: Nexplore, Pexplore, <s-down>, <s-up> starpat=".starpat." a:indx=".a:indx) if !mapcheck("<s-up>","n") && !mapcheck("<s-down>","n") && exists("b:netrw_curdir") -" call Decho("(Explore) |