summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-10-30 14:37:44 +0100
committerBram Moolenaar <Bram@vim.org>2015-10-30 14:37:44 +0100
commita0f849ee40cbea3c889345256786b640b0becca2 (patch)
tree9f4d1e0604da8b8ad06da6288b77d2f3d3615f45
parente7d1376b636e6c758196c3542bd2c1053f9edb75 (diff)
downloadvim-git-a0f849ee40cbea3c889345256786b640b0becca2.tar.gz
Update runtime files.
-rw-r--r--runtime/autoload/netrw.vim4158
-rw-r--r--runtime/autoload/pythoncomplete.vim1
-rw-r--r--runtime/doc/change.txt32
-rw-r--r--runtime/doc/pi_netrw.txt378
-rw-r--r--runtime/doc/syntax.txt8
-rw-r--r--runtime/doc/tags52
-rw-r--r--runtime/doc/todo.txt47
-rw-r--r--runtime/doc/usr_43.txt8
-rw-r--r--runtime/plugin/netrwPlugin.vim24
-rw-r--r--runtime/syntax/autohotkey.vim6
-rw-r--r--runtime/syntax/netrw.vim1
-rw-r--r--runtime/syntax/tex.vim141
-rw-r--r--runtime/syntax/vhdl.vim1
-rw-r--r--runtime/syntax/vim.vim310
14 files changed, 3005 insertions, 2162 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 42439a57d..53668b15b 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,10 +1,10 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
-" Date: Jan 05, 2015
-" Version: 153
+" Date: Oct 23, 2015
+" Version: 154
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
-" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
+" Copyright: Copyright (C) 1999-2015 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -13,7 +13,7 @@
" expressed or implied. By using this plugin, you agree that
" in no event will the copyright holder be liable for any damages
" resulting from the use of this software.
-"redraw!|call DechoSep()|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+"redraw!|call DechoSep()|call inputsave()|call input("Press <cr> to continue")|call inputrestore(,'~'.expand("<slnum>"))
"
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
" (James 1:22 RSV)
@@ -22,14 +22,15 @@
if &cp || exists("g:loaded_netrw")
finish
endif
+" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too
if v:version < 704 || !has("patch213")
if !exists("s:needpatch213")
- echo "***sorry*** this version of netrw requires vim v7.4 with patch 213"
+ unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213"
endif
let s:needpatch213= 1
finish
endif
-let g:loaded_netrw = "v153"
+let g:loaded_netrw = "v154"
if !exists("s:NOTE")
let s:NOTE = 0
let s:WARNING = 1
@@ -38,9 +39,9 @@ endif
let s:keepcpo= &cpo
setl cpo&vim
-"let g:dechofuncname=1
+"let g:dechofuncname= 1
"DechoRemOn
-"call Decho("doing autoload/netrw.vim version ".g:loaded_netrw)
+"call Decho("doing autoload/netrw.vim version ".g:loaded_netrw,'~'.expand("<slnum>"))
" ======================
" Netrw Variables: {{{1
@@ -54,7 +55,7 @@ setl cpo&vim
" Usage: netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,"some message",error-number)
" netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number)
" (this function can optionally take a list of messages)
-" May 15, 2014 : max errnum currently is 98
+" Oct 09, 2015 : max errnum currently is 102
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)
@@ -70,7 +71,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
else
let level= "**note** (netrw) "
endif
-" call Decho("level=".level)
+" call Decho("level=".level,'~'.expand("<slnum>"))
if g:netrw_use_errorwindow
" (default) netrw creates a one-line window to show error/warning
@@ -78,14 +79,14 @@ fun! netrw#ErrorMsg(level,msg,errnum)
" record current window number for NetrwRestorePosn()'s benefit
let s:winBeforeErr= winnr()
-" call Decho("s:winBeforeErr=".s:winBeforeErr)
+" call Decho("s:winBeforeErr=".s:winBeforeErr,'~'.expand("<slnum>"))
" getting messages out reliably is just plain difficult!
" This attempt splits the current window, creating a one line window.
if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0
-" call Decho("write to NetrwMessage buffer")
+" call Decho("write to NetrwMessage buffer",'~'.expand("<slnum>"))
exe bufwinnr("NetrwMessage")."wincmd w"
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
setl ma noro
if type(a:msg) == 3
for msg in a:msg
@@ -96,13 +97,13 @@ fun! netrw#ErrorMsg(level,msg,errnum)
endif
NetrwKeepj $
else
-" call Decho("create a NetrwMessage buffer window")
+" call Decho("create a NetrwMessage buffer window",'~'.expand("<slnum>"))
bo 1split
sil! call s:NetrwEnew()
sil! NetrwKeepj call s:NetrwSafeOptions()
setl bt=nofile
NetrwKeepj file NetrwMessage
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
setl ma noro
if type(a:msg) == 3
for msg in a:msg
@@ -113,7 +114,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
endif
NetrwKeepj $
endif
-" call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr())
+" call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr(),'~'.expand("<slnum>"))
if &fo !~ '[ta]'
syn clear
syn match netrwMesgNote "^\*\*note\*\*"
@@ -122,7 +123,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
hi link netrwMesgWarning WarningMsg
hi link netrwMesgError Error
endif
-" call Decho("setl noma ro bh=wipe")
+" call Decho("setl noma ro bh=wipe",'~'.expand("<slnum>"))
setl ro nomod noma bh=wipe
else
@@ -137,13 +138,13 @@ fun! netrw#ErrorMsg(level,msg,errnum)
if type(a:msg) == 3
for msg in a:msg
- echomsg level.msg
+ unsilent echomsg level.msg
endfor
else
- echomsg level.a:msg
+ unsilent echomsg level.a:msg
endif
-" call Decho("echomsg ***netrw*** ".a:msg)
+" call Decho("echomsg ***netrw*** ".a:msg,'~'.expand("<slnum>"))
echohl None
endif
@@ -154,7 +155,7 @@ endfun
" s:NetrwInit: initializes variables if they haven't been defined {{{2
" Loosely, varname = value.
fun s:NetrwInit(varname,value)
-" call Decho("varname<".a:varname."> value=".a:value)
+" call Decho("varname<".a:varname."> value=".a:value,'~'.expand("<slnum>"))
if !exists(a:varname)
if type(a:value) == 0
exe "let ".a:varname."=".a:value
@@ -345,7 +346,7 @@ if !exists("g:netrw_list_cmd")
let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
endif
else
-" call Decho(g:netrw_ssh_cmd." is not executable")
+" call Decho(g:netrw_ssh_cmd." is not executable",'~'.expand("<slnum>"))
let g:netrw_list_cmd= ""
endif
endif
@@ -504,6 +505,7 @@ endif
call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.")
call s:NetrwInit("g:netrw_win95ftp",1)
call s:NetrwInit("g:netrw_winsize",50)
+call s:NetrwInit("g:netrw_wiw",1)
if g:netrw_winsize > 100|let g:netrw_winsize= 100|endif
" ---------------------------------------------------------------------
" Default values for netrw's script variables: {{{2
@@ -531,18 +533,18 @@ endif
" Netrw Initialization: {{{1
" ======================
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")
+" call Decho("installed beval events",'~'.expand("<slnum>"))
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
-" if v:version < 700 | call Decho("did not install beval events: v:version=".v:version." < 700") | endif
-" if !has("balloon_eval") | call Decho("did not install beval events: does not have balloon_eval") | endif
-" if exists("s:initbeval") | call Decho("did not install beval events: s:initbeval exists") | endif
-" if exists("g:netrw_nobeval") | call Decho("did not install beval events: g:netrw_nobeval exists") | endif
-" if !has("syntax") | call Decho("did not install beval events: does not have syntax highlighting") | endif
-" if exists("g:syntax_on") | call Decho("did not install beval events: g:syntax_on exists") | endif
+" if v:version < 700 | call Decho("did not install beval events: v:version=".v:version." < 700","~".expand("<slnum>")) | endif
+" if !has("balloon_eval") | call Decho("did not install beval events: does not have balloon_eval","~".expand("<slnum>")) | endif
+" if exists("s:initbeval") | call Decho("did not install beval events: s:initbeval exists","~".expand("<slnum>")) | endif
+" if exists("g:netrw_nobeval") | call Decho("did not install beval events: g:netrw_nobeval exists","~".expand("<slnum>")) | endif
+" if !has("syntax") | call Decho("did not install beval events: does not have syntax highlighting","~".expand("<slnum>")) | endif
+" if exists("g:syntax_on") | call Decho("did not install beval events: g:syntax_on exists","~".expand("<slnum>")) | endif
endif
au WinEnter * if &ft == "netrw"|call s:NetrwInsureWinVars()|endif
@@ -560,7 +562,7 @@ endif
" ---------------------------------------------------------------------
" 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()")
+" call Decho("loading netrw#BalloonHelp()",'~'.expand("<slnum>"))
fun! netrw#BalloonHelp()
if &ft != "netrw"
return ""
@@ -572,7 +574,7 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
elseif getline(v:beval_lnum) =~ '^"\s*/'
let mesg = "<cr>: edit/enter o: edit/enter in horiz window t: edit/enter in new tab v:edit/enter in vert window"
elseif v:beval_text == "Sorted" || v:beval_text == "by"
- let mesg = 's: sort by name, time, or file size r: reverse sorting order mt: mark target'
+ let mesg = 's: sort by name, time, file size, extension r: reverse sorting order mt: mark target'
elseif v:beval_text == "Sort" || v:beval_text == "sequence"
let mesg = "S: edit sorting sequence"
elseif v:beval_text == "Hiding" || v:beval_text == "Showing"
@@ -587,11 +589,11 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
return mesg
endfun
"else " Decho
-" if v:version < 700 |call Decho("did not load netrw#BalloonHelp(): vim version ".v:version." < 700 -")|endif
-" if !has("balloon_eval") |call Decho("did not load netrw#BalloonHelp(): does not have balloon eval") |endif
-" if !has("syntax") |call Decho("did not load netrw#BalloonHelp(): syntax disabled") |endif
-" if !exists("g:syntax_on") |call Decho("did not load netrw#BalloonHelp(): g:syntax_on n/a") |endif
-" if exists("g:netrw_nobeval") |call Decho("did not load netrw#BalloonHelp(): g:netrw_nobeval exists") |endif
+" if v:version < 700 |call Decho("did not load netrw#BalloonHelp(): vim version ".v:version." < 700 -","~".expand("<slnum>"))|endif
+" if !has("balloon_eval") |call Decho("did not load netrw#BalloonHelp(): does not have balloon eval","~".expand("<slnum>")) |endif
+" if !has("syntax") |call Decho("did not load netrw#BalloonHelp(): syntax disabled","~".expand("<slnum>")) |endif
+" if !exists("g:syntax_on") |call Decho("did not load netrw#BalloonHelp(): g:syntax_on n/a","~".expand("<slnum>")) |endif
+" if exists("g:netrw_nobeval") |call Decho("did not load netrw#BalloonHelp(): g:netrw_nobeval exists","~".expand("<slnum>")) |endif
endif
" ------------------------------------------------------------------------
@@ -613,9 +615,10 @@ endif
" == 6: Texplore
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("%"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
-" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
+" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)",'~'.expand("<slnum>"))
endif
" record current file for Rexplore's benefit
@@ -629,23 +632,24 @@ fun! netrw#Explore(indx,dosplit,style,...)
if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
let curdir= substitute(curdir,'\','/','g')
endif
-" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">")
+" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">",'~'.expand("<slnum>"))
" 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').">")
+ \ ((a:1 =~ "\\\s")? 'has backslash whitespace' : 'does not have backslash whitespace').', '.
+ \ ((filereadable(s:NetrwFile(a:1)))? 'is readable' : 'is not readable').', '.
+ \ ((isdirectory(s:NetrwFile(a:1))))? 'is a directory' : 'is not a directory',
+ \ '~'.expand("<slnum>"))
+ if a:1 =~ "\\\s" && !filereadable(s:NetrwFile(a:1)) && !isdirectory(s:NetrwFile(a:1))
+" call Decho("re-trying Explore with <".substitute(a:1,'\\\(\s\)','\1','g').">",'~'.expand("<slnum>"))
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")
+" call Decho("retry not needed",'~'.expand("<slnum>"))
endif
endif
@@ -660,7 +664,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" -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("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",'~'.expand("<slnum>"))
call s:SaveWinVars()
let winsz= g:netrw_winsize
if a:indx > 0
@@ -668,119 +672,119 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
if a:style == 0 " Explore, Sexplore
-" call Decho("style=0: Explore or Sexplore")
+" call Decho("style=0: Explore or Sexplore",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "noswapfile ".winsz."wincmd s"
-" call Decho("exe noswapfile ".winsz."wincmd s")
+" call Decho("exe noswapfile ".winsz."wincmd s",'~'.expand("<slnum>"))
elseif a:style == 1 "Explore!, Sexplore!
-" call Decho("style=1: Explore! or Sexplore!")
+" call Decho("style=1: Explore! or Sexplore!",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile ".winsz."wincmd v"
-" call Decho("exe keepalt noswapfile ".winsz."wincmd v")
+" call Decho("exe keepalt noswapfile ".winsz."wincmd v",'~'.expand("<slnum>"))
elseif a:style == 2 " Hexplore
-" call Decho("style=2: Hexplore")
+" call Decho("style=2: Hexplore",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile bel ".winsz."wincmd s"
-" call Decho("exe keepalt noswapfile bel ".winsz."wincmd s")
+" call Decho("exe keepalt noswapfile bel ".winsz."wincmd s",'~'.expand("<slnum>"))
elseif a:style == 3 " Hexplore!
-" call Decho("style=3: Hexplore!")
+" call Decho("style=3: Hexplore!",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile abo ".winsz."wincmd s"
-" call Decho("exe keepalt noswapfile abo ".winsz."wincmd s")
+" call Decho("exe keepalt noswapfile abo ".winsz."wincmd s",'~'.expand("<slnum>"))
elseif a:style == 4 " Vexplore
-" call Decho("style=4: Vexplore")
+" call Decho("style=4: Vexplore",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile lefta ".winsz."wincmd v"
-" call Decho("exe keepalt noswapfile lefta ".winsz."wincmd v")
+" call Decho("exe keepalt noswapfile lefta ".winsz."wincmd v",'~'.expand("<slnum>"))
elseif a:style == 5 " Vexplore!
-" call Decho("style=5: Vexplore!")
+" call Decho("style=5: Vexplore!",'~'.expand("<slnum>"))
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile rightb ".winsz."wincmd v"
-" call Decho("exe keepalt noswapfile rightb ".winsz."wincmd v")
+" call Decho("exe keepalt noswapfile rightb ".winsz."wincmd v",'~'.expand("<slnum>"))
elseif a:style == 6 " Texplore
call s:SaveBufVars()
-" call Decho("style = 6: Texplore")
+" call Decho("style = 6: Texplore",'~'.expand("<slnum>"))
exe "keepalt tabnew ".fnameescape(curdir)
-" call Decho("exe keepalt tabnew ".fnameescape(curdir))
+" call Decho("exe keepalt tabnew ".fnameescape(curdir),'~'.expand("<slnum>"))
call s:RestoreBufVars()
endif
call s:RestoreWinVars()
" else " Decho
-" call Decho("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",'~'.expand("<slnum>"))
endif
NetrwKeepj norm! 0
if a:0 > 0
-" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">")
+" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">",'~'.expand("<slnum>"))
if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin))
-" call Decho("..case a:1<".a:1.">: starts with ~ and unix or cygwin")
+" call Decho("..case a:1<".a:1.">: starts with ~ and unix or cygwin",'~'.expand("<slnum>"))
let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),''))
-" call Decho("..using dirname<".dirname."> (case: ~ && unix||cygwin)")
+" call Decho("..using dirname<".dirname."> (case: ~ && unix||cygwin)",'~'.expand("<slnum>"))
elseif a:1 == '.'
-" call Decho("..case a:1<".a:1.">: matches .")
+" call Decho("..case a:1<".a:1.">: matches .",'~'.expand("<slnum>"))
let dirname= simplify(exists("b:netrw_curdir")? b:netrw_curdir : getcwd())
if dirname !~ '/$'
let dirname= dirname."/"
endif
-" call Decho("..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()").")",'~'.expand("<slnum>"))
elseif a:1 =~ '\$'
-" call Decho("..case a:1<".a:1.">: matches ending $")
+" call Decho("..case a:1<".a:1.">: matches ending $",'~'.expand("<slnum>"))
let dirname= simplify(expand(a:1))
-" call Decho("..using user-specified dirname<".dirname."> with $env-var")
+" call Decho("..using user-specified dirname<".dirname."> with $env-var",'~'.expand("<slnum>"))
elseif a:1 !~ '^\*\{1,2}/' && a:1 !~ '^\a\{3,}://'
-" call Decho("..case a:1<".a:1.">: other, not pattern or filepattern")
+" call Decho("..case a:1<".a:1.">: other, not pattern or filepattern",'~'.expand("<slnum>"))
let dirname= simplify(a:1)
-" call Decho("..using user-specified dirname<".dirname.">")
+" call Decho("..using user-specified dirname<".dirname.">",'~'.expand("<slnum>"))
else
-" call Decho("..case a:1: pattern or filepattern")
+" call Decho("..case a:1: pattern or filepattern",'~'.expand("<slnum>"))
let dirname= a:1
endif
else
" clear explore
-" call Decho("case a:0=".a:0.": clearing Explore list")
+" call Decho("case a:0=".a:0.": clearing Explore list",'~'.expand("<slnum>"))
call s:NetrwClearExplore()
" call Dret("netrw#Explore : cleared list")
return
endif
-" call Decho("dirname<".dirname.">")
+" call Decho("dirname<".dirname.">",'~'.expand("<slnum>"))
if dirname =~ '\.\./\=$'
let dirname= simplify(fnamemodify(dirname,':p:h'))
elseif dirname =~ '\.\.' || dirname == '.'
let dirname= simplify(fnamemodify(dirname,':p'))
endif
-" call Decho("dirname<".dirname."> (after simplify)")
+" call Decho("dirname<".dirname."> (after simplify)",'~'.expand("<slnum>"))
if dirname =~ '^\*//'
" starpat=1: Explore *//pattern (current directory only search for files containing pattern)
-" call Decho("case starpat=1: Explore *//pattern")
+" call Decho("case starpat=1: Explore *//pattern",'~'.expand("<slnum>"))
let pattern= substitute(dirname,'^\*//\(.*\)$','\1','')
let starpat= 1
-" call Decho("..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
+" call Decho("..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">",'~'.expand("<slnum>"))
if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
elseif dirname =~ '^\*\*//'
" starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
-" call Decho("case starpat=2: Explore **//pattern")
+" call Decho("case starpat=2: Explore **//pattern",'~'.expand("<slnum>"))
let pattern= substitute(dirname,'^\*\*//','','')
let starpat= 2
-" call Decho("..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
+" call Decho("..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">",'~'.expand("<slnum>"))
elseif dirname =~ '/\*\*/'
" handle .../**/.../filepat
-" call Decho("case starpat=4: Explore .../**/.../filepat")
+" call Decho("case starpat=4: Explore .../**/.../filepat",'~'.expand("<slnum>"))
let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','')
if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16")))
let b:netrw_curdir = prefixdir
@@ -789,30 +793,30 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
let dirname= substitute(dirname,'^.\{-}\(\*\*/.*\)$','\1','')
let starpat= 4
-" call Decho("..pwd<".getcwd()."> dirname<".dirname.">")
-" call Decho("..case Explore ../**/../filepat (starpat=".starpat.")")
+" call Decho("..pwd<".getcwd()."> dirname<".dirname.">",'~'.expand("<slnum>"))
+" call Decho("..case Explore ../**/../filepat (starpat=".starpat.")",'~'.expand("<slnum>"))
elseif dirname =~ '^\*/'
" case starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
let starpat= 3
-" call Decho("case starpat=3: Explore */filepat (starpat=".starpat.")")
+" call Decho("case starpat=3: Explore */filepat (starpat=".starpat.")",'~'.expand("<slnum>"))
elseif dirname=~ '^\*\*/'
" starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
let starpat= 4
-" call Decho("case starpat=4: Explore **/filepat (starpat=".starpat.")")
+" call Decho("case starpat=4: Explore **/filepat (starpat=".starpat.")",'~'.expand("<slnum>"))
else
let starpat= 0
-" call Decho("case starpat=0: default")
+" call Decho("case starpat=0: default",'~'.expand("<slnum>"))
endif
if starpat == 0 && a:indx >= 0
" [Explore Hexplore Vexplore Sexplore] [dirname]
-" call Decho("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",'~'.expand("<slnum>"))
if dirname == ""
let dirname= curfiledir
-" call Decho("..empty dirname, using current file's directory<".dirname.">")
+" call Decho("..empty dirname, using current file's directory<".dirname.">",'~'.expand("<slnum>"))
endif
if dirname =~ '^scp://' || dirname =~ '^ftp://'
call netrw#Nread(2,dirname)
@@ -820,7 +824,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
if dirname == ""
let dirname= getcwd()
elseif (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
- " Windows : check for a drive specifier, or else for a remote share name ('\\Foo' or '//Foo',
+ " 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
@@ -828,9 +832,10 @@ fun! netrw#Explore(indx,dosplit,style,...)
elseif dirname !~ '^/'
let dirname= b:netrw_curdir."/".dirname
endif
-" call Decho("..calling LocalBrowseCheck(dirname<".dirname.">)")
+" call Decho("..calling LocalBrowseCheck(dirname<".dirname.">)",'~'.expand("<slnum>"))
call netrw#LocalBrowseCheck(dirname)
-" call Decho("win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
+" call Decho(" modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
endif
if exists("w:netrw_bannercnt")
" done to handle P08-Ingelrest. :Explore will _Always_ go to the line just after the banner.
@@ -838,7 +843,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
exe w:netrw_bannercnt
endif
-" call Decho("curdir<".curdir.">")
+" call Decho("curdir<".curdir.">",'~'.expand("<slnum>"))
" ---------------------------------------------------------------------
" Jan 24, 2013: not sure why the following was present. See P08-Ingelrest
" if has("win32") || has("win95") || has("win64") || has("win16")
@@ -854,26 +859,26 @@ 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("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,'~'.expand("<slnum>"))
if !mapcheck("<s-up>","n") && !mapcheck("<s-down>","n") && exists("b:netrw_curdir")
-" call Decho("..set up <s-up> and <s-down> maps")
+" call Decho("..set up <s-up> and <s-down> maps",'~'.expand("<slnum>"))
let s:didstarstar= 1
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
endif
if has("path_extra")
-" call Decho("..starpat=".starpat.": has +path_extra")
+" call Decho("..starpat=".starpat.": has +path_extra",'~'.expand("<slnum>"))
if !exists("w:netrw_explore_indx")
let w:netrw_explore_indx= 0
endif
let indx = a:indx
-" call Decho("..starpat=".starpat.": set indx= [a:indx=".indx."]")
+" call Decho("..starpat=".starpat.": set indx= [a:indx=".indx."]",'~'.expand("<slnum>"))
if indx == -1
" Nexplore
-" call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")")
+" call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
if !exists("w:netrw_explore_list") " sanity check
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
if has("clipboard")
@@ -888,17 +893,17 @@ fun! netrw#Explore(indx,dosplit,style,...)
if indx < 0 | let indx= 0 | endif
if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
let curfile= w:netrw_explore_list[indx]
-" call Decho("....indx=".indx." curfile<".curfile.">")
+" call Decho("....indx=".indx." curfile<".curfile.">",'~'.expand("<slnum>"))
while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx]
let indx= indx + 1
-" call Decho("....indx=".indx." (Nexplore while loop)")
+" call Decho("....indx=".indx." (Nexplore while loop)",'~'.expand("<slnum>"))
endwhile
if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
-" call Decho("....Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
+" call Decho("....Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx,'~'.expand("<slnum>"))
elseif indx == -2
" Pexplore
-" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")")
+" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
if !exists("w:netrw_explore_list") " sanity check
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
if has("clipboard")
@@ -913,30 +918,30 @@ fun! netrw#Explore(indx,dosplit,style,...)
if indx < 0 | let indx= 0 | endif
if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
let curfile= w:netrw_explore_list[indx]
-" call Decho("....indx=".indx." curfile<".curfile.">")
+" call Decho("....indx=".indx." curfile<".curfile.">",'~'.expand("<slnum>"))
while indx >= 0 && curfile == w:netrw_explore_list[indx]
let indx= indx - 1
-" call Decho("....indx=".indx." (Pexplore while loop)")
+" call Decho("....indx=".indx." (Pexplore while loop)",'~'.expand("<slnum>"))
endwhile
if indx < 0 | let indx= 0 | endif
-" call Decho("....Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
+" call Decho("....Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx,'~'.expand("<slnum>"))
else
" Explore -- initialize
" build list of files to Explore with Nexplore/Pexplore
-" call Decho("..starpat=".starpat.": case Explore: initialize (indx=".indx.")")
+" call Decho("..starpat=".starpat.": case Explore: initialize (indx=".indx.")",'~'.expand("<slnum>"))
NetrwKeepj keepalt call s:NetrwClearExplore()
let w:netrw_explore_indx= 0
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
endif
-" call Decho("....starpat=".starpat.": b:netrw_curdir<".b:netrw_curdir.">")
+" call Decho("....starpat=".starpat.": b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
" switch on starpat to build the w:netrw_explore_list of files
if starpat == 1
" starpat=1: Explore *//pattern (current directory only search for files containing pattern)
-" call Decho("..case starpat=".starpat.": build *//pattern list (curdir-only srch for files containing pattern) &hls=".&hls)
-" call Decho("....pattern<".pattern.">")
+" call Decho("..case starpat=".starpat.": build *//pattern list (curdir-only srch for files containing pattern) &hls=".&hls,'~'.expand("<slnum>"))
+" call Decho("....pattern<".pattern.">",'~'.expand("<slnum>"))
try
exe "NetrwKeepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*"
catch /^Vim\%((\a\+)\)\=:E480/
@@ -949,8 +954,8 @@ fun! netrw#Explore(indx,dosplit,style,...)
elseif starpat == 2
" starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
-" call Decho("..case starpat=".starpat.": build **//pattern list (recursive descent files containing pattern)")
-" call Decho("....pattern<".pattern.">")
+" call Decho("..case starpat=".starpat.": build **//pattern list (recursive descent files containing pattern)",'~'.expand("<slnum>"))
+" call Decho("....pattern<".pattern.">",'~'.expand("<slnum>"))
try
exe "sil NetrwKeepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*"
catch /^Vim\%((\a\+)\)\=:E480/
@@ -971,24 +976,24 @@ fun! netrw#Explore(indx,dosplit,style,...)
elseif starpat == 3
" starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
-" call Decho("..case starpat=".starpat.": build */filepat list (curdir-only srch filenames matching filepat) &hls=".&hls)
+" call Decho("..case starpat=".starpat.": build */filepat list (curdir-only srch filenames matching filepat) &hls=".&hls,'~'.expand("<slnum>"))
let filepat= substitute(dirname,'^\*/','','')
let filepat= substitute(filepat,'^[%#<]','\\&','')
-" call Decho("....b:netrw_curdir<".b:netrw_curdir.">")
-" call Decho("....filepat<".filepat.">")
+" call Decho("....b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
+" call Decho("....filepat<".filepat.">",'~'.expand("<slnum>"))
let w:netrw_explore_list= s:NetrwExploreListUniq(split(expand(b:netrw_curdir."/".filepat),'\n'))
if &hls | let keepregslash= s:ExplorePatHls(filepat) | endif
elseif starpat == 4
" starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
-" call Decho("..case starpat=".starpat.": build **/filepat list (recursive descent srch filenames matching filepat) &hls=".&hls)
+" call Decho("..case starpat=".starpat.": build **/filepat list (recursive descent srch filenames matching filepat) &hls=".&hls,'~'.expand("<slnum>"))
let w:netrw_explore_list= s:NetrwExploreListUniq(split(expand(b:netrw_curdir."/".dirname),'\n'))
if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif
endif " switch on starpat to build w:netrw_explore_list
let w:netrw_explore_listlen = len(w:netrw_explore_list)
-" call Decho("....w:netrw_explore_list<".string(w:netrw_explore_list).">")
-" call Decho("....w:netrw_explore_listlen=".w:netrw_explore_listlen)
+" call Decho("....w:netrw_explore_list<".string(w:netrw_explore_list).">",'~'.expand("<slnum>"))
+" call Decho("....w:netrw_explore_listlen=".w:netrw_explore_listlen,'~'.expand("<slnum>"))
if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
@@ -1004,22 +1009,22 @@ fun! netrw#Explore(indx,dosplit,style,...)
" NetrwStatusLine support - for exploring support
let w:netrw_explore_indx= indx
-" call Decho("....w:netrw_explore_list<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
+" call Decho("....w:netrw_explore_list<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen,'~'.expand("<slnum>"))
" wrap the indx around, but issue a note
if indx >= w:netrw_explore_listlen || indx < 0
-" call Decho("....wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")")
+" call Decho("....wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")",'~'.expand("<slnum>"))
let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0
let w:netrw_explore_indx= indx
keepalt NetrwKeepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
endif
exe "let dirfile= w:netrw_explore_list[".indx."]"
-" call Decho("....dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">")
+" call Decho("....dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">",'~'.expand("<slnum>"))
let newdir= substitute(dirfile,'/[^/]*$','','e')
-" call Decho("....newdir<".newdir.">")
+" call Decho("....newdir<".newdir.">",'~'.expand("<slnum>"))
-" call Decho("....calling LocalBrowseCheck(newdir<".newdir.">)")
+" call Decho("....calling LocalBrowseCheck(newdir<".newdir.">)",'~'.expand("<slnum>"))
call netrw#LocalBrowseCheck(newdir)
if !exists("w:netrw_liststyle")
let w:netrw_liststyle= g:netrw_liststyle
@@ -1033,10 +1038,10 @@ fun! netrw#Explore(indx,dosplit,style,...)
let w:netrw_explore_bufnr = bufnr("%")
let w:netrw_explore_line = line(".")
keepalt NetrwKeepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
-" call Decho("....explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
+" call Decho("....explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line,'~'.expand("<slnum>"))
else
-" call Decho("..your vim does not have +path_extra")
+" call Decho("..your vim does not have +path_extra",'~'.expand("<slnum>"))
if !exists("g:netrw_quiet")
keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
endif
@@ -1050,7 +1055,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
else
-" call Decho("..default case: Explore newdir<".dirname.">")
+" call Decho("..default case: Explore newdir<".dirname.">",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/'
sil! unlet w:netrw_treedict
sil! unlet w:netrw_treetop
@@ -1064,13 +1069,13 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
" visual display of **/ **// */ Exploration files
-" call Decho("w:netrw_explore_indx=".(exists("w:netrw_explore_indx")? w:netrw_explore_indx : "doesn't exist"))
-" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "n/a").">")
+" call Decho("w:netrw_explore_indx=".(exists("w:netrw_explore_indx")? w:netrw_explore_indx : "doesn't exist"),'~'.expand("<slnum>"))
+" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "n/a").">",'~'.expand("<slnum>"))
if exists("w:netrw_explore_indx") && exists("b:netrw_curdir")
-" call Decho("s:explore_prvdir<".(exists("s:explore_prvdir")? s:explore_prvdir : "-doesn't exist-"))
+" call Decho("s:explore_prvdir<".(exists("s:explore_prvdir")? s:explore_prvdir : "-doesn't exist-"),'~'.expand("<slnum>"))
if !exists("s:explore_prvdir") || s:explore_prvdir != b:netrw_curdir
" only update match list when current directory isn't the same as before
-" call Decho("only update match list when current directory not the same as before")
+" call Decho("only update match list when current directory not the same as before",'~'.expand("<slnum>"))
let s:explore_prvdir = b:netrw_curdir
let s:explore_match = ""
let dirlen = strlen(b:netrw_curdir)
@@ -1079,7 +1084,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
let prvfname= ""
for fname in w:netrw_explore_list
-" call Decho("fname<".fname.">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
if fname =~ '^'.b:netrw_curdir
if s:explore_match == ""
let s:explore_match= '\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc).'\>'
@@ -1095,7 +1100,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif
let prvfname= fname
endfor
-" call Decho("explore_match<".s:explore_match.">")
+" call Decho("explore_match<".s:explore_match.">",'~'.expand("<slnum>"))
exe "2match netrwMarkFile /".s:explore_match."/"
endif
echo "<s-up>==Pexplore <s-down>==Nexplore"
@@ -1104,7 +1109,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
if exists("s:explore_match") | unlet s:explore_match | endif
if exists("s:explore_prvdir") | unlet s:explore_prvdir | endif
echo " "
-" call Decho("cleared explore match list")
+" call Decho("cleared explore match list",'~'.expand("<slnum>"))
endif
" since Explore may be used to initialize netrw's browser,
@@ -1130,14 +1135,14 @@ fun! netrw#Lexplore(count,rightside,...)
" and a directory has been specified, explore with that
" directory.
let a1 = expand(a:1)
-" call Decho("a:1<".a:1."> curwin#".curwin)
+" call Decho("a:1<".a:1."> curwin#".curwin,'~'.expand("<slnum>"))
exe "1wincmd w"
if &ft == "netrw"
-" call Decho("exe Explore ".fnameescape(a:1))
+" call Decho("exe Explore ".fnameescape(a:1),'~'.expand("<slnum>"))
exe "Explore ".fnameescape(a1)
exe curwin."wincmd w"
if exists("t:netrw_lexposn")
-" call Decho("forgetting t:netrw_lexposn")
+" call Decho("forgetting t:netrw_lexposn",'~'.expand("<slnum>"))
unlet t:netrw_lexposn
endif
" call Dret("netrw#Lexplore")
@@ -1157,11 +1162,11 @@ fun! netrw#Lexplore(count,rightside,...)
if lexwinnr > 0
" close down netrw explorer window
-" call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window")
+" call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window",'~'.expand("<slnum>"))
exe lexwinnr."wincmd w"
let g:netrw_winsize = -winwidth(0)
let t:netrw_lexposn = netrw#SavePosn()
-" call Decho("saving t:netrw_lexposn")
+" call Decho("saving t:netrw_lexposn",'~'.expand("<slnum>"))
close
if lexwinnr < curwin
let curwin= curwin - 1
@@ -1171,7 +1176,7 @@ fun! netrw#Lexplore(count,rightside,...)
else
" open netrw explorer window
-" call Decho("t:netrw_lexbufnr<n/a>: open netrw explorer window")
+" call Decho("t:netrw_lexbufnr<n/a>: open netrw explorer window",'~'.expand("<slnum>"))
exe "1wincmd w"
let keep_altv = g:netrw_altv
let g:netrw_altv = 0
@@ -1180,16 +1185,16 @@ fun! netrw#Lexplore(count,rightside,...)
let g:netrw_winsize = a:count
endif
let curfile= expand("%")
-" call Decho("curfile<".curfile.">")
+" call Decho("curfile<".curfile.">",'~'.expand("<slnum>"))
exe (a:rightside? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new"
if a:0 > 0 && a1 != ""
-" call Decho("case 1: Explore ".a1)
+" call Decho("case 1: Explore ".a1,'~'.expand("<slnum>"))
exe "Explore ".fnameescape(a1)
- elseif curfile =~ '^\a\+://'
-" call Decho("case 2: Explore ".substitute(curfile,'[^/\\]*$','',''))
+ elseif curfile =~ '^\a\{3,}://'
+" call Decho("case 2: Explore ".substitute(curfile,'[^/\\]*$','',''),'~'.expand("<slnum>"))
exe "Explore ".substitute(curfile,'[^/\\]*$','','')
else
-" call Decho("case 3: Explore .")
+" call Decho("case 3: Explore .",'~'.expand("<slnum>"))
Explore .
endif
if a:count != 0
@@ -1199,7 +1204,7 @@ fun! netrw#Lexplore(count,rightside,...)
let g:netrw_altv = keep_altv
let t:netrw_lexbufnr = bufnr("%")
if exists("t:netrw_lexposn")
-" call Decho("restoring to t:netrw_lexposn")
+" call Decho("restoring to t:netrw_lexposn",'~'.expand("<slnum>"))
call netrw#RestorePosn(t:netrw_lexposn)
unlet t:netrw_lexposn
endif
@@ -1229,14 +1234,14 @@ fun! netrw#Clean(sys)
else
let choice= confirm("Remove personal copy of netrw?","&Yes\n&No")
endif
-" call Decho("choice=".choice)
+" call Decho("choice=".choice,'~'.expand("<slnum>"))
let diddel= 0
let diddir= ""
if choice == 1
for dir in split(&rtp,',')
if filereadable(dir."/plugin/netrwPlugin.vim")
-" call Decho("removing netrw-related files from ".dir)
+" call Decho("removing netrw-related files from ".dir,'~'.expand("<slnum>"))
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
@@ -1269,8 +1274,8 @@ fun! netrw#MakeTgt(dname)
" call Dfunc("netrw#MakeTgt(dname<".a:dname.">)")
" simplify the target (eg. /abc/def/../ghi -> /abc/ghi)
let svpos = netrw#SavePosn()
- let s:netrwmftgt_islocal= (a:dname !~ '^\a\+://')
-" call Decho("s:netrwmftgt_islocal=".s:netrwmftgt_islocal)
+ let s:netrwmftgt_islocal= (a:dname !~ '^\a\{3,}://')
+" call Decho("s:netrwmftgt_islocal=".s:netrwmftgt_islocal,'~'.expand("<slnum>"))
if s:netrwmftgt_islocal
let netrwmftgt= simplify(a:dname)
else
@@ -1283,7 +1288,7 @@ fun! netrw#MakeTgt(dname)
let s:netrwmftgt= netrwmftgt
endif
if g:netrw_fastbrowse <= 1
- call s:NetrwRefresh((b:netrw_curdir !~ '\a\+://'),b:netrw_curdir)
+ call s:NetrwRefresh((b:netrw_curdir !~ '\a\{3,}://'),b:netrw_curdir)
endif
call netrw#RestorePosn(svpos)
" call Dret("netrw#MakeTgt")
@@ -1309,40 +1314,40 @@ fun! netrw#Obtain(islocal,fname,...)
" call Dret("netrw#Obtain")
return
endif
-" call Decho("fnamelist<".string(fnamelist).">")
+" call Decho("fnamelist<".string(fnamelist).">",'~'.expand("<slnum>"))
if a:0 > 0
let tgtdir= a:1
else
let tgtdir= getcwd()
endif
-" call Decho("tgtdir<".tgtdir.">")
+" call Decho("tgtdir<".tgtdir.">",'~'.expand("<slnum>"))
if exists("b:netrw_islocal") && b:netrw_islocal
" obtain a file from local b:netrw_curdir to (local) tgtdir
-" call Decho("obtain a file from local ".b:netrw_curdir." to ".tgtdir)
+" call Decho("obtain a file from local ".b:netrw_curdir." to ".tgtdir,'~'.expand("<slnum>"))
if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
let topath= s:ComposePath(tgtdir,"")
if (has("win32") || has("win95") || has("win64") || has("win16"))
" transfer files one at time
-" call Decho("transfer files one at a time")
+" call Decho("transfer files one at a time",'~'.expand("<slnum>"))
for fname in fnamelist
-" call Decho("system(".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath).")")
- call system(g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath))
+" call Decho("system(".g:netrw_localcopycmd." ".s:ShellEscape(fname)." ".s:ShellEscape(topath).")",'~'.expand("<slnum>"))
+ call system(g:netrw_localcopycmd." ".s:ShellEscape(fname)." ".s:ShellEscape(topath))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80)
-" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath))
+" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".s:ShellEscape(fname)." ".s:ShellEscape(topath))
return
endif
endfor
else
" transfer files with one command
-" call Decho("transfer files with one command")
- let filelist= join(map(deepcopy(fnamelist),"shellescape(v:val)"))
-" call Decho("system(".g:netrw_localcopycmd." ".filelist." ".shellescape(topath).")")
- call system(g:netrw_localcopycmd." ".filelist." ".shellescape(topath))
+" call Decho("transfer files with one command",'~'.expand("<slnum>"))
+ let filelist= join(map(deepcopy(fnamelist),"s:ShellEscape(v:val)"))
+" call Decho("system(".g:netrw_localcopycmd." ".filelist." ".s:ShellEscape(topath).")",'~'.expand("<slnum>"))
+ call system(g:netrw_localcopycmd." ".filelist." ".s:ShellEscape(topath))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80)
-" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".filelist." ".shellescape(topath))
+" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".filelist." ".s:ShellEscape(topath))
return
endif
endif
@@ -1354,7 +1359,7 @@ fun! netrw#Obtain(islocal,fname,...)
else
" obtain files from remote b:netrw_curdir to local tgtdir
-" call Decho("obtain a file from remote ".b:netrw_curdir." to ".tgtdir)
+" call Decho("obtain a file from remote ".b:netrw_curdir." to ".tgtdir,'~'.expand("<slnum>"))
if type(a:fname) == 1
call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.a:fname)
endif
@@ -1362,7 +1367,7 @@ fun! netrw#Obtain(islocal,fname,...)
if b:netrw_method == 4
" obtain file using scp
-" call Decho("obtain via scp (method#4)")
+" call Decho("obtain via scp (method#4)",'~'.expand("<slnum>"))
if exists("g:netrw_port") && g:netrw_port != ""
let useport= " ".g:netrw_scpport." ".g:netrw_port
else
@@ -1373,37 +1378,37 @@ fun! netrw#Obtain(islocal,fname,...)
else
let path= ""
endif
- let filelist= join(map(deepcopy(fnamelist),'shellescape(g:netrw_machine.":".path.v:val,1)'))
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1))
+ let filelist= join(map(deepcopy(fnamelist),'s:ShellEscape(g:netrw_machine.":".path.v:val,1)'))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.s:ShellEscape(useport,1)." ".filelist." ".s:ShellEscape(tgtdir,1))
elseif b:netrw_method == 2
" obtain file using ftp + .netrc
-" call Decho("obtain via ftp+.netrc (method #2)")
+" call Decho("obtain via ftp+.netrc (method #2)",'~'.expand("<slnum>"))
call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
let tmpbufnr= bufnr("%")
setl ff=unix
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("b:netrw_fname") && b:netrw_fname != ""
call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
for fname in fnamelist
call setline(line("$")+1,'get "'.fname.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endfor
if exists("g:netrw_port") && g:netrw_port != ""
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1))
else
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s: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 '
@@ -1415,56 +1420,56 @@ fun! netrw#Obtain(islocal,fname,...)
elseif b:netrw_method == 3
" obtain with ftp + machine, id, passwd, and fname (ie. no .netrc)
-" call Decho("obtain via ftp+mipf (method #3)")
+" call Decho("obtain via ftp+mipf (method #3)",'~'.expand("<slnum>"))
call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
let tmpbufnr= bufnr("%")
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
else
NetrwKeepj put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
NetrwKeepj put =g:netrw_uid
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("s:netrw_passwd") && s:netrw_passwd != ""
NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
elseif exists("s:netrw_passwd")
NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
endif
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("b:netrw_fname") && b:netrw_fname != ""
NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
for fname in fnamelist
NetrwKeepj call setline(line("$")+1,'get "'.fname.'"')
endfor
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
" perform ftp:
" -i : turns off interactive prompting from ftp
@@ -1474,7 +1479,7 @@ fun! netrw#Obtain(islocal,fname,...)
call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
-" call Decho("error<".getline(1).">")
+" call Decho("error<".getline(1).">",'~'.expand("<slnum>"))
if !exists("g:netrw_quiet")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
endif
@@ -1482,13 +1487,13 @@ fun! netrw#Obtain(islocal,fname,...)
elseif b:netrw_method == 9
" obtain file using sftp
-" call Decho("obtain via sftp (method #9)")
+" call Decho("obtain via sftp (method #9)",'~'.expand("<slnum>"))
if a:fname =~ '/'
let localfile= substitute(a:fname,'^.*/','','')
else
let localfile= a:fname
endif
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1).s:ShellEscape(localfile)." ".s:ShellEscape(tgtdir))
elseif !exists("b:netrw_method") || b:netrw_method < 0
" probably a badly formed url; protocol not recognized
@@ -1544,19 +1549,19 @@ 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("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("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,'~'.expand("<slnum>"))
if !exists("{a:vt}netrw_optionsave")
if exists("s:nbcd_curpos_{bufnr('%')}")
-" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)")
+" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)",'~'.expand("<slnum>"))
NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
-" call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"))
-" call Decho("unlet s:nbcd_curpos_".bufnr('%'))
+" call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"),'~'.expand("<slnum>"))
+" call Decho("unlet s:nbcd_curpos_".bufnr('%'),'~'.expand("<slnum>"))
unlet s:nbcd_curpos_{bufnr('%')}
else
-" call Decho("no previous position")
+" call Decho("no previous position",'~'.expand("<slnum>"))
endif
-" call Decho("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("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("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,'~'.expand("<slnum>"))
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist")
return
endif
@@ -1564,7 +1569,7 @@ fun! s:NetrwOptionRestore(vt)
if exists("+acd")
if exists("{a:vt}netrw_acdkeep")
-" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd)
+" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("<slnum>"))
let curdir = getcwd()
let &l:acd = {a:vt}netrw_acdkeep
unlet {a:vt}netrw_acdkeep
@@ -1575,9 +1580,6 @@ fun! s:NetrwOptionRestore(vt)
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
@@ -1632,7 +1634,7 @@ fun! s:NetrwOptionRestore(vt)
unlet {a:vt}netrw_swfkeep
endif
endif
- if exists("{a:vt}netrw_dirkeep") && isdirectory({a:vt}netrw_dirkeep) && g:netrw_keepdir
+ if exists("{a:vt}netrw_dirkeep") && isdirectory(s:NetrwFile({a:vt}netrw_dirkeep)) && g:netrw_keepdir
let dirkeep = substitute({a:vt}netrw_dirkeep,'\\','/','g')
if exists("{a:vt}netrw_dirkeep")
call s:NetrwLcd(dirkeep)
@@ -1644,29 +1646,29 @@ fun! s:NetrwOptionRestore(vt)
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("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)")
+" call Decho("restoring previous position (s:nbcd_curpos_".bufnr('%')." exists)",'~'.expand("<slnum>"))
NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
-" call Decho("unlet s:nbcd_curpos_".bufnr('%'))
+" call Decho("unlet s:nbcd_curpos_".bufnr('%'),'~'.expand("<slnum>"))
if exists("s:nbcd_curpos_".bufnr('%'))
unlet s:nbcd_curpos_{bufnr('%')}
endif
else
-" call Decho("no previous position")
+" call Decho("no previous position",'~'.expand("<slnum>"))
endif
-" 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=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-" call Decho("diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist"))
-" call Decho("ts=".&l:ts)
+" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("<slnum>"))
+" call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist"),'~'.expand("<slnum>"))
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
+" call Decho("diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist"),'~'.expand("<slnum>"))
+" call Decho("ts=".&l:ts,'~'.expand("<slnum>"))
" 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("filetype detect (ft=".&ft.")")
+" call Decho("filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
filetype detect
endif
-" call Decho("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("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,'~'.expand("<slnum>"))
" call Dret("s:NetrwOptionRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
endfun
@@ -1680,8 +1682,8 @@ endfun
" 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("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(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"),'~'.expand("<slnum>"))
+" call Decho("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,'~'.expand("<slnum>"))
if !exists("{a:vt}netrw_optionsave")
let {a:vt}netrw_optionsave= 1
@@ -1689,10 +1691,10 @@ fun! s:NetrwOptionSave(vt)
" call Dret("s:NetrwOptionSave : options already saved")
return
endif
-" call Decho("prior to save: fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." diff=".&l:diff)
+" call Decho("prior to save: fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." diff=".&l:diff,'~'.expand("<slnum>"))
" Save current settings and current directory
-" call Decho("saving current settings and current directory")
+" call Decho("saving current settings and current directory",'~'.expand("<slnum>"))
let s:yykeep = @@
if exists("&l:acd")|let {a:vt}netrw_acdkeep = &l:acd|endif
let {a:vt}netrw_aikeep = &l:ai
@@ -1740,7 +1742,7 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_writekeep = &l:write
" save a few selected netrw-related variables
-" call Decho("saving a few selected netrw-related variables")
+" call Decho("saving a few selected netrw-related variables",'~'.expand("<slnum>"))
if g:netrw_keepdir
let {a:vt}netrw_dirkeep = getcwd()
endif
@@ -1749,7 +1751,7 @@ fun! s:NetrwOptionSave(vt)
endif
sil! let {a:vt}netrw_regslash= @/
-" call Decho("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("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,'~'.expand("<slnum>"))
" call Dret("s:NetrwOptionSave : tab#".tabpagenr()." win#".winnr())
endfun
@@ -1759,8 +1761,8 @@ endfun
" Use s:NetrwOptionRestore() to restore user settings
fun! s:NetrwSafeOptions()
" call Dfunc("s:NetrwSafeOptions() win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%"))."> winnr($)=".winnr("$"))
-" call Decho("win#".winnr()."'s ft=".&ft)
-" call Decho("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 Decho("win#".winnr()."'s ft=".&ft,'~'.expand("<slnum>"))
+" call Decho("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,'~'.expand("<slnum>"))
if exists("+acd") | setl noacd | endif
setl noai
setl noaw
@@ -1769,9 +1771,7 @@ fun! s:NetrwSafeOptions()
setl bt=nofile
setl noci
setl nocin
- if g:netrw_liststyle == s:TREELIST
- setl bh=hide
- endif
+ setl bh=hide
setl cino=
setl com=
setl cpo-=a
@@ -1793,14 +1793,14 @@ fun! s:NetrwSafeOptions()
call s:NetrwCursor()
" allow the user to override safe options
-" call Decho("ft<".&ft."> ei=".&ei)
+" call Decho("ft<".&ft."> ei=".&ei,'~'.expand("<slnum>"))
if &ft == "netrw"
-" call Decho("do any netrw FileType autocmds (doau FileType netrw)")
+" call Decho("do any netrw FileType autocmds (doau FileType netrw)",'~'.expand("<slnum>"))
sil! keepalt NetrwKeepj doau FileType netrw
endif
-" call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh." bt<".&bt.">")
-" call Decho("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 Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh." bt<".&bt.">",'~'.expand("<slnum>"))
+" call Decho("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,'~'.expand("<slnum>"))
" call Dret("s:NetrwSafeOptions")
endfun
@@ -1857,7 +1857,7 @@ fun! netrw#NetRead(mode,...)
" NetrwSafeOptions sets a buffer up for a netrw listing, which includes buflisting off.
" However, this setting is not wanted for a remote editing session. The buffer should be "nofile", still.
setl bl
-" call Decho("(netrw#NetRead) buf#".bufnr("%")."<".bufname("%")."> bl=".&bl." bt=".&bt." bh=".&bh)
+" call Decho("(netrw#NetRead) buf#".bufnr("%")."<".bufname("%")."> bl=".&bl." bt=".&bt." bh=".&bh,'~'.expand("<slnum>"))
" NetRead: interpret mode into a readcmd {{{3
if a:mode == 0 " read remote file before current line
@@ -1873,7 +1873,7 @@ fun! netrw#NetRead(mode,...)
let readcmd = "r"
endif
let ichoice = (a:0 == 0)? 0 : 1
-" call Decho("readcmd<".readcmd."> ichoice=".ichoice)
+" call Decho("readcmd<".readcmd."> ichoice=".ichoice,'~'.expand("<slnum>"))
" NetRead: get temporary filename {{{3
let tmpfile= s:GetTempfile("")
@@ -1886,13 +1886,13 @@ fun! netrw#NetRead(mode,...)
" attempt to repeat with previous host-file-etc
if exists("b:netrw_lastfile") && a:0 == 0
-" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">",'~'.expand("<slnum>"))
let choice = b:netrw_lastfile
let ichoice= ichoice + 1
else
exe "let choice= a:" . ichoice
-" call Decho("no lastfile: choice<" . choice . ">")
+" call Decho("no lastfile: choice<" . choice . ">",'~'.expand("<slnum>"))
if match(choice,"?") == 0
" give help
@@ -1915,7 +1915,7 @@ fun! netrw#NetRead(mode,...)
elseif match(choice,'^"') != -1
" Reconstruct Choice if choice starts with '"'
-" call Decho("reconstructing choice")
+" call Decho("reconstructing choice",'~'.expand("<slnum>"))
if match(choice,'"$') != -1
" case "..."
let choice= strpart(choice,1,strlen(choice)-2)
@@ -1941,7 +1941,7 @@ fun! netrw#NetRead(mode,...)
endif
endif
-" call Decho("choice<" . choice . ">")
+" call Decho("choice<" . choice . ">",'~'.expand("<slnum>"))
let ichoice= ichoice + 1
" NetRead: Determine method of read (ftp, rcp, etc) {{{3
@@ -1953,9 +1953,9 @@ fun! netrw#NetRead(mode,...)
let tmpfile= s:GetTempfile(b:netrw_fname) " apply correct suffix
" Check whether or not NetrwBrowse() should be handling this request
-" call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
+" call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">",'~'.expand("<slnum>"))
if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^https\=://'
-" call Decho("yes, choice matches '^.*[\/]$'")
+" call Decho("yes, choice matches '^.*[\/]$'",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwBrowse(0,choice)
" call Dret("netrw#NetRead :3 getcwd<".getcwd().">")
return
@@ -1971,7 +1971,7 @@ fun! netrw#NetRead(mode,...)
".........................................
" NetRead: (rcp) NetRead Method #1 {{{3
if b:netrw_method == 1 " read with rcp
-" call Decho("read via rcp (method #1)")
+" call Decho("read via rcp (method #1)",'~'.expand("<slnum>"))
" ER: nothing done with g:netrw_uid yet?
" ER: on Win2K" rcp machine[.user]:file tmpfile
" ER: when machine contains '.' adding .user is required (use $USERNAME)
@@ -1990,30 +1990,30 @@ fun! netrw#NetRead(mode,...)
let uid_machine = g:netrw_machine
endif
endif
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".s:ShellEscape(uid_machine.":".b:netrw_fname,1)." ".s:ShellEscape(tmpfile,1))
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
" NetRead: (ftp + <.netrc>) NetRead Method #2 {{{3
elseif b:netrw_method == 2 " read with ftp + <.netrc>
-" call Decho("read via ftp+.netrc (method #2)")
+" call Decho("read via ftp+.netrc (method #2)",'~'.expand("<slnum>"))
let netrw_fname= b:netrw_fname
NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
let filtbuf= bufnr("%")
setl ff=unix
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline(line("$")))
+" call Decho("filter input: ".getline(line("$")),'~'.expand("<slnum>"))
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline(line("$")))
+" call Decho("filter input: ".getline(line("$")),'~'.expand("<slnum>"))
endif
call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile)
-" call Decho("filter input: ".getline(line("$")))
+" call Decho("filter input: ".getline(line("$")),'~'.expand("<slnum>"))
if exists("g:netrw_port") && g:netrw_port != ""
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1))
else
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s: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 '
@@ -2023,7 +2023,7 @@ fun! netrw#NetRead(mode,...)
let &debug = debugkeep
endif
call s:SaveBufVars()
- bd!
+ keepj bd!
if bufname("%") == "" && getline("$") == "" && line('$') == 1
" needed when one sources a file in a nolbl setting window via ftp
q!
@@ -2036,43 +2036,43 @@ fun! netrw#NetRead(mode,...)
" NetRead: (ftp + machine,id,passwd,filename) NetRead Method #3 {{{3
elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname
" Construct execution string (four lines) which will be passed through filter
-" call Decho("read via ftp+mipf (method #3)")
+" call Decho("read via ftp+mipf (method #3)",'~'.expand("<slnum>"))
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
let filtbuf= bufnr("%")
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
else
NetrwKeepj put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
NetrwKeepj put =g:netrw_uid
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
if exists("s:netrw_passwd")
NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
elseif exists("s:netrw_passwd")
NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
endif
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
NetrwKeepj put ='get \"'.netrw_fname.'\" '.tmpfile
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
" perform ftp:
" -i : turns off interactive prompting from ftp
@@ -2082,19 +2082,19 @@ fun! netrw#NetRead(mode,...)
call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
-" call Decho("error<".getline(1).">")
+" call Decho("error<".getline(1).">",'~'.expand("<slnum>"))
if !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,getline(1),5)
endif
endif
- call s:SaveBufVars()|bd!|call s:RestoreBufVars()
+ call s:SaveBufVars()|keepj bd!|call s:RestoreBufVars()
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
" NetRead: (scp) NetRead Method #4 {{{3
elseif b:netrw_method == 4 " read with scp
-" call Decho("read via scp (method #4)")
+" call Decho("read via scp (method #4)",'~'.expand("<slnum>"))
if exists("g:netrw_port") && g:netrw_port != ""
let useport= " ".g:netrw_scpport." ".g:netrw_port
else
@@ -2107,14 +2107,14 @@ fun! netrw#NetRead(mode,...)
else
let tmpfile_get = tmpfile
endif
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile_get,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1)." ".s:ShellEscape(tmpfile_get,1))
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
" NetRead: (http) NetRead Method #5 (wget) {{{3
elseif b:netrw_method == 5
-" call Decho("read via http (method #5)")
+" call Decho("read via http (method #5)",'~'.expand("<slnum>"))
if g:netrw_http_cmd == ""
if !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"neither the wget nor the fetch command is available",6)
@@ -2125,34 +2125,34 @@ fun! netrw#NetRead(mode,...)
if match(b:netrw_fname,"#") == -1 || exists("g:netrw_http_xcmd")
" using g:netrw_http_cmd (usually elinks, links, curl, wget, or fetch)
-" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)")
+" call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)",'~'.expand("<slnum>"))
if exists("g:netrw_http_xcmd")
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".s:ShellEscape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".s:ShellEscape(tmpfile,1))
else
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
endif
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
else
" wget/curl/fetch 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.">)")
+" call Decho("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)",'~'.expand("<slnum>"))
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 s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1))
+" call Decho("netrw_html<".netrw_html.">",'~'.expand("<slnum>"))
+" call Decho("netrw_tag <".netrw_tag.">",'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(b:netrw_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.'"/')
+" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/','~'.expand("<slnum>"))
exe 'NetrwKeepj norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
endif
let b:netrw_lastfile = choice
-" call Decho("setl ro")
+" call Decho("setl ro",'~'.expand("<slnum>"))
setl ro nomod
".........................................
" NetRead: (dav) NetRead Method #6 {{{3
elseif b:netrw_method == 6
-" call Decho("read via cadaver (method #6)")
+" call Decho("read via cadaver (method #6)",'~'.expand("<slnum>"))
if !executable(g:netrw_dav_cmd)
call netrw#ErrorMsg(s:ERROR,g:netrw_dav_cmd." is not executable",73)
@@ -2160,7 +2160,7 @@ fun! netrw#NetRead(mode,...)
return
endif
if g:netrw_dav_cmd =~ "curl"
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_dav_cmd." ".s:ShellEscape("dav://".g:netrw_machine.b:netrw_fname,1)." ".s:ShellEscape(tmpfile,1))
else
" Construct execution string (four lines) which will be passed through filter
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
@@ -2180,7 +2180,7 @@ fun! netrw#NetRead(mode,...)
" perform cadaver operation:
NetrwKeepj norm! 1Gdd
call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd)
- bd!
+ keepj bd!
endif
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -2188,8 +2188,8 @@ fun! netrw#NetRead(mode,...)
".........................................
" NetRead: (rsync) NetRead Method #7 {{{3
elseif b:netrw_method == 7
-" call Decho("read via rsync (method #7)")
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
+" call Decho("read via rsync (method #7)",'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1)." ".s:ShellEscape(tmpfile,1))
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -2197,7 +2197,7 @@ fun! netrw#NetRead(mode,...)
" NetRead: (fetch) NetRead Method #8 {{{3
" fetch://[user@]host[:http]/path
elseif b:netrw_method == 8
-" call Decho("read via fetch (method #8)")
+" call Decho("read via fetch (method #8)",'~'.expand("<slnum>"))
if g:netrw_fetch_cmd == ""
if !exists("g:netrw_quiet")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"fetch command not available",7)
@@ -2210,32 +2210,32 @@ fun! netrw#NetRead(mode,...)
else
let netrw_option= "ftp"
endif
-" call Decho("read via fetch for ".netrw_option)
+" call Decho("read via fetch for ".netrw_option,'~'.expand("<slnum>"))
if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != ""
- call s:NetrwExe(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))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1))
else
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
endif
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
-" call Decho("setl ro")
+" call Decho("setl ro",'~'.expand("<slnum>"))
setl ro nomod
".........................................
" NetRead: (sftp) NetRead Method #9 {{{3
elseif b:netrw_method == 9
-" call Decho("read via sftp (method #9)")
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
+" call Decho("read via sftp (method #9)",'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
" NetRead: (file) NetRead Method #10 {{{3
elseif b:netrw_method == 10 && exists("g:netrw_file_cmd")
-" " call Decho("read via ".b:netrw_file_cmd." (method #10)")
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_file_cmd." ".shellescape(b:netrw_fname,1)." ".tmpfile)
+" " call Decho("read via ".b:netrw_file_cmd." (method #10)",'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_file_cmd." ".s:ShellEscape(b:netrw_fname,1)." ".tmpfile)
let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
@@ -2248,12 +2248,12 @@ fun! netrw#NetRead(mode,...)
" NetRead: cleanup {{{3
if exists("b:netrw_method")
-" call Decho("cleanup b:netrw_method and b:netrw_fname")
+" call Decho("cleanup b:netrw_method and b:netrw_fname",'~'.expand("<slnum>"))
unlet b:netrw_method
unlet b:netrw_fname
endif
if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' && tmpfile !~ '.tar.xz$' && tmpfile !~ '.txz'
-" call Decho("cleanup by deleting tmpfile<".tmpfile.">")
+" call Decho("cleanup by deleting tmpfile<".tmpfile.">",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwDelete(tmpfile)
endif
NetrwKeepj call s:NetrwOptionRestore("w:")
@@ -2285,21 +2285,21 @@ fun! netrw#NetWrite(...) range
endif
let curbufname= expand("%")
-" call Decho("curbufname<".curbufname.">")
+" call Decho("curbufname<".curbufname.">",'~'.expand("<slnum>"))
if &binary
" 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) sil exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
+" call Decho("(write entire file) sil exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile),'~'.expand("<slnum>"))
exe "sil NetrwKeepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
elseif g:netrw_cygwin
" write (selected portion of) file to temporary
let cygtmpfile= substitute(tmpfile,g:netrw_cygdrive.'/\(.\)','\1:','')
-" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile))
+" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile),'~'.expand("<slnum>"))
exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)
else
" write (selected portion of) file to temporary
-" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
+" call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile),'~'.expand("<slnum>"))
exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
endif
@@ -2316,7 +2316,7 @@ fun! netrw#NetWrite(...) range
" Process arguments: {{{4
" attempt to repeat with previous host-file-etc
if exists("b:netrw_lastfile") && a:0 == 0
-" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">",'~'.expand("<slnum>"))
let choice = b:netrw_lastfile
let ichoice= ichoice + 1
else
@@ -2364,7 +2364,7 @@ fun! netrw#NetWrite(...) range
endif
endif
let ichoice= ichoice + 1
-" call Decho("choice<" . choice . "> ichoice=".ichoice)
+" call Decho("choice<" . choice . "> ichoice=".ichoice,'~'.expand("<slnum>"))
" Determine method of write (ftp, rcp, etc) {{{4
NetrwKeepj call s:NetrwMethod(choice)
@@ -2378,13 +2378,13 @@ fun! netrw#NetWrite(...) range
" ============================
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
echo "(netrw) Processing your write request..."
-" call Decho("(netrw) Processing your write request...")
+" call Decho("(netrw) Processing your write request...",'~'.expand("<slnum>"))
endif
".........................................
" NetWrite: (rcp) NetWrite Method #1 {{{3
if b:netrw_method == 1
-" call Decho("write via rcp (method #1)")
+" call Decho("write via rcp (method #1)",'~'.expand("<slnum>"))
if s:netrw_has_nt_rcp == 1
if exists("g:netrw_uid") && ( g:netrw_uid != "" )
let uid_machine = g:netrw_machine .'.'. g:netrw_uid
@@ -2398,36 +2398,36 @@ fun! netrw#NetWrite(...) range
let uid_machine = g:netrw_machine
endif
endif
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(uid_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
" NetWrite: (ftp + <.netrc>) NetWrite Method #2 {{{3
elseif b:netrw_method == 2
-" call Decho("write via ftp+.netrc (method #2)")
+" call Decho("write via ftp+.netrc (method #2)",'~'.expand("<slnum>"))
let netrw_fname = b:netrw_fname
" formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead
let bhkeep = &l:bh
let curbuf = bufnr("%")
setl bh=hide
- keepalt enew
+ keepj keepalt enew
-" call Decho("filter input window#".winnr())
+" call Decho("filter input window#".winnr(),'~'.expand("<slnum>"))
setl ff=unix
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline("$"))
+" call Decho("filter input: ".getline("$"),'~'.expand("<slnum>"))
endif
NetrwKeepj call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"')
-" call Decho("filter input: ".getline("$"))
+" call Decho("filter input: ".getline("$"),'~'.expand("<slnum>"))
if exists("g:netrw_port") && g:netrw_port != ""
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1))
else
-" call Decho("filter input window#".winnr())
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
+" call Decho("filter input window#".winnr(),'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s: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) !~ "^$"
@@ -2449,44 +2449,44 @@ fun! netrw#NetWrite(...) range
" NetWrite: (ftp + machine, id, passwd, filename) NetWrite Method #3 {{{3
elseif b:netrw_method == 3
" Construct execution string (three or more lines) which will be passed through filter
-" call Decho("read via ftp+mipf (method #3)")
+" call Decho("read via ftp+mipf (method #3)",'~'.expand("<slnum>"))
let netrw_fname = b:netrw_fname
let bhkeep = &l:bh
" formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead
let curbuf = bufnr("%")
setl bh=hide
- keepalt enew
+ keepj keepalt enew
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
else
NetrwKeepj put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
NetrwKeepj put =g:netrw_uid
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
if exists("s:netrw_passwd") && s:netrw_passwd != ""
NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
endif
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
elseif exists("s:netrw_passwd") && s:netrw_passwd != ""
NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
endif
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline("$"))
+" call Decho("filter input: ".getline("$"),'~'.expand("<slnum>"))
endif
NetrwKeepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
" save choice/id/password for future use
let b:netrw_lastfile = choice
@@ -2513,23 +2513,23 @@ fun! netrw#NetWrite(...) range
".........................................
" NetWrite: (scp) NetWrite Method #4 {{{3
elseif b:netrw_method == 4
-" call Decho("write via scp (method #4)")
+" call Decho("write via scp (method #4)",'~'.expand("<slnum>"))
if exists("g:netrw_port") && g:netrw_port != ""
let useport= " ".g:netrw_scpport." ".fnameescape(g:netrw_port)
else
let useport= ""
endif
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
" NetWrite: (http) NetWrite Method #5 {{{3
elseif b:netrw_method == 5
-" call Decho("write via http (method #5)")
+" call Decho("write via http (method #5)",'~'.expand("<slnum>"))
let curl= substitute(g:netrw_http_put_cmd,'\s\+.*$',"","")
if executable(curl)
let url= g:netrw_choice
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) )
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(url,1) )
elseif !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"can't write to http using <".g:netrw_http_put_cmd".">".",16)
endif
@@ -2537,7 +2537,7 @@ fun! netrw#NetWrite(...) range
".........................................
" NetWrite: (dav) NetWrite Method #6 (cadaver) {{{3
elseif b:netrw_method == 6
-" call Decho("write via cadaver (method #6)")
+" call Decho("write via cadaver (method #6)",'~'.expand("<slnum>"))
" Construct execution string (four lines) which will be passed through filter
let netrw_fname = escape(b:netrw_fname,g:netrw_fname_escape)
@@ -2546,7 +2546,7 @@ fun! netrw#NetWrite(...) range
" formerly just a "new...bd!", that changed the window sizes when equalalways. Using enew workaround instead
let curbuf = bufnr("%")
setl bh=hide
- keepalt enew
+ keepj keepalt enew
setl ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
@@ -2574,14 +2574,14 @@ fun! netrw#NetWrite(...) range
".........................................
" NetWrite: (rsync) NetWrite Method #7 {{{3
elseif b:netrw_method == 7
-" call Decho("write via rsync (method #7)")
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
+" call Decho("write via rsync (method #7)",'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".s:ShellEscape(tmpfile,1)." ".s:ShellEscape(g:netrw_machine.":".b:netrw_fname,1))
let b:netrw_lastfile = choice
".........................................
" NetWrite: (sftp) NetWrite Method #9 {{{3
elseif b:netrw_method == 9
-" call Decho("write via sftp (method #9)")
+" call Decho("write via sftp (method #9)",'~'.expand("<slnum>"))
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
if exists("g:netrw_uid") && ( g:netrw_uid != "" )
let uid_machine = g:netrw_uid .'@'. g:netrw_machine
@@ -2593,13 +2593,13 @@ fun! netrw#NetWrite(...) range
let bhkeep = &l:bh
let curbuf = bufnr("%")
setl bh=hide
- keepalt enew
+ keepj keepalt enew
setl ff=unix
call setline(1,'put "'.escape(tmpfile,'\').'" '.netrw_fname)
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
let sftpcmd= substitute(g:netrw_sftp_cmd,"%TEMPFILE%",escape(tmpfile,'\'),"g")
- call s:NetrwExe(s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".sftpcmd.' '.s:ShellEscape(uid_machine,1))
let filtbuf= bufnr("%")
exe curbuf."b!"
let &l:bh = bhkeep
@@ -2615,9 +2615,9 @@ fun! netrw#NetWrite(...) range
endwhile
" NetWrite: Cleanup: {{{3
-" call Decho("cleanup")
+" call Decho("cleanup",'~'.expand("<slnum>"))
if s:FileReadable(tmpfile)
-" call Decho("tmpfile<".tmpfile."> readable, will now delete it")
+" call Decho("tmpfile<".tmpfile."> readable, will now delete it",'~'.expand("<slnum>"))
call s:NetrwDelete(tmpfile)
endif
call s:NetrwOptionRestore("w:")
@@ -2625,12 +2625,12 @@ fun! netrw#NetWrite(...) range
if a:firstline == 1 && a:lastline == line("$")
" restore modifiability; usually equivalent to set nomod
let &mod= mod
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
elseif !exists("leavemod")
" indicate that the buffer has not been modified since last written
-" call Decho("set nomod")
+" call Decho("set nomod",'~'.expand("<slnum>"))
setl nomod
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
" call Dret("netrw#NetWrite")
@@ -2659,11 +2659,11 @@ fun! netrw#NetSource(...)
let i= 1
while i <= a:0
call netrw#NetRead(3,a:{i})
-" call Decho("s:netread_tmpfile<".s:netrw_tmpfile.">")
+" call Decho("s:netread_tmpfile<".s:netrw_tmpfile.">",'~'.expand("<slnum>"))
if s:FileReadable(s:netrw_tmpfile)
-" call Decho("exe so ".fnameescape(s:netrw_tmpfile))
+" call Decho("exe so ".fnameescape(s:netrw_tmpfile),'~'.expand("<slnum>"))
exe "so ".fnameescape(s:netrw_tmpfile)
-" call Decho("delete(".s:netrw_tmpfile.")")
+" call Decho("delete(".s:netrw_tmpfile.")",'~'.expand("<slnum>"))
call delete(s:netrw_tmpfile)
unlet s:netrw_tmpfile
else
@@ -2683,33 +2683,37 @@ fun! netrw#SetTreetop(...)
" clear out the current tree
if exists("w:netrw_treetop")
-" call Decho("clearing out current tree")
+" call Decho("clearing out current tree",'~'.expand("<slnum>"))
let inittreetop= w:netrw_treetop
unlet w:netrw_treetop
endif
if exists("w:netrw_treedict")
-" call Decho("freeing w:netrw_treedict")
+" call Decho("freeing w:netrw_treedict",'~'.expand("<slnum>"))
unlet w:netrw_treedict
endif
if a:1 == "" && exists("inittreetop")
let treedir= s:NetrwTreePath(inittreetop)
-" call Decho("treedir<".treedir.">")
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
else
- if isdirectory(a:1)
-" call Decho("a:1<".a:1."> is a directory")
+ if isdirectory(s:NetrwFile(a:1))
+" call Decho("a:1<".a:1."> is a directory",'~'.expand("<slnum>"))
let treedir= a:1
- elseif exists("b:netrw_curdir") && isdirectory(b:netrw_curdir."/".a:1)
+ elseif exists("b:netrw_curdir") && (isdirectory(s:NetrwFile(b:netrw_curdir."/".a:1)) || a:1 =~ '^\a\{3,}://')
let treedir= b:netrw_curdir."/".a:1
-" call Decho("a:1<".a:1."> is NOT a directory, trying treedir<".treedir.">")
+" call Decho("a:1<".a:1."> is NOT a directory, trying treedir<".treedir.">",'~'.expand("<slnum>"))
else
+ " normally the cursor is left in the message window.
+ " However, here this results in the directory being listed in the message window, which is not wanted.
+ let netrwbuf= bufnr("%")
call netrw#ErrorMsg(s:ERROR,"sorry, ".a:1." doesn't seem to be a directory!",95)
+ exe bufwinnr(netrwbuf)."wincmd w"
let treedir= "."
endif
endif
-" call Decho("treedir<".treedir.">")
- let islocal= expand("%") !~ '^\a\+://'
-" call Decho("islocal=".islocal)
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
+ let islocal= expand("%") !~ '^\a\{3,}://'
+" call Decho("islocal=".islocal,'~'.expand("<slnum>"))
if islocal
call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(islocal,treedir))
else
@@ -2729,14 +2733,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" readcmd=='t': simply do nothing
if a:readcmd == 't'
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("NetrwGetFile : skip read of <".a:tfile.">")
return
endif
" get name of remote filename (ie. url and all)
let rfile= bufname("%")
-" call Decho("rfile<".rfile.">")
+" call Decho("rfile<".rfile.">",'~'.expand("<slnum>"))
if exists("*NetReadFixup")
" for the use of NetReadFixup (not otherwise used internally)
@@ -2745,7 +2749,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
if a:readcmd[0] == '%'
" get file into buffer
-" call Decho("get file into buffer")
+" call Decho("get file into buffer",'~'.expand("<slnum>"))
" rename the current buffer to the temp file (ie. tfile)
if g:netrw_cygwin
@@ -2753,41 +2757,41 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
else
let tfile= a:tfile
endif
-" call Decho("exe sil! keepalt file ".fnameescape(tfile))
+" call Decho("exe sil! keepalt file ".fnameescape(tfile),'~'.expand("<slnum>"))
exe "sil! keepalt file ".fnameescape(tfile)
" edit temporary file (ie. read the temporary file in)
if rfile =~ '\.zip$'
-" call Decho("handling remote zip file with zip#Browse(tfile<".tfile.">)")
+" call Decho("handling remote zip file with zip#Browse(tfile<".tfile.">)",'~'.expand("<slnum>"))
call zip#Browse(tfile)
elseif rfile =~ '\.tar$'
-" call Decho("handling remote tar file with tar#Browse(tfile<".tfile.">)")
+" call Decho("handling remote tar file with tar#Browse(tfile<".tfile.">)",'~'.expand("<slnum>"))
call tar#Browse(tfile)
elseif rfile =~ '\.tar\.gz$'
-" call Decho("handling remote gzip-compressed tar file")
+" call Decho("handling remote gzip-compressed tar file",'~'.expand("<slnum>"))
call tar#Browse(tfile)
elseif rfile =~ '\.tar\.bz2$'
-" call Decho("handling remote bz2-compressed tar file")
+" call Decho("handling remote bz2-compressed tar file",'~'.expand("<slnum>"))
call tar#Browse(tfile)
elseif rfile =~ '\.tar\.xz$'
-" call Decho("handling remote xz-compressed tar file")
+" call Decho("handling remote xz-compressed tar file",'~'.expand("<slnum>"))
call tar#Browse(tfile)
elseif rfile =~ '\.txz$'
-" call Decho("handling remote xz-compressed tar file (.txz)")
+" call Decho("handling remote xz-compressed tar file (.txz)",'~'.expand("<slnum>"))
call tar#Browse(tfile)
else
-" call Decho("edit temporary file")
+" call Decho("edit temporary file",'~'.expand("<slnum>"))
NetrwKeepj e!
endif
" rename buffer back to remote filename
-" call Decho("exe sil! keepalt file ".fnameescape(rfile))
+" call Decho("exe sil! keepalt file ".fnameescape(rfile),'~'.expand("<slnum>"))
exe "sil! NetrwKeepj keepalt file ".fnameescape(rfile)
" Detect filetype of local version of remote file.
" Note that isk must not include a "/" for scripts.vim
" to process this detection correctly.
-" call Decho("detect filetype of local version of remote file")
+" call Decho("detect filetype of local version of remote file",'~'.expand("<slnum>"))
let iskkeep= &l:isk
setl isk-=/
let &l:isk= iskkeep
@@ -2798,23 +2802,23 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
elseif !&ma
" attempting to read a file after the current line in the file, but the buffer is not modifiable
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"attempt to read<".a:tfile."> into a non-modifiable buffer!",94)
-" call Dret("NetrwGetFile : attempt to read<".a:tfile."> into a non-modifiable buffer!")
+" call Dret("NetrwGetFile : attempt to read<".a:tfile."> into a non-modifiable buffer!")
return
elseif s:FileReadable(a:tfile)
" read file after current line
-" call Decho("read file<".a:tfile."> after current line")
+" call Decho("read file<".a:tfile."> after current line",'~'.expand("<slnum>"))
let curline = line(".")
let lastline= line("$")
-" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline)
+" call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)."> line#".curline,'~'.expand("<slnum>"))
exe "NetrwKeepj ".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)
let line1= curline + 1
let line2= line("$") - lastline + 1
else
" not readable
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-" call Decho("tfile<".a:tfile."> not readable")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
+" call Decho("tfile<".a:tfile."> not readable",'~'.expand("<slnum>"))
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
" call Dret("NetrwGetFile : tfile<".a:tfile."> not readable")
return
@@ -2822,10 +2826,10 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" User-provided (ie. optional) fix-it-up command
if exists("*NetReadFixup")
-" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
+" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")",'~'.expand("<slnum>"))
NetrwKeepj call NetReadFixup(a:method, line1, line2)
" else " Decho
-" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")")
+" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")",'~'.expand("<slnum>"))
endif
if has("gui") && has("menu") && has("gui_running") && &go =~# 'm' && g:netrw_menu
@@ -2833,12 +2837,12 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
NetrwKeepj call s:UpdateBuffersMenu()
endif
-" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile))
+" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile),'~'.expand("<slnum>"))
" make sure file is being displayed
" redraw!
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("NetrwGetFile")
endfun
@@ -2847,15 +2851,15 @@ endfun
" Input:
" choice = url [protocol:]//[userid@]hostname[:port]/[path-to-file]
" Output:
-" b:netrw_method= 1: rcp
-" 2: ftp + <.netrc>
-" 3: ftp + machine, id, password, and [path]filename
-" 4: scp
-" 5: http[s] (wget)
+" b:netrw_method= 1: rcp
+" 2: ftp + <.netrc>
+" 3: ftp + machine, id, password, and [path]filename
+" 4: scp
+" 5: http[s] (wget)
" 6: dav
-" 7: rsync
-" 8: fetch
-" 9: sftp
+" 7: rsync
+" 8: fetch
+" 9: sftp
" 10: file
" g:netrw_machine= hostname
" b:netrw_fname = filename
@@ -2876,7 +2880,7 @@ fun! s:NetrwMethod(choice)
" curmachine used if protocol == ftp and no .netrc
if exists("g:netrw_machine")
let curmachine= g:netrw_machine
-" call Decho("curmachine<".curmachine.">")
+" call Decho("curmachine<".curmachine.">",'~'.expand("<slnum>"))
else
let curmachine= "N O T A HOST"
endif
@@ -2921,11 +2925,11 @@ fun! s:NetrwMethod(choice)
let sftpurm = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
let fileurm = '^file\=://\(.*\)$'
-" call Decho("determine method:")
+" call Decho("determine method:",'~'.expand("<slnum>"))
" Determine Method
" Method#1: rcp://user@hostname/...path-to-file {{{3
if match(a:choice,rcpurm) == 0
-" call Decho("rcp://...")
+" call Decho("rcp://...",'~'.expand("<slnum>"))
let b:netrw_method = 1
let userid = substitute(a:choice,rcpurm,'\1',"")
let g:netrw_machine = substitute(a:choice,rcpurm,'\2',"")
@@ -2936,7 +2940,7 @@ fun! s:NetrwMethod(choice)
" Method#4: scp://user@hostname/...path-to-file {{{3
elseif match(a:choice,scpurm) == 0
-" call Decho("scp://...")
+" call Decho("scp://...",'~'.expand("<slnum>"))
let b:netrw_method = 4
let g:netrw_machine = substitute(a:choice,scpurm,'\1',"")
let g:netrw_port = substitute(a:choice,scpurm,'\2',"")
@@ -2944,7 +2948,7 @@ fun! s:NetrwMethod(choice)
" Method#5: http[s]://user@hostname/...path-to-file {{{3
elseif match(a:choice,httpurm) == 0
-" call Decho("http[s]://...")
+" call Decho("http[s]://...",'~'.expand("<slnum>"))
let b:netrw_method = 5
let g:netrw_machine= substitute(a:choice,httpurm,'\1',"")
let b:netrw_fname = substitute(a:choice,httpurm,'\2',"")
@@ -2952,7 +2956,7 @@ fun! s:NetrwMethod(choice)
" Method#6: dav://hostname[:port]/..path-to-file.. {{{3
elseif match(a:choice,davurm) == 0
-" call Decho("dav://...")
+" call Decho("dav://...",'~'.expand("<slnum>"))
let b:netrw_method= 6
if a:choice =~ 'davs:'
let g:netrw_machine= 'https://'.substitute(a:choice,davurm,'\1/\2',"")
@@ -2963,19 +2967,19 @@ fun! s:NetrwMethod(choice)
" Method#7: rsync://user@hostname/...path-to-file {{{3
elseif match(a:choice,rsyncurm) == 0
-" call Decho("rsync://...")
+" call Decho("rsync://...",'~'.expand("<slnum>"))
let b:netrw_method = 7
let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"")
let b:netrw_fname = substitute(a:choice,rsyncurm,'\2',"")
" Methods 2,3: ftp://[user@]hostname[[:#]port]/...path-to-file {{{3
elseif match(a:choice,ftpurm) == 0
-" call Decho("ftp://...")
+" call Decho("ftp://...",'~'.expand("<slnum>"))
let userid = substitute(a:choice,ftpurm,'\2',"")
let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
-" call Decho("g:netrw_machine<".g:netrw_machine.">")
+" call Decho("g:netrw_machine<".g:netrw_machine.">",'~'.expand("<slnum>"))
if userid != ""
let g:netrw_uid= userid
endif
@@ -3000,15 +3004,15 @@ fun! s:NetrwMethod(choice)
call NetUserPass("ftp:".host)
elseif (has("win32") || has("win95") || has("win64") || has("win16")) && s:netrw_ftp_cmd =~ '-[sS]:'
-" call Decho("has -s: : s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">")
-" call Decho(" g:netrw_ftp_cmd<".g:netrw_ftp_cmd.">")
+" call Decho("has -s: : s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">",'~'.expand("<slnum>"))
+" call Decho(" g:netrw_ftp_cmd<".g:netrw_ftp_cmd.">",'~'.expand("<slnum>"))
if g:netrw_ftp_cmd =~ '-[sS]:\S*MACHINE\>'
let s:netrw_ftp_cmd= substitute(g:netrw_ftp_cmd,'\<MACHINE\>',g:netrw_machine,'')
-" call Decho("s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">")
+" call Decho("s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">",'~'.expand("<slnum>"))
endif
let b:netrw_method= 2
elseif s:FileReadable(expand("$HOME/.netrc")) && !g:netrw_ignorenetrc
-" call Decho("using <".expand("$HOME/.netrc")."> (readable)")
+" call Decho("using <".expand("$HOME/.netrc")."> (readable)",'~'.expand("<slnum>"))
let b:netrw_method= 2
else
if !exists("g:netrw_uid") || g:netrw_uid == ""
@@ -3023,7 +3027,7 @@ fun! s:NetrwMethod(choice)
" Method#8: fetch {{{3
elseif match(a:choice,fetchurm) == 0
-" call Decho("fetch://...")
+" call Decho("fetch://...",'~'.expand("<slnum>"))
let b:netrw_method = 8
let g:netrw_userid = substitute(a:choice,fetchurm,'\2',"")
let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"")
@@ -3032,7 +3036,7 @@ fun! s:NetrwMethod(choice)
" Method#3: Issue an ftp : "machine id password [path/]filename" {{{3
elseif match(a:choice,mipf) == 0
-" call Decho("(ftp) host id pass file")
+" call Decho("(ftp) host id pass file",'~'.expand("<slnum>"))
let b:netrw_method = 3
let g:netrw_machine = substitute(a:choice,mipf,'\1',"")
let g:netrw_uid = substitute(a:choice,mipf,'\2',"")
@@ -3042,7 +3046,7 @@ fun! s:NetrwMethod(choice)
" Method#3: Issue an ftp: "hostname [path/]filename" {{{3
elseif match(a:choice,mf) == 0
-" call Decho("(ftp) host file")
+" call Decho("(ftp) host file",'~'.expand("<slnum>"))
if exists("g:netrw_uid") && exists("s:netrw_passwd")
let b:netrw_method = 3
let g:netrw_machine = substitute(a:choice,mf,'\1',"")
@@ -3056,32 +3060,32 @@ fun! s:NetrwMethod(choice)
" Method#9: sftp://user@hostname/...path-to-file {{{3
elseif match(a:choice,sftpurm) == 0
-" call Decho("sftp://...")
+" call Decho("sftp://...",'~'.expand("<slnum>"))
let b:netrw_method = 9
let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"")
let b:netrw_fname = substitute(a:choice,sftpurm,'\2',"")
" Method#1: Issue an rcp: hostname:filename" (this one should be last) {{{3
elseif match(a:choice,rcphf) == 0
-" call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">")
+" call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">",'~'.expand("<slnum>"))
let b:netrw_method = 1
let userid = substitute(a:choice,rcphf,'\2',"")
let g:netrw_machine = substitute(a:choice,rcphf,'\3',"")
let b:netrw_fname = substitute(a:choice,rcphf,'\4',"")
-" call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">")
-" call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">")
-" call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">")
-" call Decho('\4<'.substitute(a:choice,rcphf,'\4',"").">")
+" call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">",'~'.expand("<slnum>"))
+" call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">",'~'.expand("<slnum>"))
+" call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">",'~'.expand("<slnum>"))
+" call Decho('\4<'.substitute(a:choice,rcphf,'\4',"").">",'~'.expand("<slnum>"))
if userid != ""
let g:netrw_uid= userid
endif
" Method#10: file://user@hostname/...path-to-file {{{3
elseif match(a:choice,fileurm) == 0 && exists("g:netrw_file_cmd")
-" call Decho("http[s]://...")
+" call Decho("http[s]://...",'~'.expand("<slnum>"))
let b:netrw_method = 10
let b:netrw_fname = substitute(a:choice,fileurm,'\1',"")
-" call Decho('\1<'.substitute(a:choice,fileurm,'\1',"").">")
+" call Decho('\1<'.substitute(a:choice,fileurm,'\1',"").">",'~'.expand("<slnum>"))
" Cannot Determine Method {{{3
else
@@ -3100,17 +3104,17 @@ fun! s:NetrwMethod(choice)
let g:netrw_port= netrw_port
endif
-" call Decho("a:choice <".a:choice.">")
-" call Decho("b:netrw_method <".b:netrw_method.">")
-" call Decho("g:netrw_machine<".g:netrw_machine.">")
-" call Decho("g:netrw_port <".g:netrw_port.">")
+" call Decho("a:choice <".a:choice.">",'~'.expand("<slnum>"))
+" call Decho("b:netrw_method <".b:netrw_method.">",'~'.expand("<slnum>"))
+" call Decho("g:netrw_machine<".g:netrw_machine.">",'~'.expand("<slnum>"))
+" call Decho("g:netrw_port <".g:netrw_port.">",'~'.expand("<slnum>"))
" if exists("g:netrw_uid") "Decho
-" call Decho("g:netrw_uid <".g:netrw_uid.">")
+" call Decho("g:netrw_uid <".g:netrw_uid.">",'~'.expand("<slnum>"))
" endif "Decho
" if exists("s:netrw_passwd") "Decho
-" call Decho("s:netrw_passwd <".s:netrw_passwd.">")
+" call Decho("s:netrw_passwd <".s:netrw_passwd.">",'~'.expand("<slnum>"))
" endif "Decho
-" call Decho("b:netrw_fname <".b:netrw_fname.">")
+" call Decho("b:netrw_fname <".b:netrw_fname.">",'~'.expand("<slnum>"))
" call Dret("NetrwMethod : b:netrw_method=".b:netrw_method." g:netrw_port=".g:netrw_port)
endfun
@@ -3189,14 +3193,14 @@ fun! NetUserPass(...)
if a:1 =~ '^ftp:'
" get host from ftp:... url
" access userid and password from hup (host-user-passwd) dictionary
-" call Decho("case a:0=1: a:1<".a:1."> (get host from ftp:... url)")
+" call Decho("case a:0=1: a:1<".a:1."> (get host from ftp:... url)",'~'.expand("<slnum>"))
let host = substitute(a:1,'^ftp:','','')
let host = substitute(host,'\..*','','')
if exists("s:netrw_hup[host]")
let g:netrw_uid = s:netrw_hup[host].uid
let s:netrw_passwd = s:netrw_hup[host].passwd
-" call Decho("get s:netrw_hup[".host."].uid <".s:netrw_hup[host].uid.">")
-" call Decho("get s:netrw_hup[".host."].passwd<".s:netrw_hup[host].passwd.">")
+" call Decho("get s:netrw_hup[".host."].uid <".s:netrw_hup[host].uid.">",'~'.expand("<slnum>"))
+" call Decho("get s:netrw_hup[".host."].passwd<".s:netrw_hup[host].passwd.">",'~'.expand("<slnum>"))
else
let g:netrw_uid = input("Enter UserId: ")
let s:netrw_passwd = inputsecret("Enter Password: ")
@@ -3204,7 +3208,7 @@ fun! NetUserPass(...)
else
" case: one input argument, not an url. Using it as a new user-id.
-" call Decho("case a:0=1: a:1<".a:1."> (get host from input argument, not an url)")
+" call Decho("case a:0=1: a:1<".a:1."> (get host from input argument, not an url)",'~'.expand("<slnum>"))
if exists("g:netrw_machine")
if g:netrw_machine =~ '[0-9.]\+'
let host= g:netrw_machine
@@ -3215,7 +3219,7 @@ fun! NetUserPass(...)
let g:netrw_machine= input('Enter hostname: ')
endif
let g:netrw_uid = a:1
-" call Decho("set g:netrw_uid= <".g:netrw_uid.">")
+" call Decho("set g:netrw_uid= <".g:netrw_uid.">",'~'.expand("<slnum>"))
if exists("g:netrw_passwd")
" ask for password if one not previously entered
let s:netrw_passwd= g:netrw_passwd
@@ -3224,7 +3228,7 @@ fun! NetUserPass(...)
endif
endif
-" call Decho("host<".host.">")
+" call Decho("host<".host.">",'~'.expand("<slnum>"))
if exists("host")
if !exists('s:netrw_hup[host]')
let s:netrw_hup[host]= {}
@@ -3248,8 +3252,8 @@ fun! NetUserPass(...)
let s:netrw_hup[host].passwd = a:3
let g:netrw_uid = s:netrw_hup[host].uid
let s:netrw_passwd = s:netrw_hup[host].passwd
-" call Decho("set s:netrw_hup[".host."].uid <".s:netrw_hup[host].uid.">")
-" call Decho("set s:netrw_hup[".host."].passwd<".s:netrw_hup[host].passwd.">")
+" call Decho("set s:netrw_hup[".host."].uid <".s:netrw_hup[host].uid.">",'~'.expand("<slnum>"))
+" call Decho("set s:netrw_hup[".host."].passwd<".s:netrw_hup[host].passwd.">",'~'.expand("<slnum>"))
endif
" call Dret("NetUserPass : uid<".g:netrw_uid."> passwd<".s:netrw_passwd.">")
@@ -3264,9 +3268,9 @@ endfun
fun! s:ExplorePatHls(pattern)
" call Dfunc("s:ExplorePatHls(pattern<".a:pattern.">)")
let repat= substitute(a:pattern,'^**/\{1,2}','','')
-" call Decho("repat<".repat.">")
+" call Decho("repat<".repat.">",'~'.expand("<slnum>"))
let repat= escape(repat,'][.\')
-" call Decho("repat<".repat.">")
+" call Decho("repat<".repat.">",'~'.expand("<slnum>"))
let repat= '\<'.substitute(repat,'\*','\\(\\S\\+ \\)*\\S\\+','g').'\>'
" call Dret("s:ExplorePatHls repat<".repat.">")
return repat
@@ -3293,7 +3297,7 @@ fun! s:NetrwBookHistHandler(chg,curdir)
if a:chg == 0
" bookmark the current directory
-" call Decho("(user: <b>) bookmark the current directory")
+" call Decho("(user: <b>) bookmark the current directory",'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}")
call s:NetrwBookmark(0)
echo "bookmarked marked files"
@@ -3304,9 +3308,9 @@ fun! s:NetrwBookHistHandler(chg,curdir)
elseif a:chg == 1
" change to the bookmarked directory
-" call Decho("(user: <".v:count."gb>) change to the bookmarked directory")
+" call Decho("(user: <".v:count."gb>) change to the bookmarked directory",'~'.expand("<slnum>"))
if exists("g:netrw_bookmarklist[v:count-1]")
-" call Decho("(user: <".v:count."gb>) bookmarklist=".string(g:netrw_bookmarklist))
+" call Decho("(user: <".v:count."gb>) bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
exe "NetrwKeepj e ".fnameescape(g:netrw_bookmarklist[v:count-1])
else
echomsg "Sorry, bookmark#".v:count." doesn't exist!"
@@ -3316,12 +3320,12 @@ fun! s:NetrwBookHistHandler(chg,curdir)
" redraw!
let didwork= 0
" list user's bookmarks
-" call Decho("(user: <q>) list user's bookmarks")
+" call Decho("(user: <q>) list user's bookmarks",'~'.expand("<slnum>"))
if exists("g:netrw_bookmarklist")
-" call Decho('list '.len(g:netrw_bookmarklist).' bookmarks')
+" call Decho('list '.len(g:netrw_bookmarklist).' bookmarks','~'.expand("<slnum>"))
let cnt= 1
for bmd in g:netrw_bookmarklist
-" call Decho("Netrw Bookmark#".cnt.": ".g:netrw_bookmarklist[cnt-1])
+" call Decho("Netrw Bookmark#".cnt.": ".g:netrw_bookmarklist[cnt-1],'~'.expand("<slnum>"))
echo printf("Netrw Bookmark#%-2d: %s",cnt,g:netrw_bookmarklist[cnt-1])
let didwork = 1
let cnt = cnt + 1
@@ -3334,9 +3338,9 @@ fun! s:NetrwBookHistHandler(chg,curdir)
let histcnt = 0
if g:netrw_dirhistmax > 0
while ( first || cnt != g:netrw_dirhist_cnt )
-" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:netrw_dirhist_cnt)
+" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:netrw_dirhist_cnt,'~'.expand("<slnum>"))
if exists("g:netrw_dirhist_{cnt}")
-" call Decho("Netrw History#".histcnt.": ".g:netrw_dirhist_{cnt})
+" call Decho("Netrw History#".histcnt.": ".g:netrw_dirhist_{cnt},'~'.expand("<slnum>"))
echo printf("Netrw History#%-2d: %s",histcnt,g:netrw_dirhist_{cnt})
let didwork= 1
endif
@@ -3356,18 +3360,18 @@ fun! s:NetrwBookHistHandler(chg,curdir)
elseif a:chg == 3
" saves most recently visited directories (when they differ)
-" call Decho("(browsing) record curdir history")
+" call Decho("(browsing) record curdir history",'~'.expand("<slnum>"))
if !exists("g:netrw_dirhist_cnt") || !exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}") || g:netrw_dirhist_{g:netrw_dirhist_cnt} != a:curdir
if g:netrw_dirhistmax > 0
let g:netrw_dirhist_cnt = ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax
let g:netrw_dirhist_{g:netrw_dirhist_cnt} = a:curdir
endif
-" call Decho("save dirhist#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">")
+" call Decho("save dirhist#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">",'~'.expand("<slnum>"))
endif
elseif a:chg == 4
" u: change to the previous directory stored on the history list
-" call Decho("(user: <u>) chg to prev dir from history")
+" call Decho("(user: <u>) chg to prev dir from history",'~'.expand("<slnum>"))
if g:netrw_dirhistmax > 0
let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - v:count1 ) % g:netrw_dirhistmax
if g:netrw_dirhist_cnt < 0
@@ -3377,16 +3381,16 @@ fun! s:NetrwBookHistHandler(chg,curdir)
let g:netrw_dirhist_cnt= 0
endif
if exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}")
-" call Decho("changedir u#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">")
+" call Decho("changedir u#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
setl ma noro
-" call Decho("setl ma noro")
- sil! NetrwKeepj %d
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
+ sil! NetrwKeepj %d _
setl nomod
-" call Decho("setl nomod")
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("setl nomod",'~'.expand("<slnum>"))
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
-" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
+" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}),'~'.expand("<slnum>"))
exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
else
if g:netrw_dirhistmax > 0
@@ -3399,21 +3403,21 @@ fun! s:NetrwBookHistHandler(chg,curdir)
elseif a:chg == 5
" U: change to the subsequent directory stored on the history list
-" call Decho("(user: <U>) chg to next dir from history")
+" call Decho("(user: <U>) chg to next dir from history",'~'.expand("<slnum>"))
if g:netrw_dirhistmax > 0
let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + 1 ) % g:netrw_dirhistmax
if exists("g:netrw_dirhist_{g:netrw_dirhist_cnt}")
-" call Decho("changedir U#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">")
+" call Decho("changedir U#".g:netrw_dirhist_cnt."<".g:netrw_dirhist_{g:netrw_dirhist_cnt}.">",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
setl ma noro
- sil! NetrwKeepj %d
-" call Decho("removed all lines from buffer (%d)")
-" call Decho("setl nomod")
+ sil! NetrwKeepj %d _
+" call Decho("removed all lines from buffer (%d)",'~'.expand("<slnum>"))
+" call Decho("setl nomod",'~'.expand("<slnum>"))
setl nomod
-" call Decho("(set nomod) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("(set nomod) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
-" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
+" call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}),'~'.expand("<slnum>"))
exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
else
let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax
@@ -3428,18 +3432,22 @@ fun! s:NetrwBookHistHandler(chg,curdir)
endif
elseif a:chg == 6
+" call Decho("(user: <mB>) delete bookmark'd directory",'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}")
call s:NetrwBookmark(1)
echo "removed marked files from bookmarks"
else
" delete the v:count'th bookmark
-" call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">")
+ let iremove = v:count
+ let dremove = g:netrw_bookmarklist[iremove - 1]
+" call Decho("delete bookmark#".iremove."<".g:netrw_bookmarklist[iremove - 1].">",'~'.expand("<slnum>"))
call s:MergeBookmarks()
-" call Decho("remove g:netrw_bookmarklist[".(v:count-1)."]")
- NetrwKeepj call remove(g:netrw_bookmarklist,v:count-1)
- echo "removed current directory from bookmarks"
+" call Decho("remove g:netrw_bookmarklist[".(iremove-1)."]<".g:netrw_bookmarklist[(iremove-1)].">",'~'.expand("<slnum>"))
+ NetrwKeepj call remove(g:netrw_bookmarklist,iremove-1)
+ echo "removed ".dremove." from g:netrw_bookmarklist"
+" call Decho("g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
endif
-" call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist))
+" call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist),'~'.expand("<slnum>"))
endif
call s:NetrwBookmarkMenu()
call s:NetrwTgtMenu()
@@ -3461,14 +3469,14 @@ fun! s:NetrwBookHistRead()
if !exists("s:netrw_initbookhist")
let home = s:NetrwHome()
let savefile= home."/.netrwbook"
- if filereadable(savefile)
-" call Decho("sourcing .netrwbook")
+ if filereadable(s:NetrwFile(savefile))
+" call Decho("sourcing .netrwbook",'~'.expand("<slnum>"))
exe "keepalt NetrwKeepj so ".savefile
endif
if g:netrw_dirhistmax > 0
let savefile= home."/.netrwhist"
- if filereadable(savefile)
-" call Decho("sourcing .netrwhist")
+ if filereadable(s:NetrwFile(savefile))
+" call Decho("sourcing .netrwhist",'~'.expand("<slnum>"))
exe "keepalt NetrwKeepj so ".savefile
endif
let s:netrw_initbookhist= 1
@@ -3500,7 +3508,7 @@ fun! s:NetrwBookHistSave()
setl nocin noai noci magic nospell nohid wig= noaw
setl ma noro write
if exists("+acd") | setl noacd | endif
- sil! NetrwKeepj keepalt %d
+ sil! NetrwKeepj keepalt %d _
" save .netrwhist -- no attempt to merge
sil! keepalt file .netrwhist
@@ -3514,12 +3522,12 @@ fun! s:NetrwBookHistSave()
endwhile
exe "sil! w! ".savefile
- sil NetrwKeepj %d
+ sil NetrwKeepj %d _
if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != []
" merge and write .netrwbook
let savefile= s:NetrwHome()."/.netrwbook"
- if filereadable(savefile)
+ if filereadable(s:NetrwFile(savefile))
let booklist= deepcopy(g:netrw_bookmarklist)
exe "sil NetrwKeepj keepalt so ".savefile
for bdm in booklist
@@ -3546,10 +3554,12 @@ endfun
" list of the contents of a local or remote directory. It is assumed that the
" g:netrw_list_cmd has a string, USEPORT HOSTNAME, that needs to be substituted
" with the requested remote hostname first.
+" Often called via: Explore/e dirname/etc -> netrw#LocalBrowseCheck() -> s:NetrwBrowse()
fun! s:NetrwBrowse(islocal,dirname)
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%")."> win#".winnr())
-" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
+" call Decho("modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dredir("ls!")
" save alternate-file's filename if w:netrw_rexlocal doesn't exist
@@ -3564,7 +3574,7 @@ fun! s:NetrwBrowse(islocal,dirname)
endif
" s:NetrwBrowse : simplify the dirname (especially for ".."s in dirnames) {{{3
- if a:dirname !~ '^\a\+://'
+ if a:dirname !~ '^\a\{3,}://'
let dirname= simplify(a:dirname)
else
let dirname= a:dirname
@@ -3572,7 +3582,7 @@ fun! s:NetrwBrowse(islocal,dirname)
if exists("s:netrw_skipbrowse")
unlet s:netrw_skipbrowse
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." filename<".expand("%")."> win#".winnr()." ft<".&ft.">")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." filename<".expand("%")."> win#".winnr()." ft<".&ft.">",'~'.expand("<slnum>"))
" call Dret("s:NetrwBrowse : s:netrw_skipbrowse existed")
return
endif
@@ -3590,54 +3600,54 @@ fun! s:NetrwBrowse(islocal,dirname)
endif
" s:NetrwBrowse : save options: {{{3
- call s:NetrwOptionSave("w:")
+ call s:NetrwOptionSave("w:")
" s:NetrwBrowse : re-instate any marked files {{{3
if exists("s:netrwmarkfilelist_{bufnr('%')}")
-" call Decho("clearing marked files")
+" call Decho("clearing marked files",'~'.expand("<slnum>"))
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
endif
if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep
" s:NetrwBrowse : set up "safe" options for local directory/file {{{3
-" call Decho("handle w:netrw_acdkeep:")
-" call Decho("NetrwKeepj lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
+" call Decho("handle w:netrw_acdkeep:",'~'.expand("<slnum>"))
+" call Decho("NetrwKeepj lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")",'~'.expand("<slnum>"))
call s:NetrwLcd(dirname)
call s:NetrwSafeOptions()
-" call Decho("getcwd<".getcwd().">")
+" call Decho("getcwd<".getcwd().">",'~'.expand("<slnum>"))
elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"'
" s:NetrwBrowse : remote regular file handler {{{3
-" call Decho("handle remote regular file: dirname<".dirname.">")
+" call Decho("handle remote regular file: dirname<".dirname.">",'~'.expand("<slnum>"))
if bufname(dirname) != ""
-" call Decho("edit buf#".bufname(dirname)." in win#".winnr())
+" call Decho("edit buf#".bufname(dirname)." in win#".winnr(),'~'.expand("<slnum>"))
exe "NetrwKeepj b ".bufname(dirname)
else
" attempt transfer of remote regular file
-" call Decho("attempt transfer as regular file<".dirname.">")
+" call Decho("attempt transfer as regular file<".dirname.">",'~'.expand("<slnum>"))
" remove any filetype indicator from end of dirname, except for the
" "this is a directory" indicator (/).
" There shouldn't be one of those here, anyway.
let path= substitute(dirname,'[*=@|]\r\=$','','e')
-" call Decho("new path<".path.">")
+" call Decho("new path<".path.">",'~'.expand("<slnum>"))
call s:RemotePathAnalysis(dirname)
" s:NetrwBrowse : remote-read the requested file into current buffer {{{3
call s:NetrwEnew(dirname)
call s:NetrwSafeOptions()
setl ma noro
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
let b:netrw_curdir = dirname
let url = s:method."://".((s:user == "")? "" : s:user."@").s:machine.(s:port ? ":".s:port : "")."/".s:path
-" call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")")
+" call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")",'~'.expand("<slnum>"))
exe "sil! NetrwKeepj keepalt file ".fnameescape(url)
exe "sil! NetrwKeepj keepalt doau BufReadPre ".fnameescape(s:fname)
sil call netrw#NetRead(2,url)
" netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
-" call Decho("url<".url.">")
-" call Decho("s:path<".s:path.">")
-" call Decho("s:fname<".s:fname.">")
+" call Decho("url<".url.">",'~'.expand("<slnum>"))
+" call Decho("s:path<".s:path.">",'~'.expand("<slnum>"))
+" call Decho("s:fname<".s:fname.">",'~'.expand("<slnum>"))
if s:path =~ '.bz2'
exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','',''))
elseif s:path =~ '.gz'
@@ -3652,9 +3662,9 @@ fun! s:NetrwBrowse(islocal,dirname)
" s:NetrwBrowse : save certain window-oriented variables into buffer-oriented variables {{{3
call s:SetBufWinVars()
call s:NetrwOptionRestore("w:")
-" call Decho("setl ma nomod")
+" call Decho("setl ma nomod",'~'.expand("<slnum>"))
setl ma nomod noro
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwBrowse : file<".s:fname.">")
return
@@ -3672,29 +3682,30 @@ fun! s:NetrwBrowse(islocal,dirname)
NetrwKeepj call s:NetrwMenu(1)
" get/set-up buffer {{{3
-" call Decho("saving position across a buffer refresh")
+" call Decho("saving position across a buffer refresh",'~'.expand("<slnum>"))
let svpos = netrw#SavePosn()
let reusing= s:NetrwGetBuffer(a:islocal,dirname)
+
" maintain markfile highlighting
if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
-" call Decho("bufnr(%)=".bufnr('%'))
-" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/")
+" call Decho("bufnr(%)=".bufnr('%'),'~'.expand("<slnum>"))
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/",'~'.expand("<slnum>"))
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
else
-" call Decho("2match none")
+" call Decho("2match none",'~'.expand("<slnum>"))
2match none
endif
if reusing && line("$") > 1
call s:NetrwOptionRestore("w:")
-" call Decho("setl noma nomod nowrap")
+" call Decho("setl noma nomod nowrap",'~'.expand("<slnum>"))
setl noma nomod nowrap
-" call Decho("(set noma nomod nowrap) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("(set noma nomod nowrap) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwBrowse : re-using not-cleared buffer")
return
endif
" set b:netrw_curdir to the new directory name {{{3
-" call Decho("set b:netrw_curdir to the new directory name<".dirname."> (buf#".bufnr("%").")")
+" call Decho("set b:netrw_curdir to the new directory name<".dirname."> (buf#".bufnr("%").")",'~'.expand("<slnum>"))
let b:netrw_curdir= dirname
if b:netrw_curdir =~ '[/\\]$'
let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e')
@@ -3715,21 +3726,21 @@ fun! s:NetrwBrowse(islocal,dirname)
if !a:islocal && b:netrw_curdir !~ '/$'
let b:netrw_curdir= b:netrw_curdir.'/'
endif
-" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
+" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
" ------------
" (local only) {{{3
" ------------
if a:islocal
-" call Decho("local only:")
+" call Decho("local only:",'~'.expand("<slnum>"))
" Set up ShellCmdPost handling. Append current buffer to browselist
call s:LocalFastBrowser()
" handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3
if !g:netrw_keepdir
-" call Decho("handle g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd)
-" call Decho("l:acd".(exists("&l:acd")? "=".&l:acd : " doesn't exist"))
+" call Decho("handle g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("<slnum>"))
+" call Decho("l:acd".(exists("&l:acd")? "=".&l:acd : " doesn't exist"),'~'.expand("<slnum>"))
if !exists("&l:acd") || !&l:acd
call s:NetrwLcd(b:netrw_curdir)
endif
@@ -3739,23 +3750,23 @@ fun! s:NetrwBrowse(islocal,dirname)
" remote handling: {{{3
" --------------------------------
else
-" call Decho("remote only:")
+" call Decho("remote only:",'~'.expand("<slnum>"))
" analyze dirname and g:netrw_list_cmd {{{3
-" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> dirname<".dirname.">")
+" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> dirname<".dirname.">",'~'.expand("<slnum>"))
if dirname =~ "^NetrwTreeListing\>"
let dirname= b:netrw_curdir
-" call Decho("(dirname was <NetrwTreeListing>) dirname<".dirname.">")
+" call Decho("(dirname was <NetrwTreeListing>) dirname<".dirname.">",'~'.expand("<slnum>"))
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
let dirname= substitute(b:netrw_curdir,'\\','/','g')
if dirname !~ '/$'
let dirname= dirname.'/'
endif
let b:netrw_curdir = dirname
-" call Decho("(liststyle is TREELIST) dirname<".dirname.">")
+" call Decho("(liststyle is TREELIST) dirname<".dirname.">",'~'.expand("<slnum>"))
else
let dirname = substitute(dirname,'\\','/','g')
-" call Decho("(normal) dirname<".dirname.">")
+" call Decho("(normal) dirname<".dirname.">",'~'.expand("<slnum>"))
endif
let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
@@ -3764,14 +3775,14 @@ fun! s:NetrwBrowse(islocal,dirname)
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
endif
NetrwKeepj call s:NetrwOptionRestore("w:")
-" call Decho("setl noma nomod nowrap")
+" call Decho("setl noma nomod nowrap",'~'.expand("<slnum>"))
setl noma nomod nowrap
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwBrowse : badly formatted dirname<".dirname.">")
return
endif
let b:netrw_curdir= dirname
-" call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)")
+" call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)",'~'.expand("<slnum>"))
endif " (additional remote handling)
" -----------------------
@@ -3780,29 +3791,82 @@ fun! s:NetrwBrowse(islocal,dirname)
NetrwKeepj call s:NetrwMaps(a:islocal)
NetrwKeepj call s:NetrwCommands(a:islocal)
NetrwKeepj call s:PerformListing(a:islocal)
+
+ " If there is a rexposn: restore position with rexposn
+ " Otherwise : set rexposn
+ if exists("s:rexposn_".bufnr("%"))
+ NetrwKeepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+ else
+ NetrwKeepj call s:SetRexDir(a:islocal,b:netrw_curdir)
+ endif
if v:version >= 700 && has("balloon_eval") && &beval == 0 && &l:bexpr == "" && !exists("g:netrw_nobeval")
let &l:bexpr= "netrw#BalloonHelp()"
-" call Decho("set up balloon help: l:bexpr=".&l:bexpr)
+" call Decho("set up balloon help: l:bexpr=".&l:bexpr,'~'.expand("<slnum>"))
setl beval
endif
call s:NetrwOptionRestore("w:")
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
- " restore position and jumplist entry
- if !reusing
-" call Decho("restoring position across buffer refresh")
+ " restore position
+ if reusing
+" call Decho("reusing=".reusing.": restoring position across buffer refresh",'~'.expand("<slnum>"))
call netrw#RestorePosn(svpos)
endif
" The s:LocalBrowseRefresh() function is called by an autocmd
" installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed).
" However, s:NetrwBrowse() causes the FocusGained event to fire the firstt time.
-
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwBrowse : did PerformListing ft<".&ft.">")
return
endfun
" ---------------------------------------------------------------------
+" s:NetrwFile: because of g:netrw_keepdir, isdirectory(), type(), etc may or {{{2
+" may not apply correctly; ie. netrw's idea of the current directory may
+" differ from vim's. This function insures that netrw's idea of the current
+" directory is used.
+fun! s:NetrwFile(fname)
+" call Dfunc("s:NetrwFile(fname<".a:fname.">)")
+
+ if g:netrw_keepdir
+ " vim's idea of the current directory possibly may differ from netrw's
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+ endif
+
+ if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if a:fname =~ '^\' || a:fname =~ '^\a:\'
+ " windows, but full path given
+ let ret= a:fname
+" call Decho("windows+full path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ else
+ " windows, relative path given
+ let ret= s:ComposePath(b:netrw_curdir,a:fname)
+" call Decho("windows+rltv path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ endif
+
+ elseif a:fname =~ '^/'
+ " not windows, full path given
+ let ret= a:fname
+" call Decho("unix+full path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ else
+ " not windows, relative path given
+ let ret= s:ComposePath(b:netrw_curdir,a:fname)
+" call Decho("unix+rltv path: isdirectory(".a:fname.")",'~'.expand("<slnum>"))
+ endif
+ else
+ " vim and netrw agree on the current directory
+ let ret= a:fname
+" call Decho("vim and netrw agree on current directory (g:netrw_keepdir=".g:netrw_keepdir.")",'~'.expand("<slnum>"))
+ endif
+
+" call Dret("s:NetrwFile ".ret)
+ return ret
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwFileInfo: supports qf (query for file information) {{{2
fun! s:NetrwFileInfo(islocal,fname)
" call Dfunc("s:NetrwFileInfo(islocal=".a:islocal." fname<".a:fname.">) b:netrw_curdir<".b:netrw_curdir.">")
@@ -3811,40 +3875,34 @@ fun! s:NetrwFileInfo(islocal,fname)
if (has("unix") || has("macunix")) && executable("/bin/ls")
if getline(".") == "../"
- echo system("/bin/ls -lsad ".shellescape(".."))
-" call Decho("#1: echo system(/bin/ls -lsad ".shellescape(..).")")
+ echo system("/bin/ls -lsad ".s:ShellEscape(".."))
+" call Decho("#1: echo system(/bin/ls -lsad ".s:ShellEscape(..).")",'~'.expand("<slnum>"))
elseif w:netrw_liststyle == s:TREELIST && getline(".") !~ '^'.s:treedepthstring
- echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir))
-" call Decho("#2: echo system(/bin/ls -lsad ".shellescape(b:netrw_curdir).")")
+ echo system("/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir))
+" call Decho("#2: echo system(/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir).")",'~'.expand("<slnum>"))
elseif exists("b:netrw_curdir")
- if b:netrw_curdir =~ '/$'
- echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir.a:fname))
-" call Decho("#3: echo system(/bin/ls -lsad ".shellescape(b:netrw_curdir.a:fname).")")
-
- else
- echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir."/".a:fname))
-" call Decho("#4: echo system(/bin/ls -lsad ".shellescape(b:netrw_curdir."/".a:fname).")")
- endif
+ echo system("/bin/ls -lsad ".s:ShellEscape(s:ComposePath(b:netrw_curdir,a:fname)))
+" call Decho("#3: echo system(/bin/ls -lsad ".s:ShellEscape(b:netrw_curdir.a:fname).")",'~'.expand("<slnum>"))
else
-" call Decho('using ls '.a:fname." using cwd<".getcwd().">")
- echo system("/bin/ls -lsad ".shellescape(a:fname))
-" call Decho("#5: echo system(/bin/ls -lsad ".shellescape(a:fname).")")
+" call Decho('using ls '.a:fname." using cwd<".getcwd().">",'~'.expand("<slnum>"))
+ echo system("/bin/ls -lsad ".s:ShellEscape(s:NetrwFile(a:fname)))
+" call Decho("#5: echo system(/bin/ls -lsad ".s:ShellEscape(a:fname).")",'~'.expand("<slnum>"))
endif
else
" use vim functions to return information about file below cursor
-" call Decho("using vim functions to query for file info")
- if !isdirectory(a:fname) && !filereadable(a:fname) && a:fname =~ '[*@/]'
+" call Decho("using vim functions to query for file info",'~'.expand("<slnum>"))
+ if !isdirectory(s:NetrwFile(a:fname)) && !filereadable(s:NetrwFile(a:fname)) && a:fname =~ '[*@/]'
let fname= substitute(a:fname,".$","","")
else
let fname= a:fname
endif
- let t = getftime(fname)
- let sz = getfsize(fname)
- echo a:fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname))
-" call Decho("fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname)))
+ let t = getftime(s:NetrwFile(fname))
+ let sz = getfsize(s:NetrwFile(fname))
+ echo a:fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(s:NetrwFile(fname)))
+" call Decho("fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname)),'~'.expand("<slnum>"))
endif
else
echo "sorry, \"qf\" not supported yet for remote files"
@@ -3856,45 +3914,46 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwGetBuffer: {{{2
" returns 0=cleared buffer
-" 1=re-used buffer
+" 1=re-used buffer (buffer not cleared)
fun! s:NetrwGetBuffer(islocal,dirname)
" call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
let dirname= a:dirname
" re-use buffer if possible {{{3
-" call Decho("--re-use a buffer if possible--")
+" call Decho("--re-use a buffer if possible--",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" find NetrwTreeList buffer if there is one
-" call Decho("case liststyle=treelist: find NetrwTreeList buffer if there is one")
+" call Decho("case liststyle=treelist: find NetrwTreeList buffer if there is one",'~'.expand("<slnum>"))
if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0
-" call Decho(" re-using w:netrw_treebufnr=".w:netrw_treebufnr)
+" call Decho(" re-using w:netrw_treebufnr=".w:netrw_treebufnr,'~'.expand("<slnum>"))
let eikeep= &ei
setl ei=all
- exe "sil! noswapfile keepalt b ".w:netrw_treebufnr
+ exe "sil! keepj noswapfile keepalt b ".w:netrw_treebufnr
let &ei= eikeep
setl ma
- sil! NetrwKeepj %d
-" call Decho("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)
+ sil! NetrwKeepj %d _
+" call Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dret("s:NetrwGetBuffer 0<buffer cleared> : bufnum#".w:netrw_treebufnr."<NetrwTreeListing>")
return 0
endif
let bufnum= -1
-" call Decho(" liststyle=TREE but w:netrw_treebufnr doesn't exist")
+" call Decho(" liststyle=TREE but w:netrw_treebufnr doesn't exist",'~'.expand("<slnum>"))
else
" find buffer number of buffer named precisely the same as dirname {{{3
-" call Decho("case listtyle not treelist: find buffer numnber of buffer named precisely the same as dirname--")
+" call Decho("case listtyle not treelist: find buffer numnber of buffer named precisely the same as dirname--",'~'.expand("<slnum>"))
" call Dredir("(NetrwGetBuffer) ls!","ls!")
" get dirname and associated buffer number
let bufnum = bufnr(escape(dirname,'\'))
-" call Decho(" find buffer<".dirname.">'s number ")
-" call Decho(" bufnr(dirname<".escape(dirname,'\').">)=".bufnum)
+" call Decho(" find buffer<".dirname.">'s number ",'~'.expand("<slnum>"))
+" call Decho(" bufnr(dirname<".escape(dirname,'\').">)=".bufnum,'~'.expand("<slnum>"))
if bufnum < 0 && dirname !~ '/$'
" try appending a trailing /
-" call Decho(" try appending a trailing / to dirname<".dirname.">")
+" call Decho(" try appending a trailing / to dirname<".dirname.">",'~'.expand("<slnum>"))
let bufnum= bufnr(escape(dirname.'/','\'))
if bufnum > 0
let dirname= dirname.'/'
@@ -3903,43 +3962,43 @@ fun! s:NetrwGetBuffer(islocal,dirname)
if bufnum < 0 && dirname =~ '/$'
" try removing a trailing /
-" call Decho(" try removing a trailing / from dirname<".dirname.">")
+" call Decho(" try removing a trailing / from dirname<".dirname.">",'~'.expand("<slnum>"))
let bufnum= bufnr(escape(substitute(dirname,'/$','',''),'\'))
if bufnum > 0
let dirname= substitute(dirname,'/$','','')
endif
endif
-" call Decho(" findbuf1: bufnum=bufnr('".dirname."')=".bufnum." bufname(".bufnum.")<".bufname(bufnum)."> (initial)")
+" call Decho(" findbuf1: bufnum=bufnr('".dirname."')=".bufnum." bufname(".bufnum.")<".bufname(bufnum)."> (initial)",'~'.expand("<slnum>"))
" note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches)
if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.'
" handle approximate matches
-" call Decho(" handling approx match: bufnum#".bufnum.">0 AND bufname<".bufname(bufnum).">!=dirname<".dirname."> AND bufname(".bufnum.")!='.'")
+" call Decho(" handling approx match: bufnum#".bufnum.">0 AND bufname<".bufname(bufnum).">!=dirname<".dirname."> AND bufname(".bufnum.")!='.'",'~'.expand("<slnum>"))
let ibuf = 1
let buflast = bufnr("$")
-" call Decho(" findbuf2: buflast=bufnr($)=".buflast)
+" call Decho(" findbuf2: buflast=bufnr($)=".buflast,'~'.expand("<slnum>"))
while ibuf <= buflast
let bname= substitute(bufname(ibuf),'\\','/','g')
let bname= substitute(bname,'.\zs/$','','')
-" call Decho(" findbuf3: while [ibuf=",ibuf."]<=[buflast=".buflast."]: dirname<".dirname."> bname=bufname(".ibuf.")<".bname.">")
+" call Decho(" findbuf3: while [ibuf=",ibuf."]<=[buflast=".buflast."]: dirname<".dirname."> bname=bufname(".ibuf.")<".bname.">",'~'.expand("<slnum>"))
if bname != '' && dirname =~ '/'.bname.'/\=$' && dirname !~ '^/'
" bname is not empty
" dirname ends with bname,
" dirname doesn't start with /, so its not a absolute path
-" call Decho(" findbuf3a: passes test 1 : dirname<".dirname.'> =~ /'.bname.'/\=$ && dirname !~ ^/')
+" call Decho(" findbuf3a: passes test 1 : dirname<".dirname.'> =~ /'.bname.'/\=$ && dirname !~ ^/','~'.expand("<slnum>"))
break
endif
if bname =~ '^'.dirname.'/\=$'
" bname begins with dirname
-" call Decho(' findbuf3b: passes test 2 : bname<'.bname.'>=~^'.dirname.'/\=$')
+" call Decho(' findbuf3b: passes test 2 : bname<'.bname.'>=~^'.dirname.'/\=$','~'.expand("<slnum>"))
break
endif
if dirname =~ '^'.bname.'/$'
-" call Decho(' findbuf3c: passes test 3 : dirname<'.dirname.'>=~^'.bname.'/$')
+" call Decho(' findbuf3c: passes test 3 : dirname<'.dirname.'>=~^'.bname.'/$','~'.expand("<slnum>"))
break
endif
if bname != '' && dirname =~ '/'.bname.'$' && bname == bufname("%") && line("$") == 1
-" call Decho(' findbuf3d: passes test 4 : dirname<'.dirname.'>=~ /'.bname.'$')
+" call Decho(' findbuf3d: passes test 4 : dirname<'.dirname.'>=~ /'.bname.'$','~'.expand("<slnum>"))
break
endif
let ibuf= ibuf + 1
@@ -3949,89 +4008,93 @@ fun! s:NetrwGetBuffer(islocal,dirname)
else
let bufnum= ibuf
endif
-" call Decho(" findbuf4: bufnum=".bufnum." (ibuf=".ibuf." buflast=".buflast.")")
+" call Decho(" findbuf4: bufnum=".bufnum." (ibuf=".ibuf." buflast=".buflast.")",'~'.expand("<slnum>"))
endif
endif
" get enew buffer and name it -or- re-use buffer {{{3
-" call Decho(" get enew buffer and name it OR re-use buffer")
- sil! NetrwKeepj keepalt mark '
- if bufnum < 0 || !bufexists(bufnum)
-" call Decho("--get enew buffer and name it (bufnum#".bufnum."<0 OR bufexists(".bufnum.")=".bufexists(bufnum)."==0)")
+ if bufnum < 0 || !bufexists(bufnum) " get enew buffer and name it
+" call Decho("--get enew buffer and name it (bufnum#".bufnum."<0 OR bufexists(".bufnum.")=".bufexists(bufnum)."==0)",'~'.expand("<slnum>"))
call s:NetrwEnew(dirname)
-" call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)")
+" call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)",'~'.expand("<slnum>"))
" name the buffer
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" Got enew buffer; transform into a NetrwTreeListing
-" call Decho("--transform enew buffer#".bufnr("%")." into a NetrwTreeListing --")
+" call Decho("--transform enew buffer#".bufnr("%")." into a NetrwTreeListing --",'~'.expand("<slnum>"))
if !exists("s:netrw_treelistnum")
let s:netrw_treelistnum= 1
else
let s:netrw_treelistnum= s:netrw_treelistnum + 1
endif
let w:netrw_treebufnr= bufnr("%")
-" call Decho(" exe sil! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum))
+" call Decho(" exe sil! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum),'~'.expand("<slnum>"))
exe 'sil! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum)
setl bt=nofile noswf
nnoremap <silent> <buffer> [ :sil call <SID>TreeListMove('[')<cr>
nnoremap <silent> <buffer> ] :sil call <SID>TreeListMove(']')<cr>
nnoremap <silent> <buffer> [[ :sil call <SID>TreeListMove('[')<cr>
nnoremap <silent> <buffer> ]] :sil call <SID>TreeListMove(']')<cr>
-" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr)
+" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr,'~'.expand("<slnum>"))
else
" let v:errmsg = "" " Decho
let escdirname = fnameescape(dirname)
-" call Decho(" errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">")
-" call Decho(' exe sil! keepalt file '.escdirname)
+" call Decho(" errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">",'~'.expand("<slnum>"))
+" call Decho(' exe sil! keepalt file '.escdirname,'~'.expand("<slnum>"))
" let v:errmsg= "" " Decho
- exe 'sil! keepalt file '.escdirname
-" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
+ exe 'sil! keepj keepalt file '.escdirname
+" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">",'~'.expand("<slnum>"))
endif
-" call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">")
+" call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
else " Re-use the buffer
-" call Decho("--re-use buffer#".bufnum." (bufnum#".bufnum.">=0 AND bufexists(".bufnum.")=".bufexists(bufnum)."!=0)")
+" call Decho("--re-use buffer#".bufnum." (bufnum#".bufnum.">=0 AND bufexists(".bufnum.")=".bufexists(bufnum)."!=0)",'~'.expand("<slnum>"))
let eikeep= &ei
setl ei=all
if getline(2) =~ '^" Netrw Directory Listing'
-" call Decho(" getline(2)<".getline(2).'> matches "Netrw Directory Listing" : using keepalt b '.bufnum)
- exe "sil! noswapfile keepalt b ".bufnum
+" call Decho(" getline(2)<".getline(2).'> matches "Netrw Directory Listing" : using keepalt b '.bufnum,'~'.expand("<slnum>"))
+ exe "sil! NetrwKeepj noswapfile keepalt b ".bufnum
else
-" call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum)
- exe "sil! noswapfile keepalt b ".bufnum
+" call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum,'~'.expand("<slnum>"))
+ exe "sil! NetrwKeepj noswapfile keepalt b ".bufnum
endif
+" call Decho(" line($)=".line("$"),'~'.expand("<slnum>"))
if bufname("%") == '.'
-" call Decho("exe sil! keepalt file ".fnameescape(getcwd()))
- exe "sil! keepalt file ".fnameescape(getcwd())
+" call Decho("exe sil! keepalt file ".fnameescape(getcwd()),'~'.expand("<slnum>"))
+ exe "sil! NetrwKeepj keepalt file ".fnameescape(getcwd())
endif
let &ei= eikeep
- if line("$") <= 1
+ if line("$") <= 1 && getline(1) == ""
+ " empty buffer
NetrwKeepj call s:NetrwListSettings(a:islocal)
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dret("s:NetrwGetBuffer 0<buffer empty> : re-using buffer#".bufnr("%").", but its empty, so refresh it")
return 0
elseif g:netrw_fastbrowse == 0 || (a:islocal && g:netrw_fastbrowse == 1)
-" call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse." a:islocal=".a:islocal.": clear buffer")
+" call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse." a:islocal=".a:islocal.": clear buffer",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwListSettings(a:islocal)
- sil NetrwKeepj %d
-" call Decho("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)
+ sil NetrwKeepj %d _
+" call Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but refreshing due to g:netrw_fastbrowse=".g:netrw_fastbrowse)
return 0
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
-" call Decho("--re-use tree listing--")
-" call Decho(" clear buffer<".expand("%")."> with :%d")
- sil NetrwKeepj %d
+" call Decho("--re-use tree listing--",'~'.expand("<slnum>"))
+" call Decho(" clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+ sil NetrwKeepj %d _
NetrwKeepj call s:NetrwListSettings(a:islocal)
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh")
return 0
else
-" call Decho("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:NetrwGetBuffer 1<buffer not cleared> : buf#".bufnr("%"))
+" call Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+" call Dret("s:NetrwGetBuffer 1<buffer not cleared>")
return 1
endif
endif
@@ -4041,19 +4104,20 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" slow 0 D D Deleting a buffer implies it will not be re-used (slow)
" med 1 D H
" fast 2 H H
-" call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--")
+" call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--",'~'.expand("<slnum>"))
let fname= expand("%")
NetrwKeepj call s:NetrwListSettings(a:islocal)
-" call Decho("exe sil! keepalt file ".fnameescape(fname))
+" call Decho("exe sil! keepalt file ".fnameescape(fname),'~'.expand("<slnum>"))
exe "sil! NetrwKeepj keepalt file ".fnameescape(fname)
" delete all lines from buffer {{{3
-" call Decho("--delete all lines from buffer--")
-" call Decho(" clear buffer<".expand("%")."> with :%d")
- sil! keepalt NetrwKeepj %d
+" call Decho("--delete all lines from buffer--",'~'.expand("<slnum>"))
+" call Decho(" clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+ sil! keepalt NetrwKeepj %d _
-" call Decho("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:NetrwGetBuffer 0<cleared buffer> : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%"))
+" call Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+" call Dret("s:NetrwGetBuffer 0<cleared buffer>")
return 0
endfun
@@ -4077,7 +4141,11 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwGetWord: it gets the directory/file named under the cursor {{{2
fun! s:NetrwGetWord()
-" call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".s:ShowStyle()." virtcol=".virtcol("."))
+" call Dfunc("s:NetrwGetWord() liststyle=".s:ShowStyle()." virtcol=".virtcol("."))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+ let keepsol= &l:sol
+ setl nosol
+
call s:UseBufWinVars()
" insure that w:netrw_liststyle is set up
@@ -4087,12 +4155,12 @@ fun! s:NetrwGetWord()
else
let w:netrw_liststyle= s:THINLIST
endif
-" "call Decho("w:netrw_liststyle=".w:netrw_liststyle)
+" call Decho("w:netrw_liststyle=".w:netrw_liststyle,'~'.expand("<slnum>"))
endif
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
" Active Banner support
-" "call Decho("active banner handling")
+" call Decho("active banner handling",'~'.expand("<slnum>"))
NetrwKeepj norm! 0
let dirname= "./"
let curline= getline('.')
@@ -4120,35 +4188,35 @@ fun! s:NetrwGetWord()
endif
elseif w:netrw_liststyle == s:THINLIST
-" "call Decho("thin column handling")
+" call Decho("thin column handling",'~'.expand("<slnum>"))
NetrwKeepj norm! 0
let dirname= substitute(getline('.'),'\t -->.*$','','')
elseif w:netrw_liststyle == s:LONGLIST
-" "call Decho("long column handling")
+" call Decho("long column handling",'~'.expand("<slnum>"))
NetrwKeepj norm! 0
let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
elseif w:netrw_liststyle == s:TREELIST
-" "call Decho("treelist handling")
+" call Decho("treelist handling",'~'.expand("<slnum>"))
let dirname= substitute(getline('.'),'^\('.s:treedepthstring.'\)*','','e')
let dirname= substitute(dirname,'\t -->.*$','','')
else
-" "call Decho("obtain word from wide listing")
+" call Decho("obtain word from wide listing",'~'.expand("<slnum>"))
let dirname= getline('.')
if !exists("b:netrw_cpf")
let b:netrw_cpf= 0
exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
call histdel("/",-1)
-" "call Decho("computed cpf=".b:netrw_cpf)
+" "call Decho("computed cpf=".b:netrw_cpf,'~'.expand("<slnum>"))
endif
-" "call Decho("buf#".bufnr("%")."<".bufname("%").">")
+" call Decho("buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
-" "call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt)
-" "call Decho("1: dirname<".dirname.">")
+" call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
+" call Decho("1: dirname<".dirname.">",'~'.expand("<slnum>"))
if filestart == 0
NetrwKeepj norm! 0ma
else
@@ -4165,9 +4233,9 @@ fun! s:NetrwGetWord()
endif
let dirname = @a
let @a = rega
-" "call Decho("2: dirname<".dirname.">")
+" call Decho("2: dirname<".dirname.">",'~'.expand("<slnum>"))
let dirname= substitute(dirname,'\s\+$','','e')
-" "call Decho("3: dirname<".dirname.">")
+" call Decho("3: dirname<".dirname.">",'~'.expand("<slnum>"))
endif
" symlinks are indicated by a trailing "@". Remove it before further processing.
@@ -4176,6 +4244,8 @@ fun! s:NetrwGetWord()
" executables are indicated by a trailing "*". Remove it before further processing.
let dirname= substitute(dirname,"\*$","","")
+ let &l:sol= keepsol
+
" call Dret("s:NetrwGetWord <".dirname.">")
return dirname
endfun
@@ -4184,17 +4254,17 @@ endfun
" s:NetrwListSettings: make standard settings for a netrw listing {{{2
fun! s:NetrwListSettings(islocal)
" call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")")
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
let fname= bufname("%")
-" " call Decho("(NetrwListSettings) setl bt=nofile nobl ma nonu nowrap noro nornu")
+" " call Decho("(NetrwListSettings) setl bt=nofile nobl ma nonu nowrap noro nornu",'~'.expand("<slnum>"))
setl bt=nofile nobl ma nonu nowrap noro nornu
-" call Decho("(NetrwListSettings) exe sil! keepalt file ".fnameescape(fname))
+" call Decho("(NetrwListSettings) exe sil! keepalt file ".fnameescape(fname),'~'.expand("<slnum>"))
exe "sil! keepalt file ".fnameescape(fname)
if g:netrw_use_noswf
setl noswf
endif
" call Dredir("ls!")
-" call Decho("(NetrwListSettings) exe setl ts=".(g:netrw_maxfilenamelen+1))
+" call Decho("(NetrwListSettings) exe setl ts=".(g:netrw_maxfilenamelen+1),'~'.expand("<slnum>"))
exe "setl ts=".(g:netrw_maxfilenamelen+1)
setl isk+=.,~,-
if g:netrw_fastbrowse > a:islocal
@@ -4202,7 +4272,7 @@ fun! s:NetrwListSettings(islocal)
else
setl bh=delete
endif
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
" call Dret("s:NetrwListSettings")
endfun
@@ -4218,27 +4288,27 @@ fun! s:NetrwListStyle(islocal)
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
let svpos = netrw#SavePosn()
let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST
-" call Decho("fname<".fname.">")
-" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle)
-" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
+" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle,'~'.expand("<slnum>"))
+" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">",'~'.expand("<slnum>"))
if w:netrw_liststyle == s:THINLIST
" use one column listing
-" call Decho("use one column list")
+" call Decho("use one column list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
elseif w:netrw_liststyle == s:LONGLIST
" use long list
-" call Decho("use long list")
+" call Decho("use long list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = g:netrw_list_cmd." -l"
elseif w:netrw_liststyle == s:WIDELIST
" give wide list
-" call Decho("use wide list")
+" call Decho("use wide list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
elseif w:netrw_liststyle == s:TREELIST
-" call Decho("use tree list")
+" call Decho("use tree list",'~'.expand("<slnum>"))
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
else
@@ -4248,18 +4318,18 @@ fun! s:NetrwListStyle(islocal)
let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
endif
setl ma noro
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
" clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh
-" call Decho("clear buffer<".expand("%")."> with :%d")
- sil! NetrwKeepj %d
+" call Decho("clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+ sil! NetrwKeepj %d _
" following prevents tree listing buffer from being marked "modified"
-" call Decho("setl nomod")
+" call Decho("setl nomod",'~'.expand("<slnum>"))
setl nomod
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" refresh the listing
-" call Decho("refresh the listing")
+" call Decho("refresh the listing",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
NetrwKeepj call s:NetrwCursor()
@@ -4287,7 +4357,7 @@ fun! s:NetrwBannerCtrl(islocal)
let fname= s:NetrwGetWord()
sil NetrwKeepj $
let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
-" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
+" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'),'~'.expand("<slnum>"))
if result <= 0 && exists("w:netrw_bannercnt")
exe "NetrwKeepj ".w:netrw_bannercnt
endif
@@ -4314,9 +4384,9 @@ fun! s:NetrwBookmark(del,...)
if exists("s:netrwmarkfilelist_{curbufnr}")
" for every filename in the marked list
-" call Decho("bookmark every filename in marked list")
+" call Decho("bookmark every filename in marked list",'~'.expand("<slnum>"))
let svpos = netrw#SavePosn()
- let islocal= expand("%") !~ '^\a\+://'
+ let islocal= expand("%") !~ '^\a\{3,}://'
for fname in s:netrwmarkfilelist_{curbufnr}
if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
endfor
@@ -4331,7 +4401,7 @@ fun! s:NetrwBookmark(del,...)
else
" bookmark currently open file
-" call Decho("bookmark currently open file")
+" call Decho("bookmark currently open file",'~'.expand("<slnum>"))
let fname= expand("%")
if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
endif
@@ -4341,18 +4411,22 @@ fun! s:NetrwBookmark(del,...)
" attempts to infer if working remote or local
" by deciding if the current file begins with an url
" Globbing cannot be done remotely.
- let islocal= expand("%") !~ '^\a\+://'
-" call Decho("bookmark specified file".((a:0>1)? "s" : ""))
+ let islocal= expand("%") !~ '^\a\{3,}://'
+" call Decho("bookmark specified file".((a:0>1)? "s" : ""),'~'.expand("<slnum>"))
let i = 1
while i <= a:0
if islocal
- let mbfiles= glob(a:{i},0,1)
+ if v:version == 704 && has("patch656")
+ let mbfiles= glob(a:{i},0,1,1)
+ else
+ let mbfiles= glob(a:{i},0,1)
+ endif
else
let mbfiles= [a:{i}]
endif
-" call Decho("mbfiles".string(mbfiles))
+" call Decho("mbfiles".string(mbfiles),'~'.expand("<slnum>"))
for mbfile in mbfiles
-" call Decho("mbfile<".mbfile.">")
+" call Decho("mbfile<".mbfile.">",'~'.expand("<slnum>"))
if a:del|call s:DeleteBookmark(mbfile)|else|call s:MakeBookmark(mbfile)|endif
endfor
let i= i + 1
@@ -4379,7 +4453,7 @@ fun! s:NetrwBookmarkMenu()
" the following test assures that gvim is running, has menus available, and has menus enabled.
if has("gui") && has("menu") && has("gui_running") && &go =~# 'm' && g:netrw_menu
if exists("g:NetrwTopLvlMenu")
-" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)")
+" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)",'~'.expand("<slnum>"))
exe 'sil! unmenu '.g:NetrwTopLvlMenu.'Bookmarks'
exe 'sil! unmenu '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete'
endif
@@ -4391,7 +4465,7 @@ fun! s:NetrwBookmarkMenu()
if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] && g:netrw_dirhistmax > 0
let cnt= 1
for bmd in g:netrw_bookmarklist
-" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd)
+" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd,'~'.expand("<slnum>"))
let bmd= escape(bmd,g:netrw_menu_escape)
" show bookmarks for goto menu
@@ -4414,7 +4488,7 @@ fun! s:NetrwBookmarkMenu()
let priority = g:netrw_dirhist_cnt + histcnt
if exists("g:netrw_dirhist_{cnt}")
let histdir= escape(g:netrw_dirhist_{cnt},g:netrw_menu_escape)
-" call Decho('sil! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir)
+" call Decho('sil! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir,'~'.expand("<slnum>"))
exe 'sil! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.histdir.' :e '.histdir."\<cr>"
endif
let first = 0
@@ -4436,27 +4510,27 @@ endfun
" NetrwBrowseChgDir() edits the file.
fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
-" call Decho("win#".winnr())
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
let ykeep= @@
if !exists("b:netrw_curdir")
" Don't try to change-directory: this can happen, for example, when netrw#ErrorMsg has been called
" and the current window is the NetrwMessage window.
let @@= ykeep
-" call Decho("b:netrw_curdir doesn't exist!")
-" call Decho("getcwd<".getcwd().">")
+" call Decho("b:netrw_curdir doesn't exist!",'~'.expand("<slnum>"))
+" call Decho("getcwd<".getcwd().">",'~'.expand("<slnum>"))
" call Dredir("ls!")
" call Dret("s:NetrwBrowseChgDir")
return
endif
" NetrwBrowseChgDir: save options and initialize {{{3
-" call Decho("saving options")
+" call Decho("saving options",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionSave("s:")
NetrwKeepj call s:NetrwSafeOptions()
let nbcd_curpos = netrw#SavePosn()
let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos
-" call Decho("setting s:nbcd_curpos_".bufnr('%')." to SavePosn")
+" call Decho("setting s:nbcd_curpos_".bufnr('%')." to SavePosn",'~'.expand("<slnum>"))
if (has("win32") || has("win95") || has("win64") || has("win16"))
let dirname = substitute(b:netrw_curdir,'\\','/','ge')
else
@@ -4465,110 +4539,108 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let newdir = a:newdir
let dolockout = 0
let dorestore = 1
-" call Decho("dirname<".dirname.">")
+" call Decho("dirname<".dirname.">",'~'.expand("<slnum>"))
" ignore <cr>s when done in the banner
-" call Decho('ignore <cr>s when done in banner (g:netrw_banner='.g:netrw_banner.")")
+" call Decho('ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("<slnum>"))
if g:netrw_banner
-" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"))
+" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
if getline(".") =~ 'Quick Help'
-" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp)
-" call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
setl ma noro nowrap
NetrwKeepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp])
setl noma nomod nowrap
NetrwKeepj call netrw#RestorePosn(nbcd_curpos)
NetrwKeepj call s:NetrwOptionRestore("s:")
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
endif
" else " Decho
-" call Decho("(s:NetrwBrowseChgdir) g:netrw_banner=".g:netrw_banner." (no banner)")
+" call Decho("(s:NetrwBrowseChgdir) g:netrw_banner=".g:netrw_banner." (no banner)",'~'.expand("<slnum>"))
endif
" set up o/s-dependent directory recognition pattern
-" call Decho("set up o/s-dependent directory recognition pattern")
if has("amiga")
let dirpat= '[\/:]$'
else
let dirpat= '[\/]$'
endif
-" call Decho("dirname<".dirname."> dirpat<".dirpat.">")
+" call Decho("set up o/s-dependent directory recognition pattern: dirname<".dirname."> dirpat<".dirpat.">",'~'.expand("<slnum>"))
if dirname !~ dirpat
" apparently vim is "recognizing" that it is in a directory and
" is removing the trailing "/". Bad idea, so let's put it back.
let dirname= dirname.'/'
-" call Decho("adjusting dirname<".dirname.">")
+" call Decho("adjusting dirname<".dirname.'> (put trailing "/" back)','~'.expand("<slnum>"))
endif
-" call Decho("newdir<".newdir."> !~ dirpat<".dirpat.">? ".((newdir !~ dirpat)? "yes" : "no"))
- if newdir !~ dirpat && !(a:islocal && isdirectory(newdir))
+" " call Decho("[newdir<".newdir."> ".((newdir =~ dirpat)? "=~" : "!~")." dirpat<".dirpat.">] && [islocal=".a:islocal."] && [newdir is ".(isdirectory(s:NetrwFile(newdir))? "" : "not ")."a directory]",'~'.expand("<slnum>"))
+ if newdir !~ dirpat && !(a:islocal && isdirectory(s:NetrwFile(s:ComposePath(dirname,newdir))))
" ------------------------------
" NetrwBrowseChgDir: edit a file {{{3
" ------------------------------
-" call Decho('edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">")
+" call Decho('edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" save position for benefit of Rexplore
let s:rexposn_{bufnr("%")}= netrw#SavePosn()
-
-" call Decho("edit-a-file: setting s:rexposn_".bufnr("%")." to SavePosn")
-" call Decho("edit-a-file: win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
-" call Decho("edit-a-file: w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')." w:netrw_treedict:".(exists("w:netrw_treedict")? "exists" : 'n/a')." newdir<".newdir.">")
+" call Decho("edit-a-file: setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
+" call Decho("edit-a-file: win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft,'~'.expand("<slnum>"))
+" call Decho("edit-a-file: w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')." w:netrw_treedict:".(exists("w:netrw_treedict")? "exists" : 'n/a')." newdir<".newdir.">",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
-" call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">")
-" call Decho("edit-a-file: newdir<".newdir.">")
+" call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">",'~'.expand("<slnum>"))
+" call Decho("edit-a-file: newdir<".newdir.">",'~'.expand("<slnum>"))
let dirname= s:NetrwTreeDir(a:islocal)
if dirname =~ '/$'
let dirname= dirname.newdir
else
let dirname= dirname."/".newdir
endif
-" call Decho("edit-a-file: dirname<".dirname.">")
-" call Decho("edit-a-file: tree listing")
+" call Decho("edit-a-file: dirname<".dirname.">",'~'.expand("<slnum>"))
+" call Decho("edit-a-file: tree listing",'~'.expand("<slnum>"))
elseif newdir =~ '^\(/\|\a:\)'
let dirname= newdir
else
let dirname= s:ComposePath(dirname,newdir)
endif
-" call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")")
+" call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")",'~'.expand("<slnum>"))
" this lets netrw#BrowseX avoid the edit
if a:0 < 1
-" call Decho("edit-a-file: set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"))
+" call Decho("edit-a-file: set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"),'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionRestore("s:")
if !exists("s:didsplit")
-" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr())
+" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("<slnum>"))
if type(g:netrw_browse_split) == 3
" open file in server
" Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
-" call Decho("edit-a-file: open file in server")
+" call Decho("edit-a-file: open file in server",'~'.expand("<slnum>"))
call s:NetrwServerEdit(a:islocal,dirname)
" call Dret("s:NetrwBrowseChgDir")
return
elseif g:netrw_browse_split == 1
" horizontally splitting the window first
-" call Decho("edit-a-file: horizontally splitting window prior to edit")
+" call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("<slnum>"))
keepalt new
if !&ea
keepalt wincmd _
endif
elseif g:netrw_browse_split == 2
" vertically splitting the window first
-" call Decho("edit-a-file: vertically splitting window prior to edit")
+" call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("<slnum>"))
keepalt rightb vert new
if !&ea
keepalt wincmd |
endif
elseif g:netrw_browse_split == 3
" open file in new tab
-" call Decho("edit-a-file: opening new tab prior to edit")
+" call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("<slnum>"))
keepalt tabnew
elseif g:netrw_browse_split == 4
" act like "P" (ie. open previous window)
-" call Decho("edit-a-file: use previous window for edit")
+" call Decho("edit-a-file: use previous window for edit",'~'.expand("<slnum>"))
if s:NetrwPrevWinOpen(2) == 3
let @@= ykeep
" call Dret("s:NetrwBrowseChgDir")
@@ -4576,16 +4648,16 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
else
" handling a file, didn't split, so remove menu
-" call Decho("edit-a-file: handling a file+didn't split, so remove menu")
+" call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("<slnum>"))
call s:NetrwMenu(0)
" optional change to window
if g:netrw_chgwin >= 1
-" call Decho("edit-a-file: changing window to #".g:netrw_chgwin)
+" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("<slnum>"))
if winnr("$")+1 == g:netrw_chgwin
" if g:netrw_chgwin is set to one more than the last window, then
" vertically split the last window to make that window available.
let curwin= winnr()
- exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
+ exe "NetrwKeepj keepalt ".winnr("$")."wincmd w"
vs
exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".curwin
endif
@@ -4598,7 +4670,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will
" no keepalt to support :e # to return to a directory listing
if a:islocal
-" call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname))
+" call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("<slnum>"))
" some like c-^ to return to the last edited file
" others like c-^ to return to the netrw buffer
if exists("g:netrw_altfile") && g:netrw_altfile
@@ -4606,14 +4678,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
else
exe "NetrwKeepj e! ".fnameescape(dirname)
endif
-" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
+" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
call s:NetrwCursor()
if &hidden || &bufhidden == "hide"
" file came from vim's hidden storage. Don't "restore" options with it.
let dorestore= 0
endif
else
-" call Decho("edit-a-file: remote file: NetrwBrowse will edit it")
+" call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("<slnum>"))
endif
let dolockout= 1
@@ -4622,12 +4694,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" or as a list of function references. It will ignore anything that's not
" a function reference. See :help Funcref for information about function references.
if exists("g:Netrw_funcref")
-" call Decho("edit-a-file: handle optional Funcrefs")
+" call Decho("edit-a-file: handle optional Funcrefs",'~'.expand("<slnum>"))
if type(g:Netrw_funcref) == 2
-" call Decho("edit-a-file: handling a g:Netrw_funcref")
+" call Decho("edit-a-file: handling a g:Netrw_funcref",'~'.expand("<slnum>"))
NetrwKeepj call g:Netrw_funcref()
elseif type(g:Netrw_funcref) == 3
-" call Decho("edit-a-file: handling a list of g:Netrw_funcrefs")
+" call Decho("edit-a-file: handling a list of g:Netrw_funcrefs",'~'.expand("<slnum>"))
for Fncref in g:Netrw_funcref
if type(FncRef) == 2
NetrwKeepj call FncRef()
@@ -4641,42 +4713,44 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" ----------------------------------------------------
" NetrwBrowseChgDir: just go to the new directory spec {{{3
" ----------------------------------------------------
-" call Decho('goto-newdir: case "just go to new directory spec": newdir<'.newdir.'>')
+" call Decho('goto-newdir: case "just go to new directory spec": newdir<'.newdir.'>','~'.expand("<slnum>"))
let dirname = newdir
NetrwKeepj call s:SetRexDir(a:islocal,dirname)
NetrwKeepj call s:NetrwOptionRestore("s:")
+ norm! m`
elseif newdir == './'
" ---------------------------------------------
" NetrwBrowseChgDir: refresh the directory list {{{3
" ---------------------------------------------
-" call Decho('refresh-dirlist: case "refresh directory listing": newdir == "./"')
+" call Decho('refresh-dirlist: case "refresh directory listing": newdir == "./"','~'.expand("<slnum>"))
NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+ norm! m`
elseif newdir == '../'
" --------------------------------------
" NetrwBrowseChgDir: go up one directory {{{3
" --------------------------------------
-" call Decho('go-up: case "go up one directory": newdir == "../"')
+" call Decho('go-up: case "go up one directory": newdir == "../"','~'.expand("<slnum>"))
if w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" force a refresh
-" call Decho("go-up: clear buffer<".expand("%")."> with :%d")
-" call Decho("go-up: setl noro ma")
+" call Decho("go-up: clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+" call Decho("go-up: setl noro ma",'~'.expand("<slnum>"))
setl noro ma
- NetrwKeepj %d
+ NetrwKeepj %d _
endif
if has("amiga")
" amiga
-" call Decho('go-up: case "go up one directory": newdir == "../" and amiga')
+" call Decho('go-up: case "go up one directory": newdir == "../" and amiga','~'.expand("<slnum>"))
if a:islocal
let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+$\)','\1','')
let dirname= substitute(dirname,'/$','','')
else
let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+/$\)','\1','')
endif
-" call Decho("go-up: amiga: dirname<".dirname."> (go up one dir)")
+" call Decho("go-up: amiga: dirname<".dirname."> (go up one dir)",'~'.expand("<slnum>"))
elseif !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
" windows
@@ -4686,94 +4760,96 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let dirname= '/'
endif
else
- let dirname= substitute(dirname,'^\(\a\+://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','')
+ let dirname= substitute(dirname,'^\(\a\{3,}://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','')
endif
if dirname =~ '^\a:$'
let dirname= dirname.'/'
endif
-" call Decho("go-up: windows: dirname<".dirname."> (go up one dir)")
+" call Decho("go-up: windows: dirname<".dirname."> (go up one dir)",'~'.expand("<slnum>"))
else
" unix or cygwin
-" call Decho('go-up: case "go up one directory": newdir == "../" and unix or cygwin')
+" call Decho('go-up: case "go up one directory": newdir == "../" and unix or cygwin','~'.expand("<slnum>"))
if a:islocal
let dirname= substitute(dirname,'^\(.*\)/\([^/]\+\)/$','\1','')
if dirname == ""
let dirname= '/'
endif
else
- let dirname= substitute(dirname,'^\(\a\+://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','')
+ let dirname= substitute(dirname,'^\(\a\{3,}://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','')
endif
-" call Decho("go-up: unix: dirname<".dirname."> (go up one dir)")
+" call Decho("go-up: unix: dirname<".dirname."> (go up one dir)",'~'.expand("<slnum>"))
endif
NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+ norm m`
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" --------------------------------------
" NetrwBrowseChgDir: Handle Tree Listing {{{3
" --------------------------------------
-" call Decho('tree-list: case liststyle is TREELIST and w:netrw_treedict exists')
- " force a refresh (for TREELIST, wait for NetrwTreeDir() to force the refresh)
-" call Decho("tree-list: setl noro ma")
+" call Decho('tree-list: case liststyle is TREELIST and w:netrw_treedict exists','~'.expand("<slnum>"))
+ " force a refresh (for TREELIST, NetrwTreeDir() will force the refresh)
+" call Decho("tree-list: setl noro ma",'~'.expand("<slnum>"))
setl noro ma
if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir"))
-" call Decho("tree-list: clear buffer<".expand("%")."> with :%d")
- NetrwKeepj %d
+" call Decho("tree-list: clear buffer<".expand("%")."> with :%d (force refresh)",'~'.expand("<slnum>"))
+ NetrwKeepj %d _
endif
let treedir = s:NetrwTreeDir(a:islocal)
+" call Decho("tree-list: treedir<".treedir.">",'~'.expand("<slnum>"))
let s:treecurpos = nbcd_curpos
let haskey = 0
-" call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">")
+" call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">",'~'.expand("<slnum>"))
" search treedict for tree dir as-is
-" call Decho("search treedict for tree dir as-is")
+" call Decho("search treedict for tree dir as-is",'~'.expand("<slnum>"))
if has_key(w:netrw_treedict,treedir)
-" call Decho('tree-list: ....searched for treedir<'.treedir.'> : found it!')
+" call Decho('tree-list: ....searched for treedir<'.treedir.'> : found it!','~'.expand("<slnum>"))
let haskey= 1
else
-" call Decho('tree-list: ....searched for treedir<'.treedir.'> : not found')
+" call Decho('tree-list: ....searched for treedir<'.treedir.'> : not found','~'.expand("<slnum>"))
endif
- " search treedict for treedir with a / appended
-" call Decho("search treedict for treedir with a / appended")
- if !haskey && treedir !~ '/$'
+ " search treedict for treedir with a [/@] appended
+" call Decho("search treedict for treedir with a [/@] appended",'~'.expand("<slnum>"))
+ if !haskey && treedir !~ '[/@]$'
if has_key(w:netrw_treedict,treedir."/")
let treedir= treedir."/"
-" call Decho('tree-list: ....searched.for treedir<'.treedir.'> found it!')
+" call Decho('tree-list: ....searched.for treedir<'.treedir.'> found it!','~'.expand("<slnum>"))
let haskey = 1
else
-" call Decho('tree-list: ....searched for treedir<'.treedir.'/> : not found')
+" call Decho('tree-list: ....searched for treedir<'.treedir.'/> : not found','~'.expand("<slnum>"))
endif
endif
" search treedict for treedir with any trailing / elided
-" call Decho("search treedict for treedir with any trailing / elided")
+" call Decho("search treedict for treedir with any trailing / elided",'~'.expand("<slnum>"))
if !haskey && treedir =~ '/$'
let treedir= substitute(treedir,'/$','','')
if has_key(w:netrw_treedict,treedir)
-" call Decho('tree-list: ....searched.for treedir<'.treedir.'> found it!')
+" call Decho('tree-list: ....searched.for treedir<'.treedir.'> found it!','~'.expand("<slnum>"))
let haskey = 1
else
-" call Decho('tree-list: ....searched for treedir<'.treedir.'> : not found')
+" call Decho('tree-list: ....searched for treedir<'.treedir.'> : not found','~'.expand("<slnum>"))
endif
endif
-" call Decho("haskey=".haskey)
+" call Decho("haskey=".haskey,'~'.expand("<slnum>"))
if haskey
" close tree listing for selected subdirectory
-" call Decho("tree-list: closing selected subdirectory<".dirname.">")
+" call Decho("tree-list: closing selected subdirectory<".dirname.">",'~'.expand("<slnum>"))
call remove(w:netrw_treedict,treedir)
-" call Decho("tree-list: removed entry<".treedir."> from treedict")
-" call Decho("tree-list: yielding treedict<".string(w:netrw_treedict).">")
+" call Decho("tree-list: removed entry<".treedir."> from treedict",'~'.expand("<slnum>"))
+" call Decho("tree-list: yielding treedict<".string(w:netrw_treedict).">",'~'.expand("<slnum>"))
let dirname= w:netrw_treetop
else
" go down one directory
let dirname= substitute(treedir,'/*$','/','')
-" call Decho("tree-list: go down one dir: treedir<".treedir.">")
-" call Decho("tree-list: ... : dirname<".dirname.">")
+" call Decho("tree-list: go down one dir: treedir<".treedir.">",'~'.expand("<slnum>"))
+" call Decho("tree-list: ... : dirname<".dirname.">",'~'.expand("<slnum>"))
endif
NetrwKeepj call s:SetRexDir(a:islocal,dirname)
-" call Decho("setting s:treeforceredraw to true")
+" call Decho("setting s:treeforceredraw to true",'~'.expand("<slnum>"))
let s:treeforceredraw = 1
else
@@ -4781,8 +4857,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" NetrwBrowseChgDir: Go down one directory {{{3
" ----------------------------------------
let dirname = s:ComposePath(dirname,newdir)
-" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
+" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">",'~'.expand("<slnum>"))
NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+ norm m`
endif
" --------------------------------------
@@ -4791,23 +4868,23 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
if dorestore
" dorestore is zero'd when a local file was hidden or bufhidden;
" in such a case, we want to keep whatever settings it may have.
-" call Decho("doing option restore (dorestore=".dorestore.")")
+" call Decho("doing option restore (dorestore=".dorestore.")",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionRestore("s:")
" else " Decho
-" call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod)
+" call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod,'~'.expand("<slnum>"))
endif
if dolockout && dorestore
-" call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname))
+" call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname),'~'.expand("<slnum>"))
if filewritable(dirname)
-" call Decho("restore: doing modification lockout settings: ma nomod noro")
-" call Decho("restore: setl ma nomod noro")
+" call Decho("restore: doing modification lockout settings: ma nomod noro",'~'.expand("<slnum>"))
+" call Decho("restore: setl ma nomod noro",'~'.expand("<slnum>"))
setl ma noro nomod
-" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
else
-" call Decho("restore: doing modification lockout settings: ma nomod ro")
-" call Decho("restore: setl ma nomod noro")
+" call Decho("restore: doing modification lockout settings: ma nomod ro",'~'.expand("<slnum>"))
+" call Decho("restore: setl ma nomod noro",'~'.expand("<slnum>"))
setl ma ro nomod
-" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
endif
endif
let @@= ykeep
@@ -4825,7 +4902,7 @@ fun! s:NetrwBrowseUpDir(islocal)
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt-1
" this test needed because occasionally this function seems to be incorrectly called
" when multiple leftmouse clicks are taken when atop the one line help in the banner.
- " I'm allowing the very bottom line to permit a "-" exit so that one may escape empty
+ " I'm allowing the very bottom line to permit a "-" exit so that one may escape empty
" directories.
" call Dret("s:NetrwBrowseUpDir : cursor not in file area")
return
@@ -4833,12 +4910,13 @@ fun! s:NetrwBrowseUpDir(islocal)
norm! 0
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
-" call Decho("case: treestyle")
+" call Decho("case: treestyle",'~'.expand("<slnum>"))
let curline= getline(".")
let swwline= winline() - 1
if exists("w:netrw_treetop")
let b:netrw_curdir= w:netrw_treetop
endif
+ let curdir= b:netrw_curdir
if a:islocal
call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../'))
else
@@ -4858,19 +4936,26 @@ fun! s:NetrwBrowseUpDir(islocal)
endif
endwhile
else
-" call Decho("case: not treestyle")
+" call Decho("case: not treestyle",'~'.expand("<slnum>"))
+ if exists("b:netrw_curdir")
+ let curdir= b:netrw_curdir
+ else
+ let curdir= expand(getcwd())
+ endif
if a:islocal
call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../'))
else
call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,'../'))
endif
if exists("w:netrw_bannercnt")
-" call Decho("moving to line#".w:netrw_bannercnt)
+" call Decho("moving to line#".w:netrw_bannercnt,'~'.expand("<slnum>"))
exe w:netrw_bannercnt
else
1
endif
endif
+ let curdir= substitute(curdir,'^.*[\/]','','')
+ call search('\<'.curdir.'\>','wc')
" call Dret("s:NetrwBrowseUpDir")
endfun
@@ -4900,11 +4985,11 @@ fun! netrw#BrowseX(fname,remote)
if exists("g:Netrw_corehandler")
if type(g:Netrw_corehandler) == 2
" g:Netrw_corehandler is a function reference (see :help Funcref)
-" call Decho("g:Netrw_corehandler is a funcref")
- call g:Netrw_corehandler(a:fname)
+" call Decho("g:Netrw_corehandler is a funcref",'~'.expand("<slnum>"))
+ call g:Netrw_corehandler(s:NetrwFile(a:fname))
elseif type(g:Netrw_corehandler) == 3
" g:Netrw_corehandler is a List of function references (see :help Funcref)
-" call Decho("g:Netrw_corehandler is a List")
+" call Decho("g:Netrw_corehandler is a List",'~'.expand("<slnum>"))
for Fncref in g:Netrw_corehandler
if type(FncRef) == 2
call FncRef(a:fname)
@@ -4925,18 +5010,18 @@ fun! netrw#BrowseX(fname,remote)
if has("win32") || has("win95") || has("win64") || has("win16")
let exten= substitute(exten,'^.*$','\L&\E','')
endif
-" call Decho("exten<".exten.">")
+" call Decho("exten<".exten.">",'~'.expand("<slnum>"))
if a:remote == 1
" create a local copy
-" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">")
+" call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>"))
setl bh=delete
call netrw#NetRead(3,a:fname)
" attempt to rename tempfile
let basename= substitute(a:fname,'^\(.*\)/\(.*\)\.\([^.]*\)$','\2','')
let newname = substitute(s:netrw_tmpfile,'^\(.*\)/\(.*\)\.\([^.]*\)$','\1/'.basename.'.\3','')
-" call Decho("basename<".basename.">")
-" call Decho("newname <".newname.">")
+" call Decho("basename<".basename.">",'~'.expand("<slnum>"))
+" call Decho("newname <".newname.">",'~'.expand("<slnum>"))
if rename(s:netrw_tmpfile,newname) == 0
" renaming succeeded
let fname= newname
@@ -4945,16 +5030,16 @@ fun! netrw#BrowseX(fname,remote)
let fname= s:netrw_tmpfile
endif
else
-" call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">")
+" call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>"))
let fname= a:fname
" special ~ handler for local
if fname =~ '^\~' && expand("$HOME") != ""
-" call Decho('invoking special ~ handler')
- let fname= substitute(fname,'^\~',expand("$HOME"),'')
+" call Decho('invoking special ~ handler','~'.expand("<slnum>"))
+ let fname= s:NetrwFile(substitute(fname,'^\~',expand("$HOME"),''))
endif
endif
-" call Decho("fname<".fname.">")
-" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten))
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
+" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten),'~'.expand("<slnum>"))
" set up redirection
if &srr =~ "%s"
@@ -4968,12 +5053,12 @@ fun! netrw#BrowseX(fname,remote)
else
let redir= &srr . "/dev/null"
endif
-" call Decho("set up redirection: redir{".redir."} srr{".&srr."}")
+" call Decho("set up redirection: redir{".redir."} srr{".&srr."}",'~'.expand("<slnum>"))
" extract any viewing options. Assumes that they're set apart by quotes.
-" call Decho("extract any viewing options")
+" call Decho("extract any viewing options",'~'.expand("<slnum>"))
if exists("g:netrw_browsex_viewer")
-" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
+" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("<slnum>"))
if g:netrw_browsex_viewer =~ '\s'
let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','')
let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." "
@@ -4984,32 +5069,32 @@ fun! netrw#BrowseX(fname,remote)
let viewopt = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\3','')." "
let cnt = cnt + 1
let oviewer = viewer
-" call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">")
+" call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("<slnum>"))
endwhile
else
let viewer = g:netrw_browsex_viewer
let viewopt = ""
endif
-" call Decho("viewer<".viewer."> viewopt<".viewopt.">")
+" call Decho("viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("<slnum>"))
endif
" execute the file handler
-" call Decho("execute the file handler (if any)")
+" call Decho("execute the file handler (if any)",'~'.expand("<slnum>"))
if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-'
-" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
+" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("<slnum>"))
let ret= netrwFileHandlers#Invoke(exten,fname)
elseif exists("g:netrw_browsex_viewer") && executable(viewer)
-" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
- call s:NetrwExe("sil !".viewer." ".viewopt.shellescape(fname,1).redir)
+" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil !".viewer." ".viewopt.s:ShellEscape(fname,1).redir)
let ret= v:shell_error
elseif has("win32") || has("win64")
-" call Decho("windows")
+" call Decho("windows",'~'.expand("<slnum>"))
if executable("start")
- call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
+ call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1))
elseif executable("rundll32")
- call s:NetrwExe('sil! !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
+ call s:NetrwExe('sil! !rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1))
else
call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
endif
@@ -5018,32 +5103,37 @@ fun! netrw#BrowseX(fname,remote)
elseif has("win32unix")
let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g')
-" call Decho("cygwin: winfname<".shellescape(winfname,1).">")
+" call Decho("cygwin: winfname<".s:ShellEscape(winfname,1).">",'~'.expand("<slnum>"))
if executable("start")
- call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
+ call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1))
elseif executable("rundll32")
- call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
+ call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1))
elseif executable("cygstart")
- call s:NetrwExe('sil !cygstart '.shellescape(fname,1))
+ call s:NetrwExe('sil !cygstart '.s:ShellEscape(fname,1))
else
call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
endif
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let ret= v:shell_error
- elseif has("unix") && executable("xdg-open") && !s:CheckIfKde()
-" call Decho("unix and xdg-open")
- call s:NetrwExe("sil !xdg-open ".shellescape(fname,1).redir)
+ elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
+" call Decho("unix and kfmclient",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
- elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
-" call Decho("unix and kfmclient")
- call s:NetrwExe("sil !kfmclient exec ".shellescape(fname,1)." ".redir)
+ elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
+" call Decho("unix, exo-open, xdg-open",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir)
+ let ret= v:shell_error
+
+ elseif has("unix") && executable("xdg-open")
+" call Decho("unix and xdg-open",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir)
let ret= v:shell_error
elseif has("macunix") && executable("open")
-" call Decho("macunix and open")
- call s:NetrwExe("sil !open ".shellescape(fname,1)." ".redir)
+" call Decho("macunix and open",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil !open ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
else
@@ -5065,7 +5155,7 @@ fun! netrw#BrowseX(fname,remote)
" Feb 12, 2008: had to de-activiate removal of
" temporary file because it wasn't getting seen.
" if a:remote == 1 && fname != a:fname
-"" call Decho("deleting temporary file<".fname.">")
+"" call Decho("deleting temporary file<".fname.">",'~'.expand("<slnum>"))
" call s:NetrwDelete(fname)
" endif
@@ -5090,7 +5180,7 @@ fun! netrw#BrowseXVis()
" call Dfunc("netrw#BrowseXVis()")
let atkeep = @@
norm! gvy
-" call Decho("@@<".@@.">")
+" call Decho("@@<".@@.">",'~'.expand("<slnum>"))
call netrw#BrowseX(@@,netrw#CheckIfRemote())
let @@ = atkeep
" call Dret("netrw#BrowseXVis")
@@ -5100,7 +5190,7 @@ endfun
" netrw#CheckIfRemote: returns 1 if current file looks like an url, 0 else {{{2
fun! netrw#CheckIfRemote()
" call Dfunc("netrw#CheckIfRemote()")
- if expand("%") =~ '^\a\+://'
+ if expand("%") =~ '^\a\{3,}://'
" call Dret("netrw#CheckIfRemote 1")
return 1
else
@@ -5117,9 +5207,9 @@ fun! s:NetrwChgPerm(islocal,curdir)
call inputsave()
let newperm= input("Enter new permission: ")
call inputrestore()
- let chgperm= substitute(g:netrw_chgperm,'\<FILENAME\>',shellescape(expand("<cfile>")),'')
- let chgperm= substitute(chgperm,'\<PERM\>',shellescape(newperm),'')
-" call Decho("chgperm<".chgperm.">")
+ let chgperm= substitute(g:netrw_chgperm,'\<FILENAME\>',s:ShellEscape(expand("<cfile>")),'')
+ let chgperm= substitute(chgperm,'\<PERM\>',s:ShellEscape(newperm),'')
+" call Decho("chgperm<".chgperm.">",'~'.expand("<slnum>"))
call system(chgperm)
if v:shell_error != 0
NetrwKeepj call netrw#ErrorMsg(1,"changing permission on file<".expand("<cfile>")."> seems to have failed",75)
@@ -5142,14 +5232,14 @@ fun! s:CheckIfKde()
" usually have "kdeinit" running, though... (tnx Mikolaj Machowski)
if !exists("s:haskdeinit")
if has("unix") && executable("ps") && !has("win32unix")
- let s:haskdeinit= system("ps -e") =~ '\<kdeinit'
+ let s:haskdeinit= system("ps -e") =~ '\<kdeinit'
if v:shell_error
let s:haskdeinit = 0
endif
else
let s:haskdeinit= 0
endif
-" call Decho("setting s:haskdeinit=".s:haskdeinit)
+" call Decho("setting s:haskdeinit=".s:haskdeinit,'~'.expand("<slnum>"))
endif
" call Dret("s:CheckIfKde ".s:haskdeinit)
@@ -5208,7 +5298,7 @@ fun! s:NetrwForceChgDir(islocal,newdir)
else
let newdir= a:newdir.'/'
endif
-" call Decho("adjusting newdir<".newdir."> due to gd")
+" call Decho("adjusting newdir<".newdir."> due to gd",'~'.expand("<slnum>"))
else
" should already be getting treatment as a directory
let newdir= a:newdir
@@ -5249,18 +5339,18 @@ fun! s:NetrwHide(islocal)
let svpos= netrw#SavePosn()
if exists("s:netrwmarkfilelist_{bufnr('%')}")
-" call Decho("((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">")
-" call Decho("g:netrw_list_hide<".g:netrw_list_hide.">")
+" call Decho("((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">",'~'.expand("<slnum>"))
+" call Decho("g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
" hide the files in the markfile list
for fname in s:netrwmarkfilelist_{bufnr("%")}
-" call Decho("match(g:netrw_list_hide<".g:netrw_list_hide.'> fname<\<'.fname.'\>>)='.match(g:netrw_list_hide,'\<'.fname.'\>')." l:isk=".&l:isk)
+" call Decho("match(g:netrw_list_hide<".g:netrw_list_hide.'> fname<\<'.fname.'\>>)='.match(g:netrw_list_hide,'\<'.fname.'\>')." l:isk=".&l:isk,'~'.expand("<slnum>"))
if match(g:netrw_list_hide,'\<'.fname.'\>') != -1
" remove fname from hiding list
let g:netrw_list_hide= substitute(g:netrw_list_hide,'..\<'.escape(fname,g:netrw_fname_escape).'\>..','','')
let g:netrw_list_hide= substitute(g:netrw_list_hide,',,',',','g')
let g:netrw_list_hide= substitute(g:netrw_list_hide,'^,\|,$','','')
-" call Decho("unhide: g:netrw_list_hide<".g:netrw_list_hide.">")
+" call Decho("unhide: g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
else
" append fname to hiding list
if exists("g:netrw_list_hide") && g:netrw_list_hide != ""
@@ -5268,7 +5358,7 @@ fun! s:NetrwHide(islocal)
else
let g:netrw_list_hide= '\<'.escape(fname,g:netrw_fname_escape).'\>'
endif
-" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">")
+" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
endif
endfor
NetrwKeepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
@@ -5294,6 +5384,32 @@ fun! s:NetrwHide(islocal)
endfun
" ---------------------------------------------------------------------
+" s:NetrwHideEdit: allows user to edit the file/directory hiding list {{{2
+fun! s:NetrwHideEdit(islocal)
+" call Dfunc("NetrwHideEdit(islocal=".a:islocal.")")
+
+ let ykeep= @@
+ " save current cursor position
+ let svpos= netrw#SavePosn()
+
+ " get new hiding list from user
+ call inputsave()
+ let newhide= input("Edit Hiding List: ",g:netrw_list_hide)
+ call inputrestore()
+ let g:netrw_list_hide= newhide
+" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
+
+ " refresh the listing
+ sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
+
+ " restore cursor position
+ call netrw#RestorePosn(svpos)
+ let @@= ykeep
+
+" call Dret("NetrwHideEdit")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwHidden: invoked by "gh" {{{2
fun! s:NetrwHidden(islocal)
" call Dfunc("s:NetrwHidden()")
@@ -5325,9 +5441,9 @@ fun! s:NetrwHome()
else
" go to vim plugin home
for home in split(&rtp,',') + ['']
- if isdirectory(home) && filewritable(home) | break | endif
+ if isdirectory(s:NetrwFile(home)) && filewritable(s:NetrwFile(home)) | break | endif
let basehome= substitute(home,'[/\\]\.vim$','','')
- if isdirectory(basehome) && filewritable(basehome)
+ if isdirectory(s:NetrwFile(basehome)) && filewritable(s:NetrwFile(basehome))
let home= basehome."/.vim"
break
endif
@@ -5341,9 +5457,9 @@ fun! s:NetrwHome()
endif
endif
" insure that the home directory exists
- if g:netrw_dirhistmax > 0 && !isdirectory(home)
+ if g:netrw_dirhistmax > 0 && !isdirectory(s:NetrwFile(home))
if exists("g:netrw_mkdir")
- call system(g:netrw_mkdir." ".shellescape(home))
+ call system(g:netrw_mkdir." ".s:ShellEscape(s:NetrwFile(home)))
else
call mkdir(home)
endif
@@ -5370,8 +5486,8 @@ fun! s:NetrwLeftmouse(islocal)
let mouse_lnum = v:mouse_lnum
let wlastline = line('w$')
let lastline = line('$')
-" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline." v:mouse_win=".v:mouse_win." winnr#".winnr())
-" call Decho("v:mouse_col =".v:mouse_col." col=".col(".")." wincol =".wincol()." winwidth =".winwidth(0))
+" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline." v:mouse_win=".v:mouse_win." winnr#".winnr(),'~'.expand("<slnum>"))
+" call Decho("v:mouse_col =".v:mouse_col." col=".col(".")." wincol =".wincol()." winwidth =".winwidth(0),'~'.expand("<slnum>"))
if mouse_lnum >= wlastline + 1 || v:mouse_win != winnr()
" appears to be a status bar leftmouse click
let @@= ykeep
@@ -5382,7 +5498,7 @@ fun! s:NetrwLeftmouse(islocal)
" Windows are separated by vertical separator bars - but the mouse seems to be doing what it should when dragging that bar
" without this test when its disabled.
" May 26, 2014: edit file, :Lex, resize window -- causes refresh. Reinstated a modified test. See if problems develop.
-" call Decho("v:mouse_col=".v:mouse_col." col#".col('.')." virtcol#".virtcol('.')." col($)#".col("$")." virtcol($)#".virtcol("$"))
+" call Decho("v:mouse_col=".v:mouse_col." col#".col('.')." virtcol#".virtcol('.')." col($)#".col("$")." virtcol($)#".virtcol("$"),'~'.expand("<slnum>"))
if v:mouse_col > virtcol('.')
let @@= ykeep
" call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click")
@@ -5403,6 +5519,14 @@ fun! s:NetrwLeftmouse(islocal)
endfun
" ---------------------------------------------------------------------
+" s:NetrwCLeftmouse: used to select a file/directory for a target {{{2
+fun! s:NetrwCLeftmouse(islocal)
+" call Dfunc("s:NetrwCLeftmouse(islocal=".a:islocal.")")
+ call s:NetrwMarkFileTgt(a:islocal)
+" call Dret("s:NetrwCLeftmouse")
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwServerEdit: edit file in a server gvim, usually NETRWSERVER (implements <c-r>){{{2
" a:islocal=0 : <c-r> not used, remote
" a:islocal=1 : <c-r> no used, local
@@ -5412,10 +5536,12 @@ fun! s:NetrwServerEdit(islocal,fname)
" call Dfunc("s:NetrwServerEdit(islocal=".a:islocal.",fname<".a:fname.">)")
let islocal = a:islocal%2 " =0: remote =1: local
let ctrlr = a:islocal >= 2 " =0: <c-r> not used =1: <c-r> used
+" call Decho("islocal=".islocal." ctrlr=".ctrlr,'~'.expand("<slnum>"))
- if (islocal && isdirectory(a:fname)) || (!islocal && a:fname =~ '/$')
+ if (islocal && isdirectory(s:NetrwFile(a:fname))) || (!islocal && a:fname =~ '/$')
" handle directories in the local window -- not in the remote vim server
" user must have closed the NETRWSERVER window. Treat as a normal editing from netrw.
+" call Decho("handling directory in client window",'~'.expand("<slnum>"))
let g:netrw_browse_split= 0
if exists("s:netrw_browse_split_".winnr())
let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
@@ -5426,22 +5552,23 @@ fun! s:NetrwServerEdit(islocal,fname)
return
endif
+" call Decho("handling file in server window",'~'.expand("<slnum>"))
if has("clientserver") && executable("gvim")
-" call Decho("has clientserver and gvim")
+" call Decho("has clientserver and gvim",'~'.expand("<slnum>"))
if exists("g:netrw_browse_split") && type(g:netrw_browse_split) == 3
-" call Decho("g:netrw_browse_split=".string(g:netrw_browse_split))
+" call Decho("g:netrw_browse_split=".string(g:netrw_browse_split),'~'.expand("<slnum>"))
let srvrname = g:netrw_browse_split[0]
let tabnum = g:netrw_browse_split[1]
let winnum = g:netrw_browse_split[2]
if serverlist() !~ '\<'.srvrname.'\>'
-" call Decho("server not available; ctrlr=".ctrlr)
+" call Decho("server not available; ctrlr=".ctrlr,'~'.expand("<slnum>"))
if !ctrlr
" user must have closed the server window and the user did not use <c-r>, but
" used something like <cr>.
-" call Decho("user must have closed server AND did not use ctrl-r")
+" call Decho("user must have closed server AND did not use ctrl-r",'~'.expand("<slnum>"))
if exists("g:netrw_browse_split")
unlet g:netrw_browse_split
endif
@@ -5455,27 +5582,27 @@ fun! s:NetrwServerEdit(islocal,fname)
elseif has("win32") && executable("start")
" start up remote netrw server under windows
-" call Decho("starting up gvim server<".srvrname."> for windows")
+" call Decho("starting up gvim server<".srvrname."> for windows",'~'.expand("<slnum>"))
call system("start gvim --servername ".srvrname)
else
" start up remote netrw server under linux
-" call Decho("starting up gvim server<".srvrname.">")
+" call Decho("starting up gvim server<".srvrname.">",'~'.expand("<slnum>"))
call system("gvim --servername ".srvrname)
endif
endif
-" call Decho("srvrname<".srvrname."> tabnum=".tabnum." winnum=".winnum." server-editing<".a:fname.">")
+" call Decho("srvrname<".srvrname."> tabnum=".tabnum." winnum=".winnum." server-editing<".a:fname.">",'~'.expand("<slnum>"))
call remote_send(srvrname,":tabn ".tabnum."\<cr>")
call remote_send(srvrname,":".winnum."wincmd w\<cr>")
- call remote_send(srvrname,":e ".fnameescape(a:fname)."\<cr>")
+ call remote_send(srvrname,":e ".fnameescape(s:NetrwFile(a:fname))."\<cr>")
else
if serverlist() !~ '\<'.g:netrw_servername.'\>'
if !ctrlr
-" call Decho("server<".g:netrw_servername."> not available and ctrl-r not used")
+" call Decho("server<".g:netrw_servername."> not available and ctrl-r not used",'~'.expand("<slnum>"))
if exists("g:netrw_browse_split")
unlet g:netrw_browse_split
endif
@@ -5485,14 +5612,14 @@ fun! s:NetrwServerEdit(islocal,fname)
return
else
-" call Decho("server<".g:netrw_servername."> not available but ctrl-r used")
+" call Decho("server<".g:netrw_servername."> not available but ctrl-r used",'~'.expand("<slnum>"))
if has("win32") && executable("start")
" start up remote netrw server under windows
-" call Decho("starting up gvim server<".g:netrw_servername."> for windows")
+" call Decho("starting up gvim server<".g:netrw_servername."> for windows",'~'.expand("<slnum>"))
call system("start gvim --servername ".g:netrw_servername)
else
" start up remote netrw server under linux
-" call Decho("starting up gvim server<".g:netrw_servername.">")
+" call Decho("starting up gvim server<".g:netrw_servername.">",'~'.expand("<slnum>"))
call system("gvim --servername ".g:netrw_servername)
endif
endif
@@ -5500,8 +5627,8 @@ fun! s:NetrwServerEdit(islocal,fname)
while 1
try
-" call Decho("remote-send: e ".a:fname)
- call remote_send(g:netrw_servername,":e ".fnameescape(a:fname)."\<cr>")
+" call Decho("remote-send: e ".a:fname,'~'.expand("<slnum>"))
+ call remote_send(g:netrw_servername,":e ".fnameescape(s:NetrwFile(a:fname))."\<cr>")
break
catch /^Vim\%((\a\+)\)\=:E241/
sleep 200m
@@ -5528,7 +5655,7 @@ endfun
" s:NetrwSLeftmouse: marks the file under the cursor. May be dragged to select additional files {{{2
fun! s:NetrwSLeftmouse(islocal)
" call Dfunc("s:NetrwSLeftmouse(islocal=".a:islocal.")")
-
+
let s:ngw= s:NetrwGetWord()
call s:NetrwMarkFile(a:islocal,s:ngw)
@@ -5587,7 +5714,7 @@ fun! s:NetrwListHide()
" string. Use the first character left as a separator character.
let listhide= g:netrw_list_hide
let sep = strpart(substitute('/~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
-" call Decho("sep=".sep)
+" call Decho("sep=".sep,'~'.expand("<slnum>"))
while listhide != ""
if listhide =~ ','
@@ -5600,10 +5727,10 @@ fun! s:NetrwListHide()
" Prune the list by hiding any files which match
if g:netrw_hide == 1
-" call Decho("hiding<".hide."> listhide<".listhide.">")
+" call Decho("hiding<".hide."> listhide<".listhide.">",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
elseif g:netrw_hide == 2
-" call Decho("showing<".hide."> listhide<".listhide.">")
+" call Decho("showing<".hide."> listhide<".listhide.">",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
endif
endwhile
@@ -5621,52 +5748,6 @@ fun! s:NetrwListHide()
endfun
" ---------------------------------------------------------------------
-" NetrwHideEdit: allows user to edit the file/directory hiding list
-fun! s:NetrwHideEdit(islocal)
-" call Dfunc("NetrwHideEdit(islocal=".a:islocal.")")
-
- let ykeep= @@
- " save current cursor position
- let svpos= netrw#SavePosn()
-
- " get new hiding list from user
- call inputsave()
- let newhide= input("Edit Hiding List: ",g:netrw_list_hide)
- call inputrestore()
- let g:netrw_list_hide= newhide
-" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">")
-
- " refresh the listing
- sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
-
- " restore cursor position
- call netrw#RestorePosn(svpos)
- let @@= ykeep
-
-" call Dret("NetrwHideEdit")
-endfun
-
-" ---------------------------------------------------------------------
-" NetSortSequence: allows user to edit the sorting sequence
-fun! s:NetSortSequence(islocal)
-" call Dfunc("NetSortSequence(islocal=".a:islocal.")")
-
- let ykeep= @@
- let svpos= netrw#SavePosn()
- call inputsave()
- let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence)
- call inputrestore()
-
- " refresh the listing
- let g:netrw_sort_sequence= newsortseq
- NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
- NetrwKeepj call netrw#RestorePosn(svpos)
- let @@= ykeep
-
-" call Dret("NetSortSequence")
-endfun
-
-" ---------------------------------------------------------------------
" s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2
" implements the "d" mapping.
fun! s:NetrwMakeDir(usrhost)
@@ -5679,7 +5760,7 @@ fun! s:NetrwMakeDir(usrhost)
call inputsave()
let newdirname= input("Please give directory name: ")
call inputrestore()
-" call Decho("newdirname<".newdirname.">")
+" call Decho("newdirname<".newdirname.">",'~'.expand("<slnum>"))
if newdirname == ""
let @@= ykeep
@@ -5688,13 +5769,13 @@ fun! s:NetrwMakeDir(usrhost)
endif
if a:usrhost == ""
-" call Decho("local mkdir")
+" call Decho("local mkdir",'~'.expand("<slnum>"))
" Local mkdir:
" sanity checks
let fullnewdir= b:netrw_curdir.'/'.newdirname
-" call Decho("fullnewdir<".fullnewdir.">")
- if isdirectory(fullnewdir)
+" call Decho("fullnewdir<".fullnewdir.">",'~'.expand("<slnum>"))
+ if isdirectory(s:NetrwFile(fullnewdir))
if !exists("g:netrw_quiet")
NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
endif
@@ -5722,23 +5803,23 @@ fun! s:NetrwMakeDir(usrhost)
else
let netrw_origdir= s:NetrwGetcwd(1)
call s:NetrwLcd(b:netrw_curdir)
-" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">")
- call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
+" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">",'~'.expand("<slnum>"))
+ call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.s:ShellEscape(newdirname,1))
if v:shell_error != 0
let @@= ykeep
call netrw#ErrorMsg(s:ERROR,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
-" call Dret("s:NetrwMakeDir : failed: sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
+" call Dret("s:NetrwMakeDir : failed: sil! !".g:netrw_localmkdir.' '.s:ShellEscape(newdirname,1))
return
endif
if !g:netrw_keepdir
-" call Decho("restoring netrw_origdir since g:netrw_keepdir=".g:netrw_keepdir)
+" call Decho("restoring netrw_origdir since g:netrw_keepdir=".g:netrw_keepdir,'~'.expand("<slnum>"))
call s:NetrwLcd(netrw_origdir)
endif
endif
if v:shell_error == 0
" refresh listing
-" call Decho("refresh listing")
+" call Decho("refresh listing",'~'.expand("<slnum>"))
let svpos= netrw#SavePosn()
call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
call netrw#RestorePosn(svpos)
@@ -5749,10 +5830,10 @@ fun! s:NetrwMakeDir(usrhost)
elseif !exists("b:netrw_method") || b:netrw_method == 4
" Remote mkdir: using ssh
-" call Decho("remote mkdir")
+" call Decho("remote mkdir",'~'.expand("<slnum>"))
let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd)
let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname
- call s:NetrwExe("sil! !".mkdircmd." ".shellescape(newdirname,1))
+ call s:NetrwExe("sil! !".mkdircmd." ".s:ShellEscape(newdirname,1))
if v:shell_error == 0
" refresh listing
let svpos= netrw#SavePosn()
@@ -5766,9 +5847,9 @@ fun! s:NetrwMakeDir(usrhost)
elseif b:netrw_method == 2
" Remote mkdir: using ftp+.netrc
let svpos= netrw#SavePosn()
-" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
+" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
if exists("b:netrw_fname")
-" call Decho("b:netrw_fname<".b:netrw_fname.">")
+" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("<slnum>"))
let remotepath= b:netrw_fname
else
let remotepath= ""
@@ -5780,9 +5861,9 @@ fun! s:NetrwMakeDir(usrhost)
elseif b:netrw_method == 3
" Remote mkdir: using ftp + machine, id, passwd, and fname (ie. no .netrc)
let svpos= netrw#SavePosn()
-" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
+" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
if exists("b:netrw_fname")
-" call Decho("b:netrw_fname<".b:netrw_fname.">")
+" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("<slnum>"))
let remotepath= b:netrw_fname
else
let remotepath= ""
@@ -5805,19 +5886,19 @@ fun! s:TreeSqueezeDir(islocal)
let curdepth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
let iline = line(".") - 1
let stopline = (exists("w:netrw_bannercnt")? (w:netrw_bannercnt + 1) : 1)
-" call Decho("curdepth=".curdepth)
-" call Decho("stopline#".stopline)
-" call Decho("starting with line#".line(".").": ".getline('.'))
+" call Decho("curdepth=".curdepth,'~'.expand("<slnum>"))
+" call Decho("stopline#".stopline,'~'.expand("<slnum>"))
+" call Decho("starting with line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
while iline > stopline
" find a line that has less depth
let depth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
-" call Decho("considering line#".line(".").": ".getline('.'))
+" call Decho("considering line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
if depth < curdepth
break
endif
norm! k
endwhile
-" call Decho("squeezing at line#".line(".").": ".getline('.'))
+" call Decho("squeezing at line#".line(".").": ".getline('.'),'~'.expand("<slnum>"))
call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,s:NetrwGetWord()))
endif
" call Dret("s:TreeSqueezeDir")
@@ -5829,128 +5910,130 @@ fun! s:NetrwMaps(islocal)
" call Dfunc("s:NetrwMaps(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">")
if g:netrw_mousemaps && g:netrw_retmap
-" call Decho("set up Rexplore 2-leftmouse")
+" call Decho("set up Rexplore 2-leftmouse",'~'.expand("<slnum>"))
if !hasmapto("<Plug>NetrwReturn")
if maparg("<2-leftmouse>","n") == "" || maparg("<2-leftmouse>","n") =~ '^-$'
-" call Decho("making map for 2-leftmouse")
+" call Decho("making map for 2-leftmouse",'~'.expand("<slnum>"))
nmap <unique> <silent> <2-leftmouse> <Plug>NetrwReturn
elseif maparg("<c-leftmouse>","n") == ""
-" call Decho("making map for c-leftmouse")
+" call Decho("making map for c-leftmouse",'~'.expand("<slnum>"))
nmap <unique> <silent> <c-leftmouse> <Plug>NetrwReturn
endif
endif
nno <silent> <Plug>NetrwReturn :Rexplore<cr>
-" call Decho("made <Plug>NetrwReturn map")
+" call Decho("made <Plug>NetrwReturn map",'~'.expand("<slnum>"))
endif
if a:islocal
-" call Decho("make local maps")
+" call Decho("make local maps",'~'.expand("<slnum>"))
" local normal-mode maps
- nnoremap <buffer> <silent> a :call <SID>NetrwHide(1)<cr>
- nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr>
- nnoremap <buffer> <silent> c :call <SID>NetrwLcd(b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> C :<c-u>call <SID>NetrwSetChgwin()<cr>
- nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
- nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(1)<cr>
- nnoremap <buffer> <silent> <c-r> :call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr>
- nnoremap <buffer> <silent> - :call <SID>NetrwBrowseUpDir(1)<cr>
- nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> gd :<c-u>call <SID>NetrwForceChgDir(1,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> gf :<c-u>call <SID>NetrwForceFile(1,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(1)<cr>
- nnoremap <buffer> <silent> gp :<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> I :call <SID>NetrwBannerCtrl(1)<cr>
- nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(1)<cr>
- nnoremap <buffer> <silent> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mc :<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
- nnoremap <buffer> <silent> md :<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
- nnoremap <buffer> <silent> me :<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
- nnoremap <buffer> <silent> mf :<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> mF :<c-u>call <SID>NetrwUnmarkList(bufnr("%"),b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mg :<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
- nnoremap <buffer> <silent> mh :<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
- nnoremap <buffer> <silent> mm :<c-u>call <SID>NetrwMarkFileMove(1)<cr>
- nnoremap <buffer> <silent> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
- nnoremap <buffer> <silent> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
- nnoremap <buffer> <silent> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr>
- nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
- nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
- nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(1)<cr>
- nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
- nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
- nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
- nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
- nnoremap <buffer> <silent> O :call <SID>NetrwObtain(1)<cr>
- nnoremap <buffer> <silent> o :call <SID>NetrwSplit(3)<cr>
- nnoremap <buffer> <silent> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- nnoremap <buffer> <silent> P :call <SID>NetrwPrevWinOpen(1)<cr>
- nnoremap <buffer> <silent> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> qf :<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
- nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
- nnoremap <buffer> <silent> s :call <SID>NetrwSortStyle(1)<cr>
- nnoremap <buffer> <silent> S :call <SID>NetSortSequence(1)<cr>
- nnoremap <buffer> <silent> t :call <SID>NetrwSplit(4)<cr>
- nnoremap <buffer> <silent> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- nnoremap <buffer> <silent> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
- nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
- nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr>
- nnoremap <buffer> <silent> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
- nnoremap <buffer> <silent> X :call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
+ nnoremap <buffer> <silent> <nowait> a :call <SID>NetrwHide(1)<cr>
+ nnoremap <buffer> <silent> <nowait> % :call <SID>NetrwOpenFile(1)<cr>
+ nnoremap <buffer> <silent> <nowait> c :call <SID>NetrwLcd(b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> C :<c-u>call <SID>NetrwSetChgwin()<cr>
+ nnoremap <buffer> <silent> <nowait> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> <nowait> <s-cr> :call <SID>TreeSqueezeDir(1)<cr>
+ nnoremap <buffer> <silent> <nowait> <c-r> :call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> d :call <SID>NetrwMakeDir("")<cr>
+ nnoremap <buffer> <silent> <nowait> - :call <SID>NetrwBrowseUpDir(1)<cr>
+ nnoremap <buffer> <silent> <nowait> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> gd :<c-u>call <SID>NetrwForceChgDir(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gf :<c-u>call <SID>NetrwForceFile(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gh :<c-u>call <SID>NetrwHidden(1)<cr>
+ nnoremap <buffer> <silent> <nowait> gn :<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gp :<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> I :call <SID>NetrwBannerCtrl(1)<cr>
+ nnoremap <buffer> <silent> <nowait> i :call <SID>NetrwListStyle(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mc :<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
+ nnoremap <buffer> <silent> <nowait> md :<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
+ nnoremap <buffer> <silent> <nowait> me :<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mf :<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> mF :<c-u>call <SID>NetrwUnmarkList(bufnr("%"),b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
+ nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mu :<c-u>call <SID>NetrwUnMarkFile(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ nnoremap <buffer> <silent> <nowait> mx :<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+ nnoremap <buffer> <silent> <nowait> mX :<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
+ nnoremap <buffer> <silent> <nowait> mz :<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
+ nnoremap <buffer> <silent> <nowait> O :call <SID>NetrwObtain(1)<cr>
+ nnoremap <buffer> <silent> <nowait> o :call <SID>NetrwSplit(3)<cr>
+ nnoremap <buffer> <silent> <nowait> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> <nowait> P :call <SID>NetrwPrevWinOpen(1)<cr>
+ nnoremap <buffer> <silent> <nowait> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> qf :<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
+ nnoremap <buffer> <silent> <nowait> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> s :call <SID>NetrwSortStyle(1)<cr>
+ nnoremap <buffer> <silent> <nowait> S :call <SID>NetSortSequence(1)<cr>
+ nnoremap <buffer> <silent> <nowait> t :call <SID>NetrwSplit(4)<cr>
+ nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
+ nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+ nnoremap <buffer> <silent> <nowait> u :<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
+ nnoremap <buffer> <silent> <nowait> U :<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
+ nnoremap <buffer> <silent> <nowait> v :call <SID>NetrwSplit(5)<cr>
+ nnoremap <buffer> <silent> <nowait> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ nnoremap <buffer> <silent> <nowait> X :call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
" local insert-mode maps
- inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr>
- inoremap <buffer> <silent> c <c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
- inoremap <buffer> <silent> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
- inoremap <buffer> <silent> C <c-o>:call <SID>NetrwSetChgwin()<cr>
- inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
- inoremap <buffer> <silent> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr>
- inoremap <buffer> <silent> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
- inoremap <buffer> <silent> <s-cr> <c-o>:call <SID>TreeSqueezeDir(1)<cr>
- inoremap <buffer> <silent> d <c-o>:call <SID>NetrwMakeDir("")<cr>
- inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(1)<cr>
- inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
- inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(1)<cr>
- inoremap <buffer> <silent> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
- inoremap <buffer> <silent> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
- inoremap <buffer> <silent> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
- inoremap <buffer> <silent> mf <c-o>:<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
- inoremap <buffer> <silent> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
- inoremap <buffer> <silent> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(1)<cr>
- inoremap <buffer> <silent> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
- inoremap <buffer> <silent> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
- inoremap <buffer> <silent> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(1)<cr>
- inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
- inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
- inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
- inoremap <buffer> <silent> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
- inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
- inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
- inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
- inoremap <buffer> <silent> O <c-o>:call <SID>NetrwObtain(1)<cr>
- inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(3)<cr>
- inoremap <buffer> <silent> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- inoremap <buffer> <silent> P <c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
- inoremap <buffer> <silent> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> qf <c-o>:<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
- inoremap <buffer> <silent> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
- inoremap <buffer> <silent> s <c-o>:call <SID>NetrwSortStyle(1)<cr>
- inoremap <buffer> <silent> S <c-o>:call <SID>NetSortSequence(1)<cr>
- inoremap <buffer> <silent> t <c-o>:call <SID>NetrwSplit(4)<cr>
- inoremap <buffer> <silent> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- inoremap <buffer> <silent> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
- inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
- inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(5)<cr>
- inoremap <buffer> <silent> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(1)<cr>
+ inoremap <buffer> <silent> <nowait> c <c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
+ inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
+ inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr>
+ inoremap <buffer> <silent> <nowait> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
+ inoremap <buffer> <silent> <nowait> <s-cr> <c-o>:call <SID>TreeSqueezeDir(1)<cr>
+ inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>
+ inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(1)<cr>
+ nnoremap <buffer> <silent> <nowait> gn :<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>
+ inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(1,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
+ inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(1)<cr>
+ inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
+ inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
+ inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
+ inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+ inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
+ inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
+ inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(1)<cr>
+ inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
+ inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
+ inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(1)<cr>
+ inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
+ inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
+ inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
+ inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+ inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
+ inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
+ inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(1)<cr>
+ inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(3)<cr>
+ inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
+ inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
+ inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(1,getqflist())<cr>
+ inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+ inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(1)<cr>
+ inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(1)<cr>
+ inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(4)<cr>
+ inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
+ inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+ inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
+ inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
+ inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(5)<cr>
+ inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
imap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
@@ -5960,7 +6043,7 @@ fun! s:NetrwMaps(islocal)
nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh
imap <buffer> <unique> <c-l> <Plug>NetrwRefresh
endif
- nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+ nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
if s:didstarstar || !mapcheck("<s-down>","n")
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
inoremap <buffer> <silent> <s-down> :Nexplore<cr>
@@ -5972,144 +6055,149 @@ fun! s:NetrwMaps(islocal)
let mapsafecurdir = escape(b:netrw_curdir, s:netrw_map_escape)
if g:netrw_mousemaps == 1
nmap <buffer> <leftmouse> <Plug>NetrwLeftmouse
- nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(1)<cr>
+ nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(1)<cr>
+ nmap <buffer> <c-leftmouse> <Plug>NetrwCLeftmouse
+ nno <buffer> <silent> <Plug>NetrwCLeftmouse <leftmouse>:call <SID>NetrwCLeftmouse(1)<cr>
nmap <buffer> <middlemouse> <Plug>NetrwMiddlemouse
- nno <buffer> <silent> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr>
+ nno <buffer> <silent> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr>
nmap <buffer> <s-leftmouse> <Plug>NetrwSLeftmouse
- nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwSLeftmouse(1)<cr>
+ nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwSLeftmouse(1)<cr>
nmap <buffer> <s-leftdrag> <Plug>NetrwSLeftdrag
- nno <buffer> <silent> <Plug>NetrwSLeftdrag <leftmouse>:call <SID>NetrwSLeftdrag(1)<cr>
+ nno <buffer> <silent> <Plug>NetrwSLeftdrag <leftmouse>:call <SID>NetrwSLeftdrag(1)<cr>
nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse
- nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
+ nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
imap <buffer> <leftmouse> <Plug>ILeftmouse
- ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr>
+ ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr>
imap <buffer> <middlemouse> <Plug>IMiddlemouse
- ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
+ ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr>
imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
- ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+ ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
endif
- exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr>'
- exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> <del> <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> D <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> R <c-o>:call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
- exe 'inoremap <buffer> <silent> d <c-o>:call <SID>NetrwMakeDir("")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> d :call <SID>NetrwMakeDir("")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> D :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> R :call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwLocalRename("'.mapsafecurdir.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("")<cr>'
nnoremap <buffer> <F1> :he netrw-quickhelp<cr>
+ " support user-specified maps
+ call netrw#UserMaps(1)
+
else " remote
-" call Decho("make remote maps")
+" call Decho("make remote maps",'~'.expand("<slnum>"))
call s:RemotePathAnalysis(b:netrw_curdir)
" remote normal-mode maps
- nnoremap <buffer> <silent> <cr> :call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
- nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(0)<cr>
- nnoremap <buffer> <silent> <c-l> :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> <c-r> :call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> - :call <SID>NetrwBrowseUpDir(0)<cr>
- nnoremap <buffer> <silent> a :call <SID>NetrwHide(0)<cr>
- nnoremap <buffer> <silent> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mc :<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
- nnoremap <buffer> <silent> md :<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
- nnoremap <buffer> <silent> me :<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
- nnoremap <buffer> <silent> mf :<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> mF :<c-u>call <SID>NetrwUnmarkList(bufnr("%"),b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mg :<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
- nnoremap <buffer> <silent> mh :<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
- nnoremap <buffer> <silent> mm :<c-u>call <SID>NetrwMarkFileMove(0)<cr>
- nnoremap <buffer> <silent> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
- nnoremap <buffer> <silent> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
- nnoremap <buffer> <silent> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr>
- nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
- nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
- nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(0)<cr>
- nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
- nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
- nnoremap <buffer> <silent> mX :<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
- nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
- nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> gd :<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(0)<cr>
- nnoremap <buffer> <silent> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> C :<c-u>call <SID>NetrwSetChgwin()<cr>
- nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(0)<cr>
- nnoremap <buffer> <silent> I :call <SID>NetrwBannerCtrl(1)<cr>
- nnoremap <buffer> <silent> o :call <SID>NetrwSplit(0)<cr>
- nnoremap <buffer> <silent> O :call <SID>NetrwObtain(0)<cr>
- nnoremap <buffer> <silent> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- nnoremap <buffer> <silent> P :call <SID>NetrwPrevWinOpen(0)<cr>
- nnoremap <buffer> <silent> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> qf :<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
- nnoremap <buffer> <silent> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
- nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> s :call <SID>NetrwSortStyle(0)<cr>
- nnoremap <buffer> <silent> S :call <SID>NetSortSequence(0)<cr>
- nnoremap <buffer> <silent> t :call <SID>NetrwSplit(1)<cr>
- nnoremap <buffer> <silent> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- nnoremap <buffer> <silent> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> v :call <SID>NetrwSplit(2)<cr>
- nnoremap <buffer> <silent> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
- nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(0)<cr>
+ nnoremap <buffer> <silent> <nowait> <cr> :call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> <nowait> <s-cr> :call <SID>TreeSqueezeDir(0)<cr>
+ nnoremap <buffer> <silent> <nowait> <c-l> :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> <c-r> :call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> - :call <SID>NetrwBrowseUpDir(0)<cr>
+ nnoremap <buffer> <silent> <nowait> a :call <SID>NetrwHide(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mb :<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mc :<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
+ nnoremap <buffer> <silent> <nowait> md :<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
+ nnoremap <buffer> <silent> <nowait> me :<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mf :<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> mF :<c-u>call <SID>NetrwUnmarkList(bufnr("%"),b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
+ nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mu :<c-u>call <SID>NetrwUnMarkFile(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mx :<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+ nnoremap <buffer> <silent> <nowait> mX :<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
+ nnoremap <buffer> <silent> <nowait> mz :<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
+ nnoremap <buffer> <silent> <nowait> gb :<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> gd :<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> gh :<c-u>call <SID>NetrwHidden(0)<cr>
+ nnoremap <buffer> <silent> <nowait> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> C :<c-u>call <SID>NetrwSetChgwin()<cr>
+ nnoremap <buffer> <silent> <nowait> i :call <SID>NetrwListStyle(0)<cr>
+ nnoremap <buffer> <silent> <nowait> I :call <SID>NetrwBannerCtrl(1)<cr>
+ nnoremap <buffer> <silent> <nowait> o :call <SID>NetrwSplit(0)<cr>
+ nnoremap <buffer> <silent> <nowait> O :call <SID>NetrwObtain(0)<cr>
+ nnoremap <buffer> <silent> <nowait> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> <nowait> P :call <SID>NetrwPrevWinOpen(0)<cr>
+ nnoremap <buffer> <silent> <nowait> qb :<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> mB :<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> qf :<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
+ nnoremap <buffer> <silent> <nowait> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> <nowait> s :call <SID>NetrwSortStyle(0)<cr>
+ nnoremap <buffer> <silent> <nowait> S :call <SID>NetSortSequence(0)<cr>
+ nnoremap <buffer> <silent> <nowait> t :call <SID>NetrwSplit(1)<cr>
+ nnoremap <buffer> <silent> <nowait> Tb :<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
+ nnoremap <buffer> <silent> <nowait> Th :<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+ nnoremap <buffer> <silent> <nowait> u :<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> U :<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> <nowait> v :call <SID>NetrwSplit(2)<cr>
+ nnoremap <buffer> <silent> <nowait> x :call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+ nnoremap <buffer> <silent> <nowait> % :call <SID>NetrwOpenFile(0)<cr>
" remote insert-mode maps
- inoremap <buffer> <silent> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
- inoremap <buffer> <silent> <c-l> <c-o>:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- inoremap <buffer> <silent> <s-cr> <c-o>:call <SID>TreeSqueezeDir(0)<cr>
- inoremap <buffer> <silent> - <c-o>:call <SID>NetrwBrowseUpDir(0)<cr>
- inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(0)<cr>
- inoremap <buffer> <silent> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
- inoremap <buffer> <silent> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
- inoremap <buffer> <silent> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
- inoremap <buffer> <silent> mf <c-o>:<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
- inoremap <buffer> <silent> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
- inoremap <buffer> <silent> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(0)<cr>
- inoremap <buffer> <silent> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
- inoremap <buffer> <silent> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
- inoremap <buffer> <silent> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(0)<cr>
- inoremap <buffer> <silent> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
- inoremap <buffer> <silent> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
- inoremap <buffer> <silent> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
- nnoremap <buffer> <silent> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
- inoremap <buffer> <silent> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
- inoremap <buffer> <silent> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
- inoremap <buffer> <silent> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
- inoremap <buffer> <silent> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
- inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
- inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> C <c-o>:call <SID>NetrwSetChgwin()<cr>
- inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(0)<cr>
- inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
- inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(0)<cr>
- inoremap <buffer> <silent> O <c-o>:call <SID>NetrwObtain(0)<cr>
- inoremap <buffer> <silent> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
- inoremap <buffer> <silent> P <c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
- inoremap <buffer> <silent> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> qf <c-o>:<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
- inoremap <buffer> <silent> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
- inoremap <buffer> <silent> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
- inoremap <buffer> <silent> s <c-o>:call <SID>NetrwSortStyle(0)<cr>
- inoremap <buffer> <silent> S <c-o>:call <SID>NetSortSequence(0)<cr>
- inoremap <buffer> <silent> t <c-o>:call <SID>NetrwSplit(1)<cr>
- inoremap <buffer> <silent> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
- inoremap <buffer> <silent> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
- inoremap <buffer> <silent> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
- inoremap <buffer> <silent> v <c-o>:call <SID>NetrwSplit(2)<cr>
- inoremap <buffer> <silent> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
- inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(0)<cr>
+ inoremap <buffer> <silent> <nowait> <cr> <c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
+ inoremap <buffer> <silent> <nowait> <c-l> <c-o>:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ inoremap <buffer> <silent> <nowait> <s-cr> <c-o>:call <SID>TreeSqueezeDir(0)<cr>
+ inoremap <buffer> <silent> <nowait> - <c-o>:call <SID>NetrwBrowseUpDir(0)<cr>
+ inoremap <buffer> <silent> <nowait> a <c-o>:call <SID>NetrwHide(0)<cr>
+ inoremap <buffer> <silent> <nowait> mb <c-o>:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> mc <c-o>:<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
+ inoremap <buffer> <silent> <nowait> md <c-o>:<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
+ inoremap <buffer> <silent> <nowait> me <c-o>:<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
+ inoremap <buffer> <silent> <nowait> mf <c-o>:<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+ inoremap <buffer> <silent> <nowait> mg <c-o>:<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
+ inoremap <buffer> <silent> <nowait> mh <c-o>:<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
+ inoremap <buffer> <silent> <nowait> mm <c-o>:<c-u>call <SID>NetrwMarkFileMove(0)<cr>
+ inoremap <buffer> <silent> <nowait> mp <c-o>:<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
+ inoremap <buffer> <silent> <nowait> mr <c-o>:<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
+ inoremap <buffer> <silent> <nowait> ms <c-o>:<c-u>call <SID>NetrwMarkFileSource(0)<cr>
+ inoremap <buffer> <silent> <nowait> mt <c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
+ inoremap <buffer> <silent> <nowait> mT <c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
+ inoremap <buffer> <silent> <nowait> mu <c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
+ nnoremap <buffer> <silent> <nowait> mv :<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+ inoremap <buffer> <silent> <nowait> mx <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+ inoremap <buffer> <silent> <nowait> mX <c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
+ inoremap <buffer> <silent> <nowait> mv <c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+ inoremap <buffer> <silent> <nowait> mz <c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
+ inoremap <buffer> <silent> <nowait> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
+ inoremap <buffer> <silent> <nowait> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> C <c-o>:call <SID>NetrwSetChgwin()<cr>
+ inoremap <buffer> <silent> <nowait> i <c-o>:call <SID>NetrwListStyle(0)<cr>
+ inoremap <buffer> <silent> <nowait> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
+ inoremap <buffer> <silent> <nowait> o <c-o>:call <SID>NetrwSplit(0)<cr>
+ inoremap <buffer> <silent> <nowait> O <c-o>:call <SID>NetrwObtain(0)<cr>
+ inoremap <buffer> <silent> <nowait> p <c-o>:call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ inoremap <buffer> <silent> <nowait> P <c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
+ inoremap <buffer> <silent> <nowait> qb <c-o>:<c-u>call <SID>NetrwBookHistHandler(2,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> mB <c-o>:<c-u>call <SID>NetrwBookHistHandler(6,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> qf <c-o>:<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
+ inoremap <buffer> <silent> <nowait> qF :<c-u>call <SID>NetrwMarkFileQFEL(0,getqflist())<cr>
+ inoremap <buffer> <silent> <nowait> r <c-o>:let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ inoremap <buffer> <silent> <nowait> s <c-o>:call <SID>NetrwSortStyle(0)<cr>
+ inoremap <buffer> <silent> <nowait> S <c-o>:call <SID>NetSortSequence(0)<cr>
+ inoremap <buffer> <silent> <nowait> t <c-o>:call <SID>NetrwSplit(1)<cr>
+ inoremap <buffer> <silent> <nowait> Tb <c-o>:<c-u>call <SID>NetrwSetTgt('b',v:count1)<cr>
+ inoremap <buffer> <silent> <nowait> Th <c-o>:<c-u>call <SID>NetrwSetTgt('h',v:count)<cr>
+ inoremap <buffer> <silent> <nowait> u <c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> U <c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
+ inoremap <buffer> <silent> <nowait> v <c-o>:call <SID>NetrwSplit(2)<cr>
+ inoremap <buffer> <silent> <nowait> x <c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+ inoremap <buffer> <silent> <nowait> % <c-o>:call <SID>NetrwOpenFile(0)<cr>
if !hasmapto('<Plug>NetrwHideEdit')
nmap <buffer> <c-h> <Plug>NetrwHideEdit
imap <buffer> <c-h> <Plug>NetrwHideEdit
@@ -6125,44 +6213,45 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
if g:netrw_mousemaps == 1
- nmap <leftmouse> <Plug>NetrwLeftmouse
- nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(0)<cr>
- nmap <buffer> <leftdrag> <Plug>NetrwLeftdrag
- nno <buffer> <silent> <Plug>NetrwLeftdrag :call <SID>NetrwLeftdrag(0)<cr>
- nmap <buffer> <s-leftmouse> <Plug>NetrwSLeftmouse
- nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwSLeftmouse(0)<cr>
- nmap <buffer> <s-leftdrag> <Plug>NetrwSLeftdrag
- nno <buffer> <silent> <Plug>NetrwSLeftdrag <leftmouse>:call <SID>NetrwSLeftdrag(0)<cr>
- nmap <middlemouse> <Plug>NetrwMiddlemouse
- nno <buffer> <silent> <middlemouse> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(0)<cr>
- nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse
- nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
- imap <buffer> <leftmouse> <Plug>ILeftmouse
- ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr>
- imap <buffer> <middlemouse> <Plug>IMiddlemouse
- ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
- imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
- ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+ nmap <buffer> <leftmouse> <Plug>NetrwLeftmouse
+ nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(0)<cr>
+ nmap <buffer> <c-leftmouse> <Plug>NetrwCLeftmouse
+ nno <buffer> <silent> <Plug>NetrwCLeftmouse <leftmouse>:call <SID>NetrwCLeftmouse(0)<cr>
+ nmap <buffer> <s-leftmouse> <Plug>NetrwSLeftmouse
+ nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwSLeftmouse(0)<cr>
+ nmap <buffer> <s-leftdrag> <Plug>NetrwSLeftdrag
+ nno <buffer> <silent> <Plug>NetrwSLeftdrag <leftmouse>:call <SID>NetrwSLeftdrag(0)<cr>
+ nmap <middlemouse> <Plug>NetrwMiddlemouse
+ nno <buffer> <silent> <middlemouse> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(0)<cr>
+ nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse
+ nmap <buffer> <silent> <Plug>Netrw2Leftmouse -
+ imap <buffer> <leftmouse> <Plug>ILeftmouse
+ ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr>
+ imap <buffer> <middlemouse> <Plug>IMiddlemouse
+ ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr>
+ imap <buffer> <s-leftmouse> <Plug>ISLeftmouse
+ ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
endif
- exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
- exe 'nnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'nnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'vnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'vnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> <del> <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> d <c-o>:call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
- exe 'inoremap <buffer> <silent> D <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
- exe 'inoremap <buffer> <silent> R <c-o>:call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> d :call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <nowait> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> D :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <nowait> R :call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> <del> <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> d <c-o>:call <SID>NetrwMakeDir("'.mapsafeusermach.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> D <c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
+ exe 'inoremap <buffer> <silent> <nowait> R <c-o>:call <SID>NetrwRemoteRename("'.mapsafeusermach.'","'.mapsafepath.'")<cr>'
nnoremap <buffer> <F1> :he netrw-quickhelp<cr>
inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr>
- endif
- NetrwKeepj call s:SetRexDir(a:islocal,b:netrw_curdir)
+ " support user-specified maps
+ call netrw#UserMaps(0)
+ endif
" call Dret("s:NetrwMaps")
endfun
@@ -6184,9 +6273,6 @@ fun! s:NetrwCommands(islocal)
com! -buffer -nargs=+ -complete=file MF call s:NetrwMarkFiles(0,<f-args>)
endif
com! -buffer -nargs=? -complete=file MT call s:NetrwMarkTarget(<q-args>)
- " the following two commands are intended to be used for testing only, so I'm not advertising them in the manual
- com! -buffer -nargs=0 CRL call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
- com! -buffer -nargs=0 CRR call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))
" call Dret("s:NetrwCommands")
endfun
@@ -6196,16 +6282,21 @@ endfun
" glob()ing only works with local files
fun! s:NetrwMarkFiles(islocal,...)
" call Dfunc("s:NetrwMarkFiles(islocal=".a:islocal."...) a:0=".a:0)
- let i = 1
+ let curdir = s:NetrwGetCurdir(a:islocal)
+ let i = 1
while i <= a:0
if a:islocal
- let mffiles= glob(a:{i},0,1)
+ if v:version == 704 && has("patch656")
+ let mffiles= glob(a:{i},0,1,1)
+ else
+ let mffiles= glob(a:{i},0,1)
+ endif
else
let mffiles= [a:{i}]
endif
-" call Decho("mffiles".string(mffiles))
+" call Decho("mffiles".string(mffiles),'~'.expand("<slnum>"))
for mffile in mffiles
-" call Decho("mffile<".mffile.">")
+" call Decho("mffile<".mffile.">",'~'.expand("<slnum>"))
call s:NetrwMarkFile(a:islocal,mffile)
endfor
let i= i + 1
@@ -6214,18 +6305,20 @@ fun! s:NetrwMarkFiles(islocal,...)
endfun
" ---------------------------------------------------------------------
-" s:NetrwMarkTarget: {{{2
+" s:NetrwMarkTarget: implements :MT (mark target) {{{2
fun! s:NetrwMarkTarget(...)
" call Dfunc("s:NetrwMarkTarget() a:0=".a:0)
if a:0 == 0 || (a:0 == 1 && a:1 == "")
- let tgt= b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(1)
+ let tgt = b:netrw_curdir
else
- let tgt= a:1
+ let curdir = s:NetrwGetCurdir((a:1 =~ '^\a\{3,}://')? 0 : 1)
+ let tgt = a:1
endif
-" call Decho("tgt<".tgt.">")
+" call Decho("tgt<".tgt.">",'~'.expand("<slnum>"))
let s:netrwmftgt = tgt
- let s:netrwmftgt_islocal = tgt !~ '^\a\+://'
- let curislocal = b:netrw_curdir !~ '^\a\+://'
+ let s:netrwmftgt_islocal = tgt !~ '^\a\{3,}://'
+ let curislocal = b:netrw_curdir !~ '^\a\{3,}://'
let svpos = netrw#SavePosn()
call s:NetrwRefresh(curislocal,s:NetrwBrowseChgDir(curislocal,'./'))
call netrw#RestorePosn(svpos)
@@ -6251,16 +6344,17 @@ endfun
" b:netrw_islocal
fun! s:NetrwMarkFile(islocal,fname)
" call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)")
+" call Decho("bufnr(%)=".bufnr("%").": ".bufname("%"),'~'.expand("<slnum>"))
" sanity check
if empty(a:fname)
" call Dret("s:NetrwMarkFile : emtpy fname")
return
endif
+ let curdir = s:NetrwGetCurdir(a:islocal)
let ykeep = @@
let curbufnr= bufnr("%")
- let curdir = b:netrw_curdir
if a:fname =~ '^\a'
let leader= '\<'
else
@@ -6272,29 +6366,30 @@ fun! s:NetrwMarkFile(islocal,fname)
let trailer = '[@=|\/\*]\=\ze\%( \|\t\|$\)'
endif
- if exists("s:netrwmarkfilelist_{curbufnr}")
+ if exists("s:netrwmarkfilelist_".curbufnr)
" markfile list pre-exists
-" call Decho("starting s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
-" call Decho("starting s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">")
+" call Decho("case s:netrwmarkfilelist_".curbufnr." already exists",'~'.expand("<slnum>"))
+" call Decho("starting s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">",'~'.expand("<slnum>"))
+" call Decho("starting s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">",'~'.expand("<slnum>"))
let b:netrw_islocal= a:islocal
if index(s:netrwmarkfilelist_{curbufnr},a:fname) == -1
" append filename to buffer's markfilelist
-" call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+" call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">",'~'.expand("<slnum>"))
call add(s:netrwmarkfilelist_{curbufnr},a:fname)
let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|'.leader.escape(a:fname,g:netrw_markfileesc).trailer
else
" remove filename from buffer's markfilelist
-" call Decho("remove filename<".a:fname."> from local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+" call Decho("remove filename<".a:fname."> from local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">",'~'.expand("<slnum>"))
call filter(s:netrwmarkfilelist_{curbufnr},'v:val != a:fname')
if s:netrwmarkfilelist_{curbufnr} == []
" local markfilelist is empty; remove it entirely
-" call Decho("markfile list now empty")
+" call Decho("markfile list now empty",'~'.expand("<slnum>"))
call s:NetrwUnmarkList(curbufnr,curdir)
else
" rebuild match list to display markings correctly
-" call Decho("rebuild s:netrwmarkfilemtch_".curbufnr)
+" call Decho("rebuild s:netrwmarkfilemtch_".curbufnr,'~'.expand("<slnum>"))
let s:netrwmarkfilemtch_{curbufnr}= ""
let first = 1
for fname in s:netrwmarkfilelist_{curbufnr}
@@ -6305,17 +6400,18 @@ fun! s:NetrwMarkFile(islocal,fname)
endif
let first= 0
endfor
-" call Decho("ending s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+" call Decho("ending s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">",'~'.expand("<slnum>"))
endif
endif
else
" initialize new markfilelist
+" call Decho("case: initialize new markfilelist",'~'.expand("<slnum>"))
-" call Decho("add fname<".a:fname."> to new markfilelist_".curbufnr)
+" call Decho("add fname<".a:fname."> to new markfilelist_".curbufnr,'~'.expand("<slnum>"))
let s:netrwmarkfilelist_{curbufnr}= []
- call add(s:netrwmarkfilelist_{curbufnr},a:fname)
-" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
+ call add(s:netrwmarkfilelist_{curbufnr},substitute(a:fname,'[|@]$','',''))
+" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">",'~'.expand("<slnum>"))
" build initial markfile matching pattern
if a:fname =~ '/$'
@@ -6323,7 +6419,7 @@ fun! s:NetrwMarkFile(islocal,fname)
else
let s:netrwmarkfilemtch_{curbufnr}= leader.escape(a:fname,g:netrw_markfileesc).trailer
endif
-" call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">")
+" call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">",'~'.expand("<slnum>"))
endif
" handle global markfilelist
@@ -6332,12 +6428,12 @@ fun! s:NetrwMarkFile(islocal,fname)
if index(s:netrwmarkfilelist,dname) == -1
" append new filename to global markfilelist
call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
-" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">")
+" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">",'~'.expand("<slnum>"))
else
" remove new filename from global markfilelist
-" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")")
+" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")",'~'.expand("<slnum>"))
call filter(s:netrwmarkfilelist,'v:val != "'.dname.'"')
-" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">")
+" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">",'~'.expand("<slnum>"))
if s:netrwmarkfilelist == []
unlet s:netrwmarkfilelist
endif
@@ -6346,17 +6442,17 @@ fun! s:NetrwMarkFile(islocal,fname)
" initialize new global-directory markfilelist
let s:netrwmarkfilelist= []
call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
-" call Decho("init s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">")
+" call Decho("init s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">",'~'.expand("<slnum>"))
endif
- " set up 2match'ing to netrwmarkfilemtch list
+ " set up 2match'ing to netrwmarkfilemtch_# list
if exists("s:netrwmarkfilemtch_{curbufnr}") && s:netrwmarkfilemtch_{curbufnr} != ""
-" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/")
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/",'~'.expand("<slnum>"))
if exists("g:did_drchip_netrwlist_syntax")
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/"
endif
else
-" call Decho("2match none")
+" call Decho("2match none",'~'.expand("<slnum>"))
2match none
endif
let @@= ykeep
@@ -6374,7 +6470,7 @@ endfun
fun! s:NetrwMarkFileCompress(islocal)
" call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -6383,25 +6479,25 @@ fun! s:NetrwMarkFileCompress(islocal)
" call Dret("s:NetrwMarkFileCompress")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}") && exists("g:netrw_compress") && exists("g:netrw_decompress")
" for every filename in the marked list
for fname in s:netrwmarkfilelist_{curbufnr}
let sfx= substitute(fname,'^.\{-}\(\.\a\+\)$','\1','')
-" call Decho("extracted sfx<".sfx.">")
+" call Decho("extracted sfx<".sfx.">",'~'.expand("<slnum>"))
if exists("g:netrw_decompress['".sfx."']")
" fname has a suffix indicating that its compressed; apply associated decompression routine
let exe= g:netrw_decompress[sfx]
-" call Decho("fname<".fname."> is compressed so decompress with <".exe.">")
+" call Decho("fname<".fname."> is compressed so decompress with <".exe.">",'~'.expand("<slnum>"))
let exe= netrw#WinPath(exe)
if a:islocal
if g:netrw_keepdir
- let fname= shellescape(s:ComposePath(curdir,fname))
+ let fname= s:ShellEscape(s:ComposePath(curdir,fname))
endif
else
- let fname= shellescape(b:netrw_curdir.fname,1)
+ let fname= s:ShellEscape(b:netrw_curdir.fname,1)
endif
if executable(exe)
if a:islocal
@@ -6419,10 +6515,10 @@ fun! s:NetrwMarkFileCompress(islocal)
unlet exe
elseif a:islocal
" fname not a compressed file, so compress it
- call system(netrw#WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname)))
+ call system(netrw#WinPath(g:netrw_compress)." ".s:ShellEscape(s:ComposePath(b:netrw_curdir,fname)))
else
" fname not a compressed file, so compress it
- NetrwKeepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname))
+ NetrwKeepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".s:ShellEscape(fname))
endif
endfor " for every file in the marked list
@@ -6443,11 +6539,7 @@ endfun
fun! s:NetrwMarkFileCopy(islocal,...)
" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---')."> a:0=".a:0)
- if !exists("b:netrw_curdir")
- let b:netrw_curdir= getcwd()
-" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
- endif
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -6456,18 +6548,18 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" call Dret("s:NetrwMarkFileCopy")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if !exists("s:netrwmftgt")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67)
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
-" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
if a:islocal && s:netrwmftgt_islocal
" Copy marked files, local directory to local directory
-" call Decho("copy from local to local")
+" call Decho("copy from local to local",'~'.expand("<slnum>"))
if !executable(g:netrw_localcopycmd) && g:netrw_localcopycmd !~ '^'.expand("$COMSPEC").'\s'
call netrw#ErrorMsg(s:ERROR,"g:netrw_localcopycmd<".g:netrw_localcopycmd."> not executable on your system, aborting",91)
" call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!")
@@ -6478,17 +6570,17 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if simplify(s:netrwmftgt) == simplify(b:netrw_curdir)
if len(s:netrwmarkfilelist_{bufnr('%')}) == 1
" only one marked file
-" call Decho("case: only one marked file")
- let args = shellescape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
+" call Decho("case: only one marked file",'~'.expand("<slnum>"))
+ let args = s:ShellEscape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
let oldname = s:netrwmarkfilelist_{bufnr('%')}[0]
elseif a:0 == 1
-" call Decho("case: handling one input argument")
+" call Decho("case: handling one input argument",'~'.expand("<slnum>"))
" this happens when the next case was used to recursively call s:NetrwMarkFileCopy()
- let args = shellescape(b:netrw_curdir."/".a:1)
+ let args = s:ShellEscape(b:netrw_curdir."/".a:1)
let oldname = a:1
else
" copy multiple marked files inside the same directory
-" call Decho("case: handling a multiple marked files")
+" call Decho("case: handling a multiple marked files",'~'.expand("<slnum>"))
let s:recursive= 1
for oldname in s:netrwmarkfilelist_{bufnr("%")}
let ret= s:NetrwMarkFileCopy(a:islocal,oldname)
@@ -6509,11 +6601,11 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
- let args= shellescape(oldname)
- let tgt = shellescape(s:netrwmftgt.'/'.newname)
+ let args= s:ShellEscape(oldname)
+ let tgt = s:ShellEscape(s:netrwmftgt.'/'.newname)
else
- let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)"))
- let tgt = shellescape(s:netrwmftgt)
+ let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"s:ShellEscape(b:netrw_curdir.\"/\".v:val)"))
+ let tgt = s:ShellEscape(s:netrwmftgt)
endif
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
let args= substitute(args,'/','\\','g')
@@ -6521,16 +6613,17 @@ fun! s:NetrwMarkFileCopy(islocal,...)
endif
if args =~ "'"|let args= substitute(args,"'\\(.*\\)'",'\1','')|endif
if tgt =~ "'"|let tgt = substitute(tgt,"'\\(.*\\)'",'\1','') |endif
- if isdirectory(args)
-" call Decho("args<".args."> is a directory")
+ if args =~ '//$'|let args= substitute(args,'//$','/','')|endif
+ if isdirectory(s:NetrwFile(args))
+" call Decho("args<".args."> is a directory",'~'.expand("<slnum>"))
let copycmd= g:netrw_localcopydircmd
-" call Decho("using copydircmd<".copycmd.">")
+" call Decho("using copydircmd<".copycmd.">",'~'.expand("<slnum>"))
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
" window's xcopy doesn't copy a directory to a target properly. Instead, it copies a directory's
" contents to a target. One must append the source directory name to the target to get xcopy to
" do the right thing.
let tgt= tgt.'\'.substitute(a:1,'^.*[\\/]','','')
-" call Decho("modified tgt for xcopy")
+" call Decho("modified tgt for xcopy",'~'.expand("<slnum>"))
endif
else
let copycmd= g:netrw_localcopycmd
@@ -6542,30 +6635,34 @@ fun! s:NetrwMarkFileCopy(islocal,...)
else
let copycmd = netrw#WinPath(copycmd)
endif
-" call Decho("args <".args.">")
-" call Decho("tgt <".tgt.">")
-" call Decho("copycmd<".copycmd.">")
-" call Decho("system(".copycmd." '".args."' '".tgt."')")
+" call Decho("args <".args.">",'~'.expand("<slnum>"))
+" call Decho("tgt <".tgt.">",'~'.expand("<slnum>"))
+" call Decho("copycmd<".copycmd.">",'~'.expand("<slnum>"))
+" call Decho("system(".copycmd." '".args."' '".tgt."')",'~'.expand("<slnum>"))
call system(copycmd." '".args."' '".tgt."'")
if v:shell_error != 0
- call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localcopycmd<".g:netrw_localcopycmd.">; it doesn't work!",80)
-" call Dret("s:NetrwMarkFileCopy 0 : failed: system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt))
+ if exists("b:netrw_curdir") && b:netrw_curdir != getcwd() && !g:netrw_keepdir
+ call netrw#ErrorMsg(s:ERROR,"copy failed; perhaps due to vim's current directory<".getcwd()."> not matching netrw's (".b:netrw_curdir.") (see :help netrw-c)",101)
+ else
+ call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localcopycmd<".g:netrw_localcopycmd.">; it doesn't work!",80)
+ endif
+" call Dret("s:NetrwMarkFileCopy 0 : failed: system(".g:netrw_localcopycmd." ".args." ".s:ShellEscape(s:netrwmftgt))
return 0
endif
elseif a:islocal && !s:netrwmftgt_islocal
" Copy marked files, local directory to remote directory
-" call Decho("copy from local to remote")
+" call Decho("copy from local to remote",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && s:netrwmftgt_islocal
" Copy marked files, remote directory to local directory
-" call Decho("copy from remote to local")
+" call Decho("copy from remote to local",'~'.expand("<slnum>"))
NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && !s:netrwmftgt_islocal
" Copy marked files, remote directory to remote directory
-" call Decho("copy from remote to remote")
+" call Decho("copy from remote to remote",'~'.expand("<slnum>"))
let curdir = getcwd()
let tmpdir = s:GetTempfile("")
if tmpdir !~ '/'
@@ -6574,14 +6671,14 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if exists("*mkdir")
call mkdir(tmpdir)
else
- call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1))
+ call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.s:ShellEscape(tmpdir,1))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
-" call Dret("s:NetrwMarkFileCopy : failed: sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1) )
+" call Dret("s:NetrwMarkFileCopy : failed: sil! !".g:netrw_localmkdir.' '.s:ShellEscape(tmpdir,1) )
return
endif
endif
- if isdirectory(tmpdir)
+ if isdirectory(s:NetrwFile(tmpdir))
call s:NetrwLcd(tmpdir)
NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
let localfiles= map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")')
@@ -6591,10 +6688,10 @@ fun! s:NetrwMarkFileCopy(islocal,...)
NetrwKeepj call s:NetrwDelete(fname)
endfor
call s:NetrwLcd(curdir)
- call s:NetrwExe("sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1))
+ call s:NetrwExe("sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1))
if v:shell_error != 0
call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80)
-" call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1) )
+" call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".s:ShellEscape(tmpdir,1) )
return
endif
else
@@ -6606,7 +6703,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" -------
" cleanup
" -------
-" call Decho("cleanup")
+" call Decho("cleanup",'~'.expand("<slnum>"))
if !exists("s:recursive")
" remove markings from local buffer
call s:NetrwUnmarkList(curbufnr,curdir)
@@ -6622,7 +6719,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if g:netrw_fastbrowse <= 1
NetrwKeepj call s:LocalBrowseRefresh()
endif
-
+
" call Dret("s:NetrwMarkFileCopy 1")
return 1
endfun
@@ -6642,21 +6739,21 @@ fun! s:NetrwMarkFileDiff(islocal)
" call Dret("s:NetrwMarkFileDiff")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+ let curdir= s:NetrwGetCurdir(a:islocal)
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{".curbufnr."}")
let cnt = 0
- let curdir = b:netrw_curdir
for fname in s:netrwmarkfilelist
let cnt= cnt + 1
if cnt == 1
-" call Decho("diffthis: fname<".fname.">")
+" call Decho("diffthis: fname<".fname.">",'~'.expand("<slnum>"))
exe "NetrwKeepj e ".fnameescape(fname)
diffthis
elseif cnt == 2 || cnt == 3
vsplit
wincmd l
-" call Decho("diffthis: ".fname)
+" call Decho("diffthis: ".fname,'~'.expand("<slnum>"))
exe "NetrwKeepj e ".fnameescape(fname)
diffthis
else
@@ -6675,7 +6772,7 @@ endfun
fun! s:NetrwMarkFileEdit(islocal)
" call Dfunc("s:NetrwMarkFileEdit(islocal=".a:islocal.")")
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -6684,7 +6781,7 @@ fun! s:NetrwMarkFileEdit(islocal)
" call Dret("s:NetrwMarkFileEdit")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}")
call s:SetRexDir(a:islocal,curdir)
@@ -6692,11 +6789,11 @@ fun! s:NetrwMarkFileEdit(islocal)
" unmark markedfile list
" call s:NetrwUnmarkList(curbufnr,curdir)
call s:NetrwUnmarkAll()
-" call Decho("exe sil args ".flist)
+" call Decho("exe sil args ".flist,'~'.expand("<slnum>"))
exe "sil args ".flist
endif
echo "(use :bn, :bp to navigate files; :Rex to return)"
-
+
" call Dret("s:NetrwMarkFileEdit")
endfun
@@ -6710,17 +6807,17 @@ fun! s:NetrwMarkFileQFEL(islocal,qfel)
if !empty(a:qfel)
for entry in a:qfel
let bufnmbr= entry["bufnr"]
-" call Decho("bufname(".bufnmbr.")<".bufname(bufnmbr)."> line#".entry["lnum"]." text=".entry["text"])
+" call Decho("bufname(".bufnmbr.")<".bufname(bufnmbr)."> line#".entry["lnum"]." text=".entry["text"],'~'.expand("<slnum>"))
if !exists("s:netrwmarkfilelist_{curbufnr}")
-" call Decho("case: no marked file list")
+" call Decho("case: no marked file list",'~'.expand("<slnum>"))
call s:NetrwMarkFile(a:islocal,bufname(bufnmbr))
elseif index(s:netrwmarkfilelist_{curbufnr},bufname(bufnmbr)) == -1
" s:NetrwMarkFile will remove duplicate entries from the marked file list.
" So, this test lets two or more hits on the same pattern to be ignored.
-" call Decho("case: ".bufname(bufnmbr)." not currently in marked file list")
+" call Decho("case: ".bufname(bufnmbr)." not currently in marked file list",'~'.expand("<slnum>"))
call s:NetrwMarkFile(a:islocal,bufname(bufnmbr))
else
-" call Decho("case: ".bufname(bufnmbr)." already in marked file list")
+" call Decho("case: ".bufname(bufnmbr)." already in marked file list",'~'.expand("<slnum>"))
endif
endfor
echo "(use me to edit marked files)"
@@ -6738,7 +6835,7 @@ endfun
fun! s:NetrwMarkFileExe(islocal,enbloc)
" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.",enbloc=".a:enbloc.")")
let svpos = netrw#SavePosn()
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
if a:enbloc == 0
@@ -6749,14 +6846,14 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
" call Dret("s:NetrwMarkFileExe")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}")
" get the command
call inputsave()
let cmd= input("Enter command: ","","file")
call inputrestore()
-" call Decho("cmd<".cmd.">")
+" call Decho("cmd<".cmd.">",'~'.expand("<slnum>"))
if cmd == ""
" call Dret("s:NetrwMarkFileExe : early exit, empty command")
return
@@ -6767,10 +6864,10 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
for fname in s:netrwmarkfilelist_{curbufnr}
if a:islocal
if g:netrw_keepdir
- let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname)))
+ let fname= s:ShellEscape(netrw#WinPath(s:ComposePath(curdir,fname)))
endif
else
- let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname))
+ let fname= s:ShellEscape(netrw#WinPath(b:netrw_curdir.fname))
endif
if cmd =~ '%'
let xcmd= substitute(cmd,'%',fname,'g')
@@ -6778,10 +6875,10 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
let xcmd= cmd.' '.fname
endif
if a:islocal
-" call Decho("local: xcmd<".xcmd.">")
+" call Decho("local: xcmd<".xcmd.">",'~'.expand("<slnum>"))
let ret= system(xcmd)
else
-" call Decho("remote: xcmd<".xcmd.">")
+" call Decho("remote: xcmd<".xcmd.">",'~'.expand("<slnum>"))
let ret= s:RemoteSystem(xcmd)
endif
if v:shell_error < 0
@@ -6807,15 +6904,15 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
call inputsave()
let cmd= input("Enter command: ","","file")
call inputrestore()
-" call Decho("cmd<".cmd.">")
+" call Decho("cmd<".cmd.">",'~'.expand("<slnum>"))
if cmd == ""
" call Dret("s:NetrwMarkFileExe : early exit, empty command")
return
endif
if cmd =~ '%'
- let cmd= substitute(cmd,'%',join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' '),'g')
+ let cmd= substitute(cmd,'%',join(map(s:netrwmarkfilelist,'s:ShellEscape(v:val)'),' '),'g')
else
- let cmd= cmd.' '.join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' ')
+ let cmd= cmd.' '.join(map(s:netrwmarkfilelist,'s:ShellEscape(v:val)'),' ')
endif
if a:islocal
call system(cmd)
@@ -6832,7 +6929,7 @@ fun! s:NetrwMarkFileExe(islocal,enbloc)
NetrwKeepj call netrw#RestorePosn(svpos)
endif
-
+
" call Dret("s:NetrwMarkFileExe")
endfun
@@ -6849,7 +6946,7 @@ fun! s:NetrwMarkHideSfx(islocal)
if exists("s:netrwmarkfilelist_{curbufnr}")
for fname in s:netrwmarkfilelist_{curbufnr}
-" call Decho("s:NetrwMarkFileCopy: fname<".fname.">")
+" call Decho("s:NetrwMarkFileCopy: fname<".fname.">",'~'.expand("<slnum>"))
" construct suffix pattern
if fname =~ '\.'
let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','')
@@ -6869,7 +6966,7 @@ fun! s:NetrwMarkHideSfx(islocal)
let itemnum= itemnum + 1
endfor
endif
-" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">")
+" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">",'~'.expand("<slnum>"))
if inhidelist
" remove sfxpat from list
call remove(hidelist,itemnum)
@@ -6899,7 +6996,7 @@ endfun
fun! s:NetrwMarkFileVimCmd(islocal)
" call Dfunc("s:NetrwMarkFileVimCmd(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -6908,14 +7005,14 @@ fun! s:NetrwMarkFileVimCmd(islocal)
" call Dret("s:NetrwMarkFileVimCmd")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist_{curbufnr}")
" get the command
call inputsave()
let cmd= input("Enter vim command: ","","file")
call inputrestore()
-" call Decho("cmd<".cmd.">")
+" call Decho("cmd<".cmd.">",'~'.expand("<slnum>"))
if cmd == ""
" " call Dret("s:NetrwMarkFileVimCmd : early exit, empty command")
return
@@ -6924,15 +7021,15 @@ fun! s:NetrwMarkFileVimCmd(islocal)
" apply command to marked files. Substitute: filename -> %
" If no %, then append a space and the filename to the command
for fname in s:netrwmarkfilelist_{curbufnr}
-" call Decho("fname<".fname.">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
if a:islocal
1split
exe "sil! NetrwKeepj keepalt e ".fnameescape(fname)
-" call Decho("local<".fname.">: exe ".cmd)
+" call Decho("local<".fname.">: exe ".cmd,'~'.expand("<slnum>"))
exe cmd
exe "sil! keepalt wq!"
else
-" call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET")
+" call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET",'~'.expand("<slnum>"))
echo "sorry, \"mv\" not supported yet for remote files"
endif
endfor
@@ -6946,7 +7043,7 @@ fun! s:NetrwMarkFileVimCmd(islocal)
else
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
endif
-
+
" call Dret("s:NetrwMarkFileVimCmd")
endfun
@@ -6963,7 +7060,7 @@ fun! s:NetrwMarkHideSfx(islocal)
if exists("s:netrwmarkfilelist_{curbufnr}")
for fname in s:netrwmarkfilelist_{curbufnr}
-" call Decho("s:NetrwMarkFileCopy: fname<".fname.">")
+" call Decho("s:NetrwMarkFileCopy: fname<".fname.">",'~'.expand("<slnum>"))
" construct suffix pattern
if fname =~ '\.'
let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','')
@@ -6983,7 +7080,7 @@ fun! s:NetrwMarkHideSfx(islocal)
let itemnum= itemnum + 1
endfor
endif
-" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">")
+" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">",'~'.expand("<slnum>"))
if inhidelist
" remove sfxpat from list
call remove(hidelist,itemnum)
@@ -7014,13 +7111,14 @@ fun! s:NetrwMarkFileGrep(islocal)
" call Dfunc("s:NetrwMarkFileGrep(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
let curbufnr = bufnr("%")
+ let curdir = s:NetrwGetCurdir(a:islocal)
if exists("s:netrwmarkfilelist")
-" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">")
+" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">",'~'.expand("<slnum>"))
let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "fnameescape(v:val)"))
call s:NetrwUnmarkAll()
else
-" call Decho('no marked files, using "*"')
+" call Decho('no marked files, using "*"','~'.expand("<slnum>"))
let netrwmarkfilelist= "*"
endif
@@ -7031,7 +7129,7 @@ fun! s:NetrwMarkFileGrep(islocal)
let patbang = ""
if pat =~ '^!'
let patbang = "!"
- let pat= strpart(pat,2)
+ let pat = strpart(pat,2)
endif
if pat =~ '^\i'
let pat = escape(pat,'/')
@@ -7041,7 +7139,7 @@ fun! s:NetrwMarkFileGrep(islocal)
endif
" use vimgrep for both local and remote
-" call Decho("exe vimgrep".patbang." ".pat." ".netrwmarkfilelist)
+" call Decho("exe vimgrep".patbang." ".pat." ".netrwmarkfilelist,'~'.expand("<slnum>"))
try
exe "NetrwKeepj noautocmd vimgrep".patbang." ".pat." ".netrwmarkfilelist
catch /^Vim\%((\a\+)\)\=:E480/
@@ -7056,7 +7154,7 @@ fun! s:NetrwMarkFileGrep(islocal)
if exists("nonisi")
" original, user-supplied pattern did not begin with a character from isident
-" call Decho("looking for trailing nonisi<".nonisi."> followed by a j, gj, or jg")
+" call Decho("looking for trailing nonisi<".nonisi."> followed by a j, gj, or jg",'~'.expand("<slnum>"))
if pat =~ nonisi.'j$\|'.nonisi.'gj$\|'.nonisi.'jg$'
call s:NetrwMarkFileQFEL(a:islocal,getqflist())
endif
@@ -7072,7 +7170,7 @@ endfun
" = 1: target directory is local
fun! s:NetrwMarkFileMove(islocal)
" call Dfunc("s:NetrwMarkFileMove(islocal=".a:islocal.")")
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -7081,61 +7179,65 @@ fun! s:NetrwMarkFileMove(islocal)
" call Dret("s:NetrwMarkFileMove")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if !exists("s:netrwmftgt")
NetrwKeepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
-" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
if a:islocal && s:netrwmftgt_islocal
" move: local -> local
-" call Decho("move from local to local")
-" call Decho("local to local move")
+" call Decho("move from local to local",'~'.expand("<slnum>"))
+" call Decho("local to local move",'~'.expand("<slnum>"))
if !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~ '^'.expand("$COMSPEC").'\s'
call netrw#ErrorMsg(s:ERROR,"g:netrw_localmovecmd<".g:netrw_localmovecmd."> not executable on your system, aborting",90)
" call Dfunc("s:NetrwMarkFileMove : g:netrw_localmovecmd<".g:netrw_localmovecmd."> n/a!")
return
endif
- let tgt = shellescape(s:netrwmftgt)
-" call Decho("tgt<".tgt.">")
+ let tgt = s:ShellEscape(s:netrwmftgt)
+" call Decho("tgt<".tgt.">",'~'.expand("<slnum>"))
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
let tgt = substitute(tgt, '/','\\','g')
-" call Decho("windows exception: tgt<".tgt.">")
+" call Decho("windows exception: tgt<".tgt.">",'~'.expand("<slnum>"))
if g:netrw_localmovecmd =~ '\s'
let movecmd = substitute(g:netrw_localmovecmd,'\s.*$','','')
let movecmdargs = substitute(g:netrw_localmovecmd,'^.\{-}\(\s.*\)$','\1','')
let movecmd = netrw#WinPath(movecmd).movecmdargs
-" call Decho("windows exception: movecmd<".movecmd."> (#1: had a space)")
+" call Decho("windows exception: movecmd<".movecmd."> (#1: had a space)",'~'.expand("<slnum>"))
else
let movecmd = netrw#WinPath(movecmd)
-" call Decho("windows exception: movecmd<".movecmd."> (#2: no space)")
+" call Decho("windows exception: movecmd<".movecmd."> (#2: no space)",'~'.expand("<slnum>"))
endif
else
let movecmd = netrw#WinPath(g:netrw_localmovecmd)
-" call Decho("movecmd<".movecmd."> (#3 linux or cygwin)")
+" call Decho("movecmd<".movecmd."> (#3 linux or cygwin)",'~'.expand("<slnum>"))
endif
for fname in s:netrwmarkfilelist_{bufnr("%")}
-" call Decho("system(".movecmd." ".shellescape(fname)." ".tgt.")")
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
let fname= substitute(fname,'/','\\','g')
endif
- let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".tgt)
+" call Decho("system(".movecmd." ".s:ShellEscape(fname)." ".tgt.")",'~'.expand("<slnum>"))
+ let ret= system(movecmd." ".s:ShellEscape(fname)." ".tgt)
if v:shell_error != 0
- call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localmovecmd<".g:netrw_localmovecmd.">; it doesn't work!",54)
+ if exists("b:netrw_curdir") && b:netrw_curdir != getcwd() && !g:netrw_keepdir
+ call netrw#ErrorMsg(s:ERROR,"move failed; perhaps due to vim's current directory<".getcwd()."> not matching netrw's (".b:netrw_curdir.") (see :help netrw-c)",100)
+ else
+ call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localmovecmd<".g:netrw_localmovecmd.">; it doesn't work!",54)
+ endif
break
endif
endfor
elseif a:islocal && !s:netrwmftgt_islocal
" move: local -> remote
-" call Decho("move from local to remote")
-" call Decho("copy")
+" call Decho("move from local to remote",'~'.expand("<slnum>"))
+" call Decho("copy",'~'.expand("<slnum>"))
let mflist= s:netrwmarkfilelist_{bufnr("%")}
NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
-" call Decho("remove")
+" call Decho("remove",'~'.expand("<slnum>"))
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok = s:NetrwLocalRmFile(b:netrw_curdir,barefname,1)
@@ -7144,11 +7246,11 @@ fun! s:NetrwMarkFileMove(islocal)
elseif !a:islocal && s:netrwmftgt_islocal
" move: remote -> local
-" call Decho("move from remote to local")
-" call Decho("copy")
+" call Decho("move from remote to local",'~'.expand("<slnum>"))
+" call Decho("copy",'~'.expand("<slnum>"))
let mflist= s:netrwmarkfilelist_{bufnr("%")}
NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
-" call Decho("remove")
+" call Decho("remove",'~'.expand("<slnum>"))
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1)
@@ -7157,11 +7259,11 @@ fun! s:NetrwMarkFileMove(islocal)
elseif !a:islocal && !s:netrwmftgt_islocal
" move: remote -> remote
-" call Decho("move from remote to remote")
-" call Decho("copy")
+" call Decho("move from remote to remote",'~'.expand("<slnum>"))
+" call Decho("copy",'~'.expand("<slnum>"))
let mflist= s:netrwmarkfilelist_{bufnr("%")}
NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
-" call Decho("remove")
+" call Decho("remove",'~'.expand("<slnum>"))
for fname in mflist
let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1)
@@ -7172,25 +7274,25 @@ fun! s:NetrwMarkFileMove(islocal)
" -------
" cleanup
" -------
-" call Decho("cleanup")
+" call Decho("cleanup",'~'.expand("<slnum>"))
" remove markings from local buffer
call s:NetrwUnmarkList(curbufnr,curdir) " remove markings from local buffer
" refresh buffers
if !s:netrwmftgt_islocal
-" call Decho("refresh netrwmftgt<".s:netrwmftgt.">")
+" call Decho("refresh netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
endif
if a:islocal
-" call Decho("refresh b:netrw_curdir<".b:netrw_curdir.">")
+" call Decho("refresh b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
endif
if g:netrw_fastbrowse <= 1
-" call Decho("since g:netrw_fastbrowse=".g:netrw_fastbrowse.", perform shell cmd refresh")
+" call Decho("since g:netrw_fastbrowse=".g:netrw_fastbrowse.", perform shell cmd refresh",'~'.expand("<slnum>"))
NetrwKeepj call s:LocalBrowseRefresh()
endif
-
+
" call Dret("s:NetrwMarkFileMove")
endfun
@@ -7207,10 +7309,11 @@ fun! s:NetrwMarkFilePrint(islocal)
" call Dret("s:NetrwMarkFilePrint")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
+ let curdir= s:NetrwGetCurdir(a:islocal)
+
if exists("s:netrwmarkfilelist_{curbufnr}")
let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr}
- let curdir = b:netrw_curdir
call s:NetrwUnmarkList(curbufnr,curdir)
for fname in netrwmarkfilelist
if a:islocal
@@ -7222,9 +7325,9 @@ fun! s:NetrwMarkFilePrint(islocal)
endif
1split
" the autocmds will handle both local and remote files
-" call Decho("exe sil e ".escape(fname,' '))
+" call Decho("exe sil e ".escape(fname,' '),'~'.expand("<slnum>"))
exe "sil NetrwKeepj e ".fnameescape(fname)
-" call Decho("hardcopy")
+" call Decho("hardcopy",'~'.expand("<slnum>"))
hardcopy
q
endfor
@@ -7246,28 +7349,33 @@ fun! s:NetrwMarkFileRegexp(islocal)
call inputrestore()
if a:islocal
+ let curdir= s:NetrwGetCurdir(a:islocal)
" get the matching list of files using local glob()
-" call Decho("handle local regexp")
+" call Decho("handle local regexp",'~'.expand("<slnum>"))
let dirname = escape(b:netrw_curdir,g:netrw_glob_escape)
- let files = glob(s:ComposePath(dirname,regexp))
-" call Decho("files<".files.">")
+ if v:version == 704 && has("patch656")
+ let files = glob(s:ComposePath(dirname,regexp),0,0,1)
+ else
+ let files = glob(s:ComposePath(dirname,regexp),0,0)
+ endif
+" call Decho("files<".files.">",'~'.expand("<slnum>"))
let filelist= split(files,"\n")
" mark the list of files
for fname in filelist
-" call Decho("fname<".fname.">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','',''))
endfor
else
-" call Decho("handle remote regexp")
+" call Decho("handle remote regexp",'~'.expand("<slnum>"))
" convert displayed listing into a filelist
let eikeep = &ei
let areg = @a
sil NetrwKeepj %y a
setl ei=all ma
-" call Decho("setl ei=all ma")
+" call Decho("setl ei=all ma",'~'.expand("<slnum>"))
1split
NetrwKeepj call s:NetrwEnew()
NetrwKeepj call s:NetrwSafeOptions()
@@ -7290,7 +7398,7 @@ fun! s:NetrwMarkFileRegexp(islocal)
endif
" convert regexp into the more usual glob-style format
let regexp= substitute(regexp,'\*','.*','g')
-" call Decho("regexp<".regexp.">")
+" call Decho("regexp<".regexp.">",'~'.expand("<slnum>"))
exe "sil! NetrwKeepj v/".escape(regexp,'/')."/d"
call histdel("/",-1)
let filelist= getline(1,line("$"))
@@ -7320,10 +7428,11 @@ fun! s:NetrwMarkFileSource(islocal)
" call Dret("s:NetrwMarkFileSource")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
+ let curdir= s:NetrwGetCurdir(a:islocal)
+
if exists("s:netrwmarkfilelist_{curbufnr}")
let netrwmarkfilelist = s:netrwmarkfilelist_{bufnr("%")}
- let curdir = b:netrw_curdir
call s:NetrwUnmarkList(curbufnr,curdir)
for fname in netrwmarkfilelist
if a:islocal
@@ -7334,7 +7443,7 @@ fun! s:NetrwMarkFileSource(islocal)
let fname= curdir.fname
endif
" the autocmds will handle sourcing both local and remote files
-" call Decho("exe so ".fnameescape(fname))
+" call Decho("exe so ".fnameescape(fname),'~'.expand("<slnum>"))
exe "so ".fnameescape(fname)
endfor
2match none
@@ -7348,7 +7457,7 @@ endfun
fun! s:NetrwMarkFileTag(islocal)
" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let curbufnr = bufnr("%")
" sanity check
@@ -7357,16 +7466,16 @@ fun! s:NetrwMarkFileTag(islocal)
" call Dret("s:NetrwMarkFileTag")
return
endif
-" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
if exists("s:netrwmarkfilelist")
-" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">")
- let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "shellescape(v:val,".!a:islocal.")"))
+" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">",'~'.expand("<slnum>"))
+ let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "s:ShellEscape(v:val,".!a:islocal.")"))
call s:NetrwUnmarkAll()
if a:islocal
if executable(g:netrw_ctags)
-" call Decho("call system(".g:netrw_ctags." ".netrwmarkfilelist.")")
+" call Decho("call system(".g:netrw_ctags." ".netrwmarkfilelist.")",'~'.expand("<slnum>"))
call system(g:netrw_ctags." ".netrwmarkfilelist)
else
call netrw#ErrorMsg(s:ERROR,"g:netrw_ctags<".g:netrw_ctags."> is not executable!",51)
@@ -7378,7 +7487,7 @@ fun! s:NetrwMarkFileTag(islocal)
1split
NetrwKeepj e tags
let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','')
-" call Decho("curdir<".curdir."> path<".path.">")
+" call Decho("curdir<".curdir."> path<".path.">",'~'.expand("<slnum>"))
exe 'NetrwKeepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e'
call histdel("/",-1)
wq!
@@ -7393,14 +7502,14 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwMarkFileTgt: (invoked by mt) This function sets up a marked file target {{{2
-" Sets up two variables,
+" Sets up two variables,
" s:netrwmftgt : holds the target directory
" s:netrwmftgt_islocal : 0=target directory is remote
" 1=target directory is local
fun! s:NetrwMarkFileTgt(islocal)
" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
- let curdir = b:netrw_curdir
+ let curdir = s:NetrwGetCurdir(a:islocal)
let hadtgt = exists("s:netrwmftgt")
if !exists("w:netrw_bannercnt")
let w:netrw_bannercnt= b:netrw_bannercnt
@@ -7408,9 +7517,10 @@ fun! s:NetrwMarkFileTgt(islocal)
" set up target
if line(".") < w:netrw_bannercnt
+" call Decho("set up target: line(.) < w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
" if cursor in banner region, use b:netrw_curdir for the target unless its already the target
if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") && s:netrwmftgt == b:netrw_curdir
-" call Decho("cursor in banner region, and target already is <".b:netrw_curdir.">: removing target")
+" call Decho("cursor in banner region, and target already is <".b:netrw_curdir.">: removing target",'~'.expand("<slnum>"))
unlet s:netrwmftgt s:netrwmftgt_islocal
if g:netrw_fastbrowse <= 1
call s:LocalBrowseRefresh()
@@ -7421,50 +7531,87 @@ fun! s:NetrwMarkFileTgt(islocal)
return
else
let s:netrwmftgt= b:netrw_curdir
-" call Decho("inbanner: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("inbanner: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
endif
else
" get word under cursor.
" * If directory, use it for the target.
" * If file, use b:netrw_curdir for the target
+" call Decho("get word under cursor",'~'.expand("<slnum>"))
let curword= s:NetrwGetWord()
let tgtdir = s:ComposePath(curdir,curword)
- if a:islocal && isdirectory(tgtdir)
+ if a:islocal && isdirectory(s:NetrwFile(tgtdir))
let s:netrwmftgt = tgtdir
-" call Decho("local isdir: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("local isdir: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
elseif !a:islocal && tgtdir =~ '/$'
let s:netrwmftgt = tgtdir
-" call Decho("remote isdir: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("remote isdir: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
else
let s:netrwmftgt = curdir
-" call Decho("isfile: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("isfile: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
endif
endif
if a:islocal
" simplify the target (eg. /abc/def/../ghi -> /abc/ghi)
let s:netrwmftgt= simplify(s:netrwmftgt)
-" call Decho("simplify: s:netrwmftgt<".s:netrwmftgt.">")
+" call Decho("simplify: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("<slnum>"))
endif
if g:netrw_cygwin
- let s:netrwmftgt= substitute(system("cygpath ".shellescape(s:netrwmftgt)),'\n$','','')
+ let s:netrwmftgt= substitute(system("cygpath ".s:ShellEscape(s:netrwmftgt)),'\n$','','')
let s:netrwmftgt= substitute(s:netrwmftgt,'\n$','','')
endif
let s:netrwmftgt_islocal= a:islocal
+ " need to do refresh so that the banner will be updated
+ " s:LocalBrowseRefresh handles all local-browsing buffers when not fast browsing
if g:netrw_fastbrowse <= 1
+" call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse.", so refreshing all local netrw buffers")
call s:LocalBrowseRefresh()
endif
- call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ if w:netrw_liststyle == s:TREELIST
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,w:netrw_treetop))
+ else
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ endif
call netrw#RestorePosn(svpos)
if !hadtgt
sil! NetrwKeepj norm! j
endif
+" call Decho("getmatches=".string(getmatches()),'~'.expand("<slnum>"))
+" call Decho("s:netrwmarkfilelist=".(exists("s:netrwmarkfilelist")? string(s:netrwmarkfilelist) : 'n/a'),'~'.expand("<slnum>"))
" call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">")
endfun
" ---------------------------------------------------------------------
+" s:NetrwGetCurdir: gets current directory and sets up b:netrw_curdir if necessary {{{2
+fun! s:NetrwGetCurdir(islocal)
+" call Dfunc("s:NetrwGetCurdir(islocal=".a:islocal.")")
+
+ if w:netrw_liststyle == s:TREELIST
+ let b:netrw_curdir = s:NetrwTreePath(w:netrw_treetop)
+" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used s:NetrwTreeDir)",'~'.expand("<slnum>"))
+ elseif !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)",'~'.expand("<slnum>"))
+ endif
+
+" call Decho("b:netrw_curdir<".b:netrw_curdir."> ".((b:netrw_curdir !~ '\<\a\{3,}://')? "does not match" : "matches")." url pattern")
+ if b:netrw_curdir !~ '\<\a\{3,}://'
+ let curdir= b:netrw_curdir
+" call Decho("g:netrw_keepdir=".g:netrw_keepdir)
+ if g:netrw_keepdir == 0
+ call s:NetrwLcd(curdir)
+ endif
+ endif
+
+" call Dret("s:NetrwGetCurdir <".curdir.">")
+ return b:netrw_curdir
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwOpenFile: query user for a filename and open it {{{2
fun! s:NetrwOpenFile(islocal)
" call Dfunc("s:NetrwOpenFile(islocal=".a:islocal.")")
@@ -7477,7 +7624,10 @@ fun! s:NetrwOpenFile(islocal)
if exists("g:netrw_quiet")
let netrw_quiet_keep = g:netrw_quiet
endif
- let g:netrw_quiet = 1
+ let g:netrw_quiet = 1
+ " save position for benefit of Rexplore
+ let s:rexposn_{bufnr("%")}= netrw#SavePosn()
+" call Decho("setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
if b:netrw_curdir =~ '/$'
exe "NetrwKeepj e ".fnameescape(b:netrw_curdir.fname)
else
@@ -7497,14 +7647,84 @@ fun! s:NetrwOpenFile(islocal)
endfun
" ---------------------------------------------------------------------
-" s:NetrwUnmarkList: delete local marked file lists and remove their contents from the global marked-file list {{{2
-" User access provided by the <mu> mapping. (see :help netrw-mu)
+" netrw#Shrink: shrinks/expands a netrw or Lexplorer window {{{2
+" For the mapping to this function be made via
+" netrwPlugin, you'll need to have had
+" g:netrw_usetab set to non-zero.
+fun! netrw#Shrink()
+" call Dfunc("netrw#Shrink() ft<".&ft."> winwidth=".winwidth(0)." lexbuf#".((exists("t:netrw_lexbufnr"))? t:netrw_lexbufnr : 'n/a'))
+ let curwin = winnr()
+ let wiwkeep = &wiw
+ set wiw=1
+
+ if &ft == "netrw"
+ if winwidth(0) > g:netrw_wiw
+ let t:netrw_winwidth= winwidth(0)
+ exe "vert resize ".g:netrw_wiw
+ wincmd l
+ if winnr() == curwin
+ wincmd h
+ endif
+" call Decho("vert resize 0",'~'.expand("<slnum>"))
+ else
+ exe "vert resize ".t:netrw_winwidth
+" call Decho("vert resize ".t:netrw_winwidth,'~'.expand("<slnum>"))
+ endif
+
+ elseif exists("t:netrw_lexbufnr")
+ exe bufwinnr(t:netrw_lexbufnr)."wincmd w"
+ if winwidth(bufwinnr(t:netrw_lexbufnr)) > g:netrw_wiw
+ let t:netrw_winwidth= winwidth(0)
+ exe "vert resize ".g:netrw_wiw
+ wincmd l
+ if winnr() == curwin
+ wincmd h
+ endif
+" call Decho("vert resize 0",'~'.expand("<slnum>"))
+ elseif winwidth(bufwinnr(t:netrw_lexbufnr)) >= 0
+ exe "vert resize ".t:netrw_winwidth
+" call Decho("vert resize ".t:netrw_winwidth,'~'.expand("<slnum>"))
+ else
+ call netrw#Lexplore(0,0)
+ endif
+
+ else
+ call netrw#Lexplore(0,0)
+ endif
+ let wiw= wiwkeep
+
+" call Dret("netrw#Shrink")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetSortSequence: allows user to edit the sorting sequence {{{2
+fun! s:NetSortSequence(islocal)
+" call Dfunc("NetSortSequence(islocal=".a:islocal.")")
+
+ let ykeep= @@
+ let svpos= netrw#SavePosn()
+ call inputsave()
+ let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence)
+ call inputrestore()
+
+ " refresh the listing
+ let g:netrw_sort_sequence= newsortseq
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call netrw#RestorePosn(svpos)
+ let @@= ykeep
+
+" call Dret("NetSortSequence")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwUnmarkList: delete local marked file list and remove their contents from the global marked-file list {{{2
+" User access provided by the <mF> mapping. (see :help netrw-mF)
" Used by many MarkFile functions.
fun! s:NetrwUnmarkList(curbufnr,curdir)
" call Dfunc("s:NetrwUnmarkList(curbufnr=".a:curbufnr." curdir<".a:curdir.">)")
" remove all files in local marked-file list from global list
- if exists("s:netrwmarkfilelist_{a:curbufnr}")
+ if exists("s:netrwmarkfilelist")
for mfile in s:netrwmarkfilelist_{a:curbufnr}
let dfile = s:ComposePath(a:curdir,mfile) " prepend directory to mfile
let idx = index(s:netrwmarkfilelist,dfile) " get index in list of dfile
@@ -7513,7 +7733,7 @@ fun! s:NetrwUnmarkList(curbufnr,curdir)
if s:netrwmarkfilelist == []
unlet s:netrwmarkfilelist
endif
-
+
" getting rid of the local marked-file lists is easy
unlet s:netrwmarkfilelist_{a:curbufnr}
endif
@@ -7544,7 +7764,7 @@ fun! s:NetrwUnmarkAll2()
let
redir END
let netrwmarkfilelist_list= split(netrwmarkfilelist_let,'\n') " convert let string into a let list
- call filter(netrwmarkfilelist_list,"v:val =~ '^s:netrwmarkfilelist_'") " retain only those vars that start as s:netrwmarkfilelist_
+ call filter(netrwmarkfilelist_list,"v:val =~ '^s:netrwmarkfilelist_'") " retain only those vars that start as s:netrwmarkfilelist_
call map(netrwmarkfilelist_list,"substitute(v:val,'\\s.*$','','')") " remove what the entries are equal to
for flist in netrwmarkfilelist_list
let curbufnr= substitute(flist,'s:netrwmarkfilelist_','','')
@@ -7555,22 +7775,36 @@ fun! s:NetrwUnmarkAll2()
endfun
" ---------------------------------------------------------------------
-" s:NetrwUnMarkFile: {{{2
+" s:NetrwUnMarkFile: called via mu map; unmarks *all* marked files, both global and buffer-local {{{2
+"
+" Marked files are in two types of lists:
+" s:netrwmarkfilelist -- holds complete paths to all marked files
+" s:netrwmarkfilelist_# -- holds list of marked files in current-buffer's directory (#==bufnr())
+"
+" Marked files suitable for use with 2match are in:
+" s:netrwmarkfilemtch_# -- used with 2match to display marked files
fun! s:NetrwUnMarkFile(islocal)
" call Dfunc("s:NetrwUnMarkFile(islocal=".a:islocal.")")
let svpos = netrw#SavePosn()
let curbufnr = bufnr("%")
- " unmark marked file list (although I expect s:NetrwUpload()
- " to do it, I'm just making sure)
- if exists("s:netrwmarkfilelist_{bufnr('%')}")
-" call Decho("unlet'ing: s:netrwmarkfile[list|mtch]_".bufnr("%"))
+ " unmark marked file list
+ " (although I expect s:NetrwUpload() to do it, I'm just making sure)
+ if exists("s:netrwmarkfilelist")
+" " call Decho("unlet'ing: s:netrwmarkfilelist",'~'.expand("<slnum>"))
unlet s:netrwmarkfilelist
- unlet s:netrwmarkfilelist_{curbufnr}
- unlet s:netrwmarkfilemtch_{curbufnr}
- 2match none
endif
+ let ibuf= 1
+ while ibuf < bufnr("$")
+ if exists("s:netrwmarkfilelist_".ibuf)
+ unlet s:netrwmarkfilelist_{ibuf}
+ unlet s:netrwmarkfilemtch_{ibuf}
+ endif
+ let ibuf = ibuf + 1
+ endwhile
+ 2match none
+
" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
call netrw#RestorePosn(svpos)
" call Dret("s:NetrwUnMarkFile")
@@ -7588,7 +7822,7 @@ fun! s:NetrwMenu(domenu)
" call Dfunc("NetrwMenu(domenu=".a:domenu.")")
if !exists("s:netrw_menu_enabled") && a:domenu
-" call Decho("initialize menu")
+" call Decho("initialize menu",'~'.expand("<slnum>"))
let s:netrw_menu_enabled= 1
exe 'sil! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help<tab><F1> <F1>'
exe 'sil! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'-Sep1- :'
@@ -7654,6 +7888,7 @@ fun! s:NetrwMenu(domenu)
exe 'sil! menu '.g:NetrwMenuPriority.'.16.4.1 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method.Name<tab>s :let g:netrw_sort_by="name"<cr><c-L>'
exe 'sil! menu '.g:NetrwMenuPriority.'.16.4.2 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method.Time<tab>s :let g:netrw_sort_by="time"<cr><c-L>'
exe 'sil! menu '.g:NetrwMenuPriority.'.16.4.3 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method.Size<tab>s :let g:netrw_sort_by="size"<cr><c-L>'
+ exe 'sil! menu '.g:NetrwMenuPriority.'.16.4.3 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method.Exten<tab>s :let g:netrw_sort_by="exten"<cr><c-L>'
exe 'sil! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Rename\ File/Directory<tab>R R'
exe 'sil! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Set\ Current\ Directory<tab>c c'
let s:netrw_menucnt= 28
@@ -7667,9 +7902,9 @@ fun! s:NetrwMenu(domenu)
exe curwin."wincmd w"
if s:netrwcnt <= 1
-" call Decho("clear menus")
+" call Decho("clear menus",'~'.expand("<slnum>"))
exe 'sil! unmenu '.g:NetrwTopLvlMenu
-" call Decho('exe sil! unmenu '.g:NetrwTopLvlMenu.'*')
+" call Decho('exe sil! unmenu '.g:NetrwTopLvlMenu.'*','~'.expand("<slnum>"))
sil! unlet s:netrw_menu_enabled
endif
endif
@@ -7687,7 +7922,7 @@ fun! s:NetrwObtain(islocal)
let ykeep= @@
if exists("s:netrwmarkfilelist_{bufnr('%')}")
- let islocal= s:netrwmarkfilelist_{bufnr('%')}[1] !~ '^\a\+://'
+ let islocal= s:netrwmarkfilelist_{bufnr('%')}[1] !~ '^\a\{3,}://'
call netrw#Obtain(islocal,s:netrwmarkfilelist_{bufnr('%')})
call s:NetrwUnmarkList(bufnr('%'),b:netrw_curdir)
else
@@ -7720,32 +7955,32 @@ fun! s:NetrwPrevWinOpen(islocal)
let choice = 0
let s:treedir = s:NetrwTreeDir(a:islocal)
let curdir = s:treedir
-" call Decho("winnr($)#".lastwinnr." curword<".curword.">")
+" call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("<slnum>"))
let didsplit = 0
if lastwinnr == 1
" if only one window, open a new one first
-" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
+" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")",'~'.expand("<slnum>"))
if g:netrw_preview
" vertically split preview window
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
-" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s")
+" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s",'~'.expand("<slnum>"))
exe (g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
else
" horizontally split preview window
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
-" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("<slnum>"))
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
endif
let didsplit = 1
-" call Decho("did split")
+" call Decho("did split",'~'.expand("<slnum>"))
else
NetrwKeepj call s:SaveBufVars()
let eikeep= &ei
setl ei=all
wincmd p
-" call Decho("wincmd p (now in win#".winnr().") curdir<".curdir.">")
+" call Decho("wincmd p (now in win#".winnr().") curdir<".curdir.">",'~'.expand("<slnum>"))
" prevwinnr: the window number of the "prev" window
" prevbufnr: the buffer number of the buffer in the "prev" window
@@ -7756,22 +7991,22 @@ fun! s:NetrwPrevWinOpen(islocal)
let prevmod = &mod
let bnrcnt = 0
NetrwKeepj call s:RestoreBufVars()
-" call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr)
+" call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr,'~'.expand("<slnum>"))
" if the previous window's buffer has been changed (ie. its modified flag is set),
" and it doesn't appear in any other extant window, then ask the
" user if s/he wants to abandon modifications therein.
if prevmod
-" call Decho("detected that prev window's buffer has been modified: prevbufnr=".prevbufnr." winnr()#".winnr())
+" call Decho("detected that prev window's buffer has been modified: prevbufnr=".prevbufnr." winnr()#".winnr(),'~'.expand("<slnum>"))
windo if winbufnr(0) == prevbufnr | let bnrcnt=bnrcnt+1 | endif
-" call Decho("prevbufnr=".prevbufnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr()=".winnr()." prevwinnr#".prevwinnr)
+" call Decho("prevbufnr=".prevbufnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr()=".winnr()." prevwinnr#".prevwinnr,'~'.expand("<slnum>"))
exe prevwinnr."wincmd w"
if bnrcnt == 1 && &hidden == 0
" only one copy of the modified buffer in a window, and
" hidden not set, so overwriting will lose the modified file. Ask first...
let choice = confirm("Save modified buffer<".prevbufname."> first?","&Yes\n&No\n&Cancel")
-" call Decho("(NetrwPrevWinOpen) prevbufname<".prevbufname."> choice=".choice." current-winnr#".winnr())
+" call Decho("(NetrwPrevWinOpen) prevbufname<".prevbufname."> choice=".choice." current-winnr#".winnr(),'~'.expand("<slnum>"))
let &ei= eikeep
if choice == 1
@@ -7779,7 +8014,7 @@ fun! s:NetrwPrevWinOpen(islocal)
let v:errmsg= ""
sil w
if v:errmsg != ""
- call netrw#ErrorMsg(s:ERROR,"unable to write <".prevbufname.">!",30)
+ call netrw#ErrorMsg(s:ERROR,"unable to write <".(exists("prevbufname")? prevbufname : 'n/a').">!",30)
exe origwin."wincmd w"
let &ei = eikeep
let @@ = ykeep
@@ -7789,12 +8024,12 @@ fun! s:NetrwPrevWinOpen(islocal)
elseif choice == 2
" No -- don't worry about changed file, just browse anyway
-" call Decho("don't worry about chgd file, just browse anyway (winnr($)#".winnr("$").")")
+" call Decho("don't worry about chgd file, just browse anyway (winnr($)#".winnr("$").")",'~'.expand("<slnum>"))
echomsg "**note** changes to ".prevbufname." abandoned"
else
" Cancel -- don't do this
-" call Decho("cancel, don't browse, switch to win#".origwin)
+" call Decho("cancel, don't browse, switch to win#".origwin,'~'.expand("<slnum>"))
exe origwin."wincmd w"
let &ei= eikeep
let @@ = ykeep
@@ -7828,46 +8063,46 @@ endfun
fun! s:NetrwUpload(fname,tgt,...)
" call Dfunc("s:NetrwUpload(fname<".((type(a:fname) == 1)? a:fname : string(a:fname))."> tgt<".a:tgt.">) a:0=".a:0)
- if a:tgt =~ '^\a\+://'
- let tgtdir= substitute(a:tgt,'^\a\+://[^/]\+/\(.\{-}\)$','\1','')
+ if a:tgt =~ '^\a\{3,}://'
+ let tgtdir= substitute(a:tgt,'^\a\{3,}://[^/]\+/\(.\{-}\)$','\1','')
else
let tgtdir= substitute(a:tgt,'^\(.*\)/[^/]*$','\1','')
endif
-" call Decho("tgtdir<".tgtdir.">")
+" call Decho("tgtdir<".tgtdir.">",'~'.expand("<slnum>"))
if a:0 > 0
let fromdir= a:1
else
let fromdir= getcwd()
endif
-" call Decho("fromdir<".fromdir.">")
+" call Decho("fromdir<".fromdir.">",'~'.expand("<slnum>"))
if type(a:fname) == 1
" handle uploading a single file using NetWrite
-" call Decho("handle uploading a single file via NetWrite")
+" call Decho("handle uploading a single file via NetWrite",'~'.expand("<slnum>"))
1split
-" call Decho("exe e ".fnameescape(a:fname))
- exe "NetrwKeepj e ".fnameescape(a:fname)
-" call Decho("now locally editing<".expand("%").">, has ".line("$")." lines")
+" call Decho("exe e ".fnameescape(s:NetrwFile(a:fname)),'~'.expand("<slnum>"))
+ exe "NetrwKeepj e ".fnameescape(s:NetrwFile(a:fname))
+" call Decho("now locally editing<".expand("%").">, has ".line("$")." lines",'~'.expand("<slnum>"))
if a:tgt =~ '/$'
let wfname= substitute(a:fname,'^.*/','','')
-" call Decho("exe w! ".fnameescape(wfname))
+" call Decho("exe w! ".fnameescape(wfname),'~'.expand("<slnum>"))
exe "w! ".fnameescape(a:tgt.wfname)
else
-" call Decho("writing local->remote: exe w ".fnameescape(a:tgt))
+" call Decho("writing local->remote: exe w ".fnameescape(a:tgt),'~'.expand("<slnum>"))
exe "w ".fnameescape(a:tgt)
-" call Decho("done writing local->remote")
+" call Decho("done writing local->remote",'~'.expand("<slnum>"))
endif
q!
elseif type(a:fname) == 3
" handle uploading a list of files via scp
-" call Decho("handle uploading a list of files via scp")
+" call Decho("handle uploading a list of files via scp",'~'.expand("<slnum>"))
let curdir= getcwd()
if a:tgt =~ '^scp:'
call s:NetrwLcd(fromdir)
let filelist= deepcopy(s:netrwmarkfilelist_{bufnr('%')})
- let args = join(map(filelist,"shellescape(v:val, 1)"))
+ let args = join(map(filelist,"s:ShellEscape(v:val, 1)"))
if exists("g:netrw_port") && g:netrw_port != ""
let useport= " ".g:netrw_scpport." ".g:netrw_port
else
@@ -7875,7 +8110,7 @@ fun! s:NetrwUpload(fname,tgt,...)
endif
let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','')
let tgt = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','')
- call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1))
+ call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.s:ShellEscape(useport,1)." ".args." ".s:ShellEscape(machine.":".tgt,1))
call s:NetrwLcd(curdir)
elseif a:tgt =~ '^ftp:'
@@ -7885,35 +8120,35 @@ fun! s:NetrwUpload(fname,tgt,...)
" handle uploading a list of files via ftp+.netrc
let netrw_fname = b:netrw_fname
sil NetrwKeepj new
-" call Decho("filter input window#".winnr())
+" call Decho("filter input window#".winnr(),'~'.expand("<slnum>"))
NetrwKeepj put =g:netrw_ftpmode
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if tgtdir == ""
let tgtdir= '/'
endif
NetrwKeepj call setline(line("$")+1,'cd "'.tgtdir.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
for fname in a:fname
- NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
-" call Decho("filter input: ".getline('$'))
+ NetrwKeepj call setline(line("$")+1,'put "'.s:NetrwFile(fname).'"')
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endfor
if exists("g:netrw_port") && g:netrw_port != ""
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1))
else
-" call Decho("filter input window#".winnr())
- call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
+" call Decho("filter input window#".winnr(),'~'.expand("<slnum>"))
+ call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1))
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
sil NetrwKeepj g/Local directory now/d
@@ -7933,42 +8168,42 @@ fun! s:NetrwUpload(fname,tgt,...)
if exists("g:netrw_port") && g:netrw_port != ""
NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
else
NetrwKeepj put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_uid") && g:netrw_uid != ""
if exists("g:netrw_ftp") && g:netrw_ftp == 1
NetrwKeepj put =g:netrw_uid
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("s:netrw_passwd")
NetrwKeepj call setline(line("$")+1,'"'.s:netrw_passwd.'"')
endif
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
elseif exists("s:netrw_passwd")
NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
endif
NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
if exists("b:netrw_fname") && b:netrw_fname != ""
NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endif
for fname in a:fname
NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
-" call Decho("filter input: ".getline('$'))
+" call Decho("filter input: ".getline('$'),'~'.expand("<slnum>"))
endfor
" perform ftp:
@@ -8009,7 +8244,7 @@ fun! s:NetrwPreview(path) range
NetrwKeepj call s:NetrwOptionSave("s:")
NetrwKeepj call s:NetrwSafeOptions()
if has("quickfix")
- if !isdirectory(a:path)
+ if !isdirectory(s:NetrwFile(a:path))
if g:netrw_preview && !g:netrw_alto
let pvhkeep = &pvh
let winsz = (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
@@ -8036,15 +8271,16 @@ fun! s:NetrwRefresh(islocal,dirname)
" call Dfunc("s:NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
" at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first.
setl ma noro
-" call Decho("setl ma noro")
-" call Decho("clear buffer<".expand("%")."> with :%d")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
+" call Decho("clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
let ykeep = @@
" save the cursor position before refresh.
let screenposn = netrw#SavePosn()
-" call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">")
-" call Decho("clearing buffer prior to refresh")
- sil! NetrwKeepj %d
+
+" call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">",'~'.expand("<slnum>"))
+" call Decho("clearing buffer prior to refresh",'~'.expand("<slnum>"))
+ sil! NetrwKeepj %d _
if a:islocal
NetrwKeepj call netrw#LocalBrowseCheck(a:dirname)
else
@@ -8056,10 +8292,10 @@ fun! s:NetrwRefresh(islocal,dirname)
" restore file marks
if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
-" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/")
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/",'~'.expand("<slnum>"))
exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
else
-" call Decho("2match none")
+" call Decho("2match none (bufnr(%)=".bufnr("%")."<".bufname("%").">)",'~'.expand("<slnum>"))
2match none
endif
@@ -8076,26 +8312,26 @@ fun! s:NetrwRefreshDir(islocal,dirname)
" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) g:netrw_fastbrowse=".g:netrw_fastbrowse)
if g:netrw_fastbrowse == 0
" slowest mode (keep buffers refreshed, local or remote)
-" call Decho("slowest mode: keep buffers refreshed, local or remote")
+" call Decho("slowest mode: keep buffers refreshed, local or remote",'~'.expand("<slnum>"))
let tgtwin= bufwinnr(a:dirname)
-" call Decho("tgtwin= bufwinnr(".a:dirname.")=".tgtwin)
+" call Decho("tgtwin= bufwinnr(".a:dirname.")=".tgtwin,'~'.expand("<slnum>"))
if tgtwin > 0
" tgtwin is being displayed, so refresh it
let curwin= winnr()
-" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")")
+" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")",'~'.expand("<slnum>"))
exe tgtwin."wincmd w"
- NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
exe curwin."wincmd w"
elseif bufnr(a:dirname) > 0
let bn= bufnr(a:dirname)
-" call Decho("bd bufnr(".a:dirname.")=".bn)
- exe "sil bd ".bn
+" call Decho("bd bufnr(".a:dirname.")=".bn,'~'.expand("<slnum>"))
+ exe "sil keepj bd ".bn
endif
elseif g:netrw_fastbrowse <= 1
-" call Decho("medium-speed mode: refresh local buffers only")
+" call Decho("medium-speed mode: refresh local buffers only",'~'.expand("<slnum>"))
NetrwKeepj call s:LocalBrowseRefresh()
endif
" call Dret("s:NetrwRefreshDir")
@@ -8109,7 +8345,7 @@ endfun
fun! s:NetrwSetChgwin(...)
" call Dfunc("s:NetrwSetChgwin() v:count=".v:count)
if a:0 > 0
-" call Decho("a:1<".a:1.">")
+" call Decho("a:1<".a:1.">",'~'.expand("<slnum>"))
if a:1 == "" " :NetrwC win#
let g:netrw_chgwin= winnr()
else " :NetrwC
@@ -8120,6 +8356,7 @@ fun! s:NetrwSetChgwin(...)
else " C
let g:netrw_chgwin= winnr()
endif
+ echo "editing window now set to window#".g:netrw_chgwin
" call Dret("s:NetrwSetChgwin : g:netrw_chgwin=".g:netrw_chgwin)
endfun
@@ -8159,7 +8396,7 @@ fun! s:NetrwSetSort()
else
let spriority= priority.g:netrw_sepchr
endif
-" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">")
+" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">",'~'.expand("<slnum>"))
" sanity check
if w:netrw_bannercnt > line("$")
@@ -8235,7 +8472,7 @@ fun! s:NetrwSortStyle(islocal)
NetrwKeepj call s:NetrwSaveWordPosn()
let svpos= netrw#SavePosn()
- let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'
+ let g:netrw_sort_by= (g:netrw_sort_by =~ '^n')? 'time' : (g:netrw_sort_by =~ '^t')? 'size' : (g:netrw_sort_by =~ '^siz')? 'exten' : 'name'
NetrwKeepj norm! 0
NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
NetrwKeepj call netrw#RestorePosn(svpos)
@@ -8261,7 +8498,7 @@ fun! s:NetrwSplit(mode)
" remote and o
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
-" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("<slnum>"))
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1
NetrwKeepj call s:RestoreWinVars()
@@ -8271,7 +8508,7 @@ fun! s:NetrwSplit(mode)
elseif a:mode == 1
" remote and t
let newdir = s:NetrwBrowseChgDir(0,s:NetrwGetWord())
-" call Decho("tabnew")
+" call Decho("tabnew",'~'.expand("<slnum>"))
tabnew
let s:didsplit= 1
NetrwKeepj call s:RestoreWinVars()
@@ -8282,7 +8519,7 @@ fun! s:NetrwSplit(mode)
" remote and v
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
-" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
+" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v",'~'.expand("<slnum>"))
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1
NetrwKeepj call s:RestoreWinVars()
@@ -8293,7 +8530,7 @@ fun! s:NetrwSplit(mode)
" local and o
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
-" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("<slnum>"))
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1
NetrwKeepj call s:RestoreWinVars()
@@ -8312,9 +8549,9 @@ fun! s:NetrwSplit(mode)
setl ei=all
exe "NetrwKeepj norm! ".netrw_hline."G0z\<CR>"
exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\<bar>"
- let &ei= eikeep
- let netrw_curdir= s:NetrwTreeDir(0)
-" call Decho("tabnew")
+ let &ei = eikeep
+ let netrw_curdir = s:NetrwTreeDir(0)
+" call Decho("tabnew",'~'.expand("<slnum>"))
tabnew
let b:netrw_curdir = netrw_curdir
let s:didsplit = 1
@@ -8332,7 +8569,7 @@ fun! s:NetrwSplit(mode)
" local and v
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
-" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
+" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v",'~'.expand("<slnum>"))
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1
NetrwKeepj call s:RestoreWinVars()
@@ -8359,21 +8596,29 @@ fun! s:NetrwTgtMenu()
" the following test assures that gvim is running, has menus available, and has menus enabled.
if has("gui") && has("menu") && has("gui_running") && &go =~# 'm' && g:netrw_menu
if exists("g:NetrwTopLvlMenu")
-" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)")
+" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)",'~'.expand("<slnum>"))
exe 'sil! unmenu '.g:NetrwTopLvlMenu.'Targets'
endif
if !exists("s:netrw_initbookhist")
call s:NetrwBookHistRead()
endif
+ " try to cull duplicate entries
+ let tgtdict={}
+
" target bookmarked places
if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] && g:netrw_dirhistmax > 0
-" call Decho("installing bookmarks as easy targets")
+" call Decho("installing bookmarks as easy targets",'~'.expand("<slnum>"))
let cnt= 1
for bmd in g:netrw_bookmarklist
+ if has_key(tgtdict,bmd)
+ let cnt= cnt + 1
+ continue
+ endif
+ let tgtdict[bmd]= cnt
let ebmd= escape(bmd,g:netrw_menu_escape)
" show bookmarks for goto menu
-" call Decho("menu: Targets: ".bmd)
+" call Decho("menu: Targets: ".bmd,'~'.expand("<slnum>"))
exe 'sil! menu <silent> '.g:NetrwMenuPriority.".19.1.".cnt." ".g:NetrwTopLvlMenu.'Targets.'.ebmd." :call netrw#MakeTgt('".bmd."')\<cr>"
let cnt= cnt + 1
endfor
@@ -8381,14 +8626,19 @@ fun! s:NetrwTgtMenu()
" target directory browsing history
if exists("g:netrw_dirhistmax") && g:netrw_dirhistmax > 0
-" call Decho("installing history as easy targets (histmax=".g:netrw_dirhistmax.")")
+" call Decho("installing history as easy targets (histmax=".g:netrw_dirhistmax.")",'~'.expand("<slnum>"))
let histcnt = 1
while histcnt <= g:netrw_dirhistmax
let priority = g:netrw_dirhist_cnt + histcnt
if exists("g:netrw_dirhist_{histcnt}")
let histentry = g:netrw_dirhist_{histcnt}
- let ehistentry = escape(histentry,g:netrw_menu_escape)
-" call Decho("menu: Targets: ".histentry)
+ if has_key(tgtdict,histentry)
+ let histcnt = histcnt + 1
+ continue
+ endif
+ let tgtdict[histentry] = histcnt
+ let ehistentry = escape(histentry,g:netrw_menu_escape)
+" call Decho("menu: Targets: ".histentry,'~'.expand("<slnum>"))
exe 'sil! menu <silent> '.g:NetrwMenuPriority.".19.2.".priority." ".g:NetrwTopLvlMenu.'Targets.'.ehistentry." :call netrw#MakeTgt('".histentry."')\<cr>"
endif
let histcnt = histcnt + 1
@@ -8411,63 +8661,72 @@ fun! s:NetrwTreeDir(islocal)
" call Dret("s:NetrwTreeDir ".treedir)
return treedir
endif
+
if !exists("b:netrw_curdir") || b:netrw_curdir == ""
let b:netrw_curdir= getcwd()
endif
+
let treedir = b:netrw_curdir
-" call Decho("set initial treedir<".treedir.">")
+" call Decho("set initial treedir<".treedir.">",'~'.expand("<slnum>"))
let s:treecurpos= netrw#SavePosn()
if w:netrw_liststyle == s:TREELIST
-" call Decho("w:netrw_liststyle is TREELIST:")
-" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">")
+" call Decho("w:netrw_liststyle is TREELIST:",'~'.expand("<slnum>"))
+" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>"))
" extract tree directory if on a line specifying a subdirectory (ie. ends with "/")
let curline= substitute(getline('.'),"\t -->.*$",'','')
if curline =~ '/$'
-" call Decho("extract tree subdirectory from current line")
+" call Decho("extract tree subdirectory from current line",'~'.expand("<slnum>"))
let treedir= substitute(getline('.'),'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
-" call Decho("treedir<".treedir.">")
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
+ elseif curline =~ '@$'
+" call Decho("handle symbolic link from current line",'~'.expand("<slnum>"))
+ let treedir= resolve(substitute(substitute(getline('.'),'@.*$','','e'),'^|*\s*','','e'))
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
else
-" call Decho("do not extract tree subdirectory from current line and set treedir to empty")
+" call Decho("do not extract tree subdirectory from current line and set treedir to empty",'~'.expand("<slnum>"))
let treedir= ""
endif
" detect user attempting to close treeroot
-" call Decho("check if user is attempting to close treeroot")
-" call Decho(".win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
-" call Decho(".getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring)
+" call Decho("check if user is attempting to close treeroot",'~'.expand("<slnum>"))
+" call Decho(".win#".winnr()." buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
+" call Decho(".getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring,'~'.expand("<slnum>"))
if curline !~ '^'.s:treedepthstring && getline('.') != '..'
-" call Decho(".user may have attempted to close treeroot")
+" call Decho(".user may have attempted to close treeroot",'~'.expand("<slnum>"))
" now force a refresh
-" call Decho(".force refresh: clear buffer<".expand("%")."> with :%d")
- sil! NetrwKeepj %d
-" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
+" call Decho(".force refresh: clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+ sil! NetrwKeepj %d _
+" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".(exists("s:treecurpos")? string(s:treecurpos) : 'n/a').">")
return b:netrw_curdir
" else " Decho
-" call Decho(".user did not attempt to close treeroot")
+" call Decho(".user did not attempt to close treeroot",'~'.expand("<slnum>"))
endif
-" call Decho("islocal=".a:islocal." curline<".curline.">")
-" call Decho("after subst<".substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)$','\1','').">")
+" call Decho("islocal=".a:islocal." curline<".curline.">",'~'.expand("<slnum>"))
+" call Decho("after subst<".substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)$','\1','').">",'~'.expand("<slnum>"))
let potentialdir= substitute(curline,'^'.s:treedepthstring.'* \(.*\)@$','\1','')
-" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(potentialdir))
-
- if a:islocal && curline =~ '@$' && isdirectory(potentialdir)
- let newdir = w:netrw_treetop.'/'.potentialdir
- let treedir = s:NetrwTreePath(newdir)
- let w:netrw_treetop = newdir
-" call Decho("newdir <".newdir.">")
- else
+" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(s:NetrwFile(potentialdir)),'~'.expand("<slnum>"))
+
+ " COMBAK: a symbolic link may point anywhere -- so it will be used to start a new treetop
+" if a:islocal && curline =~ '@$' && isdirectory(s:NetrwFile(potentialdir))
+" let newdir = w:netrw_treetop.'/'.potentialdir
+" " call Decho("apply NetrwTreePath to newdir<".newdir.">",'~'.expand("<slnum>"))
+" let treedir = s:NetrwTreePath(newdir)
+" let w:netrw_treetop = newdir
+" " call Decho("newdir <".newdir.">",'~'.expand("<slnum>"))
+" else
+" call Decho("apply NetrwTreePath to treetop<".w:netrw_treetop.">",'~'.expand("<slnum>"))
let treedir = s:NetrwTreePath(w:netrw_treetop)
- endif
+" endif
endif
" sanity maintenance: keep those //s away...
let treedir= substitute(treedir,'//$','/','')
-" call Decho("treedir<".treedir.">")
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
-" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
+" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".(exists("s:treecurpos")? string(s:treecurpos) : 'n/a').">")
return treedir
endfun
@@ -8482,9 +8741,9 @@ fun! s:NetrwTreeDisplay(dir,depth)
" install ../ and shortdir
if a:depth == ""
call setline(line("$")+1,'../')
-" call Decho("setline#".line("$")." ../ (depth is zero)")
+" call Decho("setline#".line("$")." ../ (depth is zero)",'~'.expand("<slnum>"))
endif
- if a:dir =~ '^\a\+://'
+ if a:dir =~ '^\a\{3,}://'
if a:dir == w:netrw_treetop
let shortdir= a:dir
else
@@ -8495,29 +8754,30 @@ fun! s:NetrwTreeDisplay(dir,depth)
let shortdir= substitute(a:dir,'^.*/','','e')
call setline(line("$")+1,a:depth.shortdir.'/')
endif
-" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">")
+" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("<slnum>"))
" append a / to dir if its missing one
let dir= a:dir
- if dir !~ '/$'
- let dir= dir.'/'
- endif
" display subtrees (if any)
let depth= s:treedepthstring.a:depth
+" call Decho("display subtrees with depth<".depth."> and current leaves",'~'.expand("<slnum>"))
-" call Decho("display subtrees with depth<".depth."> and current leaves")
- for entry in w:netrw_treedict[a:dir]
- let direntry= substitute(dir.entry,'/$','','e')
-" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">")
+" call Decho("w:netrw_treedict[".dir."]=".string(w:netrw_treedict[dir]),'~'.expand("<slnum>"))
+ for entry in w:netrw_treedict[dir]
+ let direntry= substitute(dir.'/'.entry,'[@/]$','','e')
+" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">",'~'.expand("<slnum>"))
if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
-" call Decho("<".direntry."> is a key in treedict - display subtree for it")
+" call Decho("<".direntry."> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwTreeDisplay(direntry,depth)
elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/')
-" call Decho("<".direntry."/> is a key in treedict - display subtree for it")
+" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
+ NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth)
+ elseif entry =~ '@$' && has_key(w:netrw_treedict,direntry.'@')
+" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth)
else
-" call Decho("<".entry."> is not a key in treedict (no subtree)")
+" call Decho("<".entry."> is not a key in treedict (no subtree)",'~'.expand("<slnum>"))
sil! NetrwKeepj call setline(line("$")+1,depth.entry)
endif
endfor
@@ -8527,34 +8787,36 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwTreeListing: displays tree listing from treetop on down, using NetrwTreeDisplay() {{{2
+" Called by s:PerformListing()
fun! s:NetrwTreeListing(dirname)
if w:netrw_liststyle == s:TREELIST
" call Dfunc("NetrwTreeListing() bufname<".expand("%").">")
-" call Decho("curdir<".a:dirname.">")
-" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"))
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("curdir<".a:dirname.">",'~'.expand("<slnum>"))
+" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"),'~'.expand("<slnum>"))
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" update the treetop
-" call Decho("update the treetop")
+" call Decho("update the treetop",'~'.expand("<slnum>"))
if !exists("w:netrw_treetop")
let w:netrw_treetop= a:dirname
-" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)")
+" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)",'~'.expand("<slnum>"))
elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop)
let w:netrw_treetop= a:dirname
-" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)")
+" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)",'~'.expand("<slnum>"))
endif
- " insure that we have at least an empty treedict
if !exists("w:netrw_treedict")
+ " insure that we have a treedict, albeit empty
+" call Decho("initializing w:netrw_treedict to empty",'~'.expand("<slnum>"))
let w:netrw_treedict= {}
endif
" update the directory listing for the current directory
-" call Decho("updating dictionary with ".a:dirname.":[..directory listing..]")
-" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
+" call Decho("updating dictionary with ".a:dirname.":[..directory listing..]",'~'.expand("<slnum>"))
+" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"),'~'.expand("<slnum>"))
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
-" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]))
+" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]),'~'.expand("<slnum>"))
exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
" if past banner, record word
@@ -8563,16 +8825,16 @@ fun! s:NetrwTreeListing(dirname)
else
let fname= ""
endif
-" call Decho("fname<".fname.">")
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" display from treetop on down
NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
-" call Decho("s:NetrwTreeDisplay) setl noma nomod ro")
+" call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("<slnum>"))
" remove any blank line remaining as line#1 (happens in treelisting mode with banner suppressed)
while getline(1) =~ '^\s*$' && byte2line(1) > 0
-" call Decho("deleting blank line")
+" call Decho("deleting blank line",'~'.expand("<slnum>"))
1d
endwhile
@@ -8591,25 +8853,32 @@ endfun
fun! s:NetrwTreePath(treetop)
" call Dfunc("s:NetrwTreePath() line#".line(".")."<".getline(".").">")
let depth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e')
-" call Decho("(s:NetrwTreePath) depth<".depth."> 1st subst")
+" call Decho("depth<".depth."> 1st subst",'~'.expand("<slnum>"))
let depth = substitute(depth,'^'.s:treedepthstring,'','')
-" call Decho("(s:NetrwTreePath) depth<".depth."> 2nd subst (first depth removed)")
- if getline('.') =~ '/$'
-" call Decho("extract tree directory from current line")
- let treedir= substitute(getline('.'),'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
-" call Decho("(s:NetrwTreePath) treedir<".treedir.">")
+" call Decho("depth<".depth."> 2nd subst (first depth removed)",'~'.expand("<slnum>"))
+ let curline= getline('.')
+" call Decho("curline<".curline.'>','~'.expand("<slnum>"))
+ if curline =~ '/$'
+" call Decho("extract tree directory from current line",'~'.expand("<slnum>"))
+ let treedir= substitute(curline,'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
+ elseif curline =~ '@\s\+-->'
+" call Decho("extract tree directory using symbolic link",'~'.expand("<slnum>"))
+ let treedir= substitute(curline,'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
+ let treedir= substitute(treedir,'@\s\+-->.*$','','e')
+" call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
else
-" call Decho("(s:NetrwTreePath) do not extract tree directory from current line and set treedir to empty")
+" call Decho("do not extract tree directory from current line and set treedir to empty",'~'.expand("<slnum>"))
let treedir= ""
endif
" construct treedir by searching backwards at correct depth
-" call Decho("(s:NetrwTreePath) construct treedir by searching backwards for correct depth")
-" call Decho("(s:NetrwTreePath) initial treedir<".treedir."> depth<".depth.">")
+" call Decho("construct treedir by searching backwards for correct depth",'~'.expand("<slnum>"))
+" call Decho("initial treedir<".treedir."> depth<".depth.">",'~'.expand("<slnum>"))
while depth != "" && search('^'.depth.'[^'.s:treedepthstring.'].\{-}/$','bW')
let dirname= substitute(getline('.'),'^\('.s:treedepthstring.'\)*','','e')
let treedir= dirname.treedir
let depth = substitute(depth,'^'.s:treedepthstring,'','')
-" call Decho("(s:NetrwTreePath) constructing treedir<".treedir.">: dirname<".dirname."> while depth<".depth.">")
+" call Decho("constructing treedir<".treedir.">: dirname<".dirname."> while depth<".depth.">",'~'.expand("<slnum>"))
endwhile
if a:treetop =~ '/$'
let treedir= a:treetop.treedir
@@ -8632,7 +8901,7 @@ fun! s:NetrwWideListing()
" fpl: filenames per line
" fpc: filenames per column
setl ma noro
-" call Decho("setl ma noro")
+" call Decho("setl ma noro",'~'.expand("<slnum>"))
let b:netrw_cpf= 0
if line("$") >= w:netrw_bannercnt
exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
@@ -8642,22 +8911,23 @@ fun! s:NetrwWideListing()
return
endif
let b:netrw_cpf= b:netrw_cpf + 2
-" call Decho("b:netrw_cpf=max_filename_length+2=".b:netrw_cpf)
+" call Decho("b:netrw_cpf=max_filename_length+2=".b:netrw_cpf,'~'.expand("<slnum>"))
" determine qty files per line (fpl)
let w:netrw_fpl= winwidth(0)/b:netrw_cpf
if w:netrw_fpl <= 0
let w:netrw_fpl= 1
endif
-" call Decho("fpl= [winwidth=".winwidth(0)."]/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
+" call Decho("fpl= [winwidth=".winwidth(0)."]/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl,'~'.expand("<slnum>"))
" make wide display
- exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/'
+ " fpc: files per column of wide listing
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'S",submatch(0)),"\\")/'
NetrwKeepj call histdel("/",-1)
let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl
let newcolstart = w:netrw_bannercnt + fpc
let newcolend = newcolstart + fpc - 1
-" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]")
+" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]",'~'.expand("<slnum>"))
if has("clipboard")
sil! let keepregstar = @*
endif
@@ -8680,9 +8950,9 @@ fun! s:NetrwWideListing()
NetrwKeepj call histdel("/",-1)
exe 'nno <buffer> <silent> w :call search(''^.\\|\s\s\zs\S'',''W'')'."\<cr>"
exe 'nno <buffer> <silent> b :call search(''^.\\|\s\s\zs\S'',''bW'')'."\<cr>"
-" call Decho("NetrwWideListing) setl noma nomod ro")
+" call Decho("NetrwWideListing) setl noma nomod ro",'~'.expand("<slnum>"))
exe "setl ".g:netrw_bufsettings
-" call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("NetrwWideListing")
return
else
@@ -8699,26 +8969,27 @@ endfun
" ---------------------------------------------------------------------
" s:PerformListing: {{{2
fun! s:PerformListing(islocal)
-" call Dfunc("s:PerformListing(islocal=".a:islocal.") bufnr(%)=".bufnr("%")."<".bufname("%").">")
-" call Decho("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. " (enter)")
+" call Dfunc("s:PerformListing(islocal=".a:islocal.")")
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol()." line($)=".line("$"),'~'.expand("<slnum>"))
+" call Decho("settings: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (enter)",'~'.expand("<slnum>"))
" set up syntax highlighting {{{3
-" call Decho("set up syntax highlighting (ie. setl ft=netrw)")
+" call Decho("--set up syntax highlighting (ie. setl ft=netrw)",'~'.expand("<slnum>"))
sil! setl ft=netrw
NetrwKeepj call s:NetrwSafeOptions()
setl noro ma
-" call Decho("setl noro ma bh=".&bh)
+" call Decho("setl noro ma bh=".&bh,'~'.expand("<slnum>"))
" if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho
-" call Decho("(netrw) Processing your browsing request...")
+" call Decho("(netrw) Processing your browsing request...",'~'.expand("<slnum>"))
" endif " Decho
-" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" force a refresh for tree listings
-" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
- sil! NetrwKeepj %d
+" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d",'~'.expand("<slnum>"))
+ sil! NetrwKeepj %d _
endif
" save current directory on directory history list
@@ -8726,21 +8997,34 @@ fun! s:PerformListing(islocal)
" Set up the banner {{{3
if g:netrw_banner
-" call Decho("set up banner")
+" call Decho("--set up banner",'~'.expand("<slnum>"))
NetrwKeepj call setline(1,'" ============================================================================')
- NetrwKeepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')')
+ if exists("g:netrw_pchk")
+ " this undocumented option allows pchk to run with different versions of netrw without causing spurious
+ " failure detections.
+ NetrwKeepj call setline(2,'" Netrw Directory Listing')
+ else
+ NetrwKeepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')')
+ endif
+ if exists("g:netrw_pchk")
+ let curdir= substitute(b:netrw_curdir,expand("$HOME"),'~','')
+ else
+ let curdir= b:netrw_curdir
+ endif
if exists("g:netrw_bannerbackslash") && g:netrw_bannerbackslash
- NetrwKeepj call setline(3,'" '.substitute(b:netrw_curdir,'/','\\','g'))
+ NetrwKeepj call setline(3,'" '.substitute(curdir,'/','\\','g'))
else
- NetrwKeepj call setline(3,'" '.b:netrw_curdir)
+ NetrwKeepj call setline(3,'" '.curdir)
endif
let w:netrw_bannercnt= 3
NetrwKeepj exe "sil! NetrwKeepj ".w:netrw_bannercnt
else
+" call Decho("--no banner",'~'.expand("<slnum>"))
NetrwKeepj 1
let w:netrw_bannercnt= 1
endif
-" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." win#".winnr())
+" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." win#".winnr(),'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol()." line($)=".line("$"),'~'.expand("<slnum>"))
let sortby= g:netrw_sort_by
if g:netrw_sort_direction =~ "^r"
@@ -8749,28 +9033,28 @@ fun! s:PerformListing(islocal)
" Sorted by... {{{3
if g:netrw_banner
-" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">")
+" call Decho("--handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">",'~'.expand("<slnum>"))
if g:netrw_sort_by =~ "^n"
-" call Decho("directories will be sorted by name")
+" call Decho("directories will be sorted by name",'~'.expand("<slnum>"))
" sorted by name
NetrwKeepj put ='\" Sorted by '.sortby
NetrwKeepj put ='\" Sort sequence: '.g:netrw_sort_sequence
let w:netrw_bannercnt= w:netrw_bannercnt + 2
else
-" call Decho("directories will be sorted by size or time")
+" call Decho("directories will be sorted by size or time",'~'.expand("<slnum>"))
" sorted by size or date
NetrwKeepj put ='\" Sorted by '.sortby
let w:netrw_bannercnt= w:netrw_bannercnt + 1
endif
exe "sil! NetrwKeepj ".w:netrw_bannercnt
" else " Decho
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
endif
" show copy/move target, if any
if g:netrw_banner
if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal")
-" call Decho("show copy/move target<".s:netrwmftgt.">")
+" call Decho("--show copy/move target<".s:netrwmftgt.">",'~'.expand("<slnum>"))
NetrwKeepj put =''
if s:netrwmftgt_islocal
sil! NetrwKeepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)')
@@ -8779,14 +9063,14 @@ fun! s:PerformListing(islocal)
endif
let w:netrw_bannercnt= w:netrw_bannercnt + 1
else
-" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt")
+" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt",'~'.expand("<slnum>"))
endif
exe "sil! NetrwKeepj ".w:netrw_bannercnt
endif
" Hiding... -or- Showing... {{{3
if g:netrw_banner
-" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)")
+" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1
NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide
@@ -8797,34 +9081,34 @@ fun! s:PerformListing(islocal)
endif
exe "NetrwKeepj ".w:netrw_bannercnt
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
let quickhelp = g:netrw_quickhelp%len(s:QuickHelp)
-" call Decho("quickhelp =".quickhelp)
+" call Decho("quickhelp =".quickhelp,'~'.expand("<slnum>"))
NetrwKeepj put ='\" Quick Help: <F1>:help '.s:QuickHelp[quickhelp]
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
NetrwKeepj put ='\" =============================================================================='
let w:netrw_bannercnt= w:netrw_bannercnt + 2
" else " Decho
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
endif
" bannercnt should index the line just after the banner
if g:netrw_banner
let w:netrw_bannercnt= w:netrw_bannercnt + 1
exe "sil! NetrwKeepj ".w:netrw_bannercnt
-" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
+" call Decho("--w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"),'~'.expand("<slnum>"))
" else " Decho
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
endif
" get list of files
-" call Decho("Get list of files - islocal=".a:islocal)
+" call Decho("--Get list of files - islocal=".a:islocal,'~'.expand("<slnum>"))
if a:islocal
NetrwKeepj call s:LocalListing()
else " remote
NetrwKeepj let badresult= s:NetrwRemoteListing()
if badresult
-" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
+" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
" call Dret("s:PerformListing : error detected by NetrwRemoteListing")
return
endif
@@ -8834,24 +9118,25 @@ fun! s:PerformListing(islocal)
if !exists("w:netrw_bannercnt")
let w:netrw_bannercnt= 0
endif
-" call Decho("g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)")
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("--manipulate directory listing (hide, sort)",'~'.expand("<slnum>"))
+" call Decho("g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)",'~'.expand("<slnum>"))
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
-" call Decho("manipulate directory listing (hide)")
-" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
+" call Decho("manipulate directory listing (hide)",'~'.expand("<slnum>"))
+" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
if g:netrw_hide && g:netrw_list_hide != ""
NetrwKeepj call s:NetrwListHide()
endif
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
-" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">")
+" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">",'~'.expand("<slnum>"))
if g:netrw_sort_by =~ "^n"
" sort by name
NetrwKeepj call s:NetrwSetSort()
if !g:netrw_banner || w:netrw_bannercnt < line("$")
-" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
if g:netrw_sort_direction =~ 'n'
" normal direction sorting
exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
@@ -8861,18 +9146,39 @@ fun! s:PerformListing(islocal)
endif
endif
" remove priority pattern prefix
-" call Decho("remove priority pattern prefix")
+" call Decho("remove priority pattern prefix",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e'
NetrwKeepj call histdel("/",-1)
+ elseif g:netrw_sort_by =~ "^ext"
+ " sort by extension
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g+/+s/^/001'.g:netrw_sepchr.'/'
+ NetrwKeepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$v+[./]+s/^/002'.g:netrw_sepchr.'/'
+ NetrwKeepj call histdel("/",-1)
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$v+['.g:netrw_sepchr.'/]+s/^\(.*\.\)\(.\{-\}\)$/\2'.g:netrw_sepchr.'&/e'
+ NetrwKeepj call histdel("/",-1)
+ if !g:netrw_banner || w:netrw_bannercnt < line("$")
+" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
+ if g:netrw_sort_direction =~ 'n'
+ " normal direction sorting
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
+ else
+ " reverse direction sorting
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
+ endif
+ endif
+ exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^.\{-}'.g:netrw_sepchr.'//e'
+ NetrwKeepj call histdel("/",-1)
+
elseif a:islocal
if !g:netrw_banner || w:netrw_bannercnt < line("$")
-" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction)
+" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction,'~'.expand("<slnum>"))
if g:netrw_sort_direction =~ 'n'
-" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort')
+" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort','~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
else
-" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort!')
+" call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort!','~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
endif
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
@@ -8881,62 +9187,72 @@ fun! s:PerformListing(islocal)
endif
elseif g:netrw_sort_direction =~ 'r'
-" call Decho('(s:PerformListing) reverse the sorted listing')
+" call Decho('(s:PerformListing) reverse the sorted listing','~'.expand("<slnum>"))
if !g:netrw_banner || w:netrw_bannercnt < line('$')
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt
call histdel("/",-1)
endif
endif
endif
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" convert to wide/tree listing {{{3
-" call Decho("modify display if wide/tree listing style")
-" call Decho("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. " (internal#1)")
+" call Decho("--modify display if wide/tree listing style",'~'.expand("<slnum>"))
+" call Decho("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. " (internal#1)",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwWideListing()
-" call Decho("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. " (internal#2)")
+" call Decho("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. " (internal#2)",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwTreeListing(b:netrw_curdir)
-" call Decho("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. " (internal#3)")
+" call Decho("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. " (internal#3)",'~'.expand("<slnum>"))
" resolve symbolic links if local and (thin or tree)
if a:islocal && (w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:TREELIST)
- g/@$/call s:ShowLink()
+" call Decho("--resolve symbolic links if local and thin|tree",'~'.expand("<slnum>"))
+ g/@$/call s:ShowLink()
endif
- if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner)
+ if exists("w:netrw_bannercnt") && (line("$") >= w:netrw_bannercnt || !g:netrw_banner)
" place cursor on the top-left corner of the file listing
-" call Decho("place cursor on top-left corner of file listing")
- exe 'sil! NetrwKeepj '.w:netrw_bannercnt
+" call Decho("--place cursor on top-left corner of file listing",'~'.expand("<slnum>"))
+ exe 'sil! '.w:netrw_bannercnt
sil! NetrwKeepj norm! 0
+" call Decho(" tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol()." line($)=".line("$"),'~'.expand("<slnum>"))
+ else
+" call Decho("--did NOT place cursor on top-left corner",'~'.expand("<slnum>"))
+" call Decho(" w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'),'~'.expand("<slnum>"))
+" call Decho(" line($)=".line("$"),'~'.expand("<slnum>"))
+" call Decho(" g:netrw_banner=".(exists("g:netrw_banner")? g:netrw_banner : 'n/a'),'~'.expand("<slnum>"))
endif
" record previous current directory
let w:netrw_prvdir= b:netrw_curdir
-" call Decho("record netrw_prvdir<".w:netrw_prvdir.">")
+" call Decho("--record netrw_prvdir<".w:netrw_prvdir.">",'~'.expand("<slnum>"))
" save certain window-oriented variables into buffer-oriented variables {{{3
-" call Decho("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. " (internal#4)")
+" call Decho("--save some window-oriented variables into buffer oriented variables",'~'.expand("<slnum>"))
+" call Decho("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. " (internal#4)",'~'.expand("<slnum>"))
NetrwKeepj call s:SetBufWinVars()
-" call Decho("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. " (internal#5)")
+" call Decho("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. " (internal#5)",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionRestore("w:")
-" call Decho("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. " (internal#6)")
+" call Decho("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. " (internal#6)",'~'.expand("<slnum>"))
" set display to netrw display settings
-" call Decho("set display to netrw display settings (".g:netrw_bufsettings.")")
+" call Decho("--set display to netrw display settings (".g:netrw_bufsettings.")",'~'.expand("<slnum>"))
exe "setl ".g:netrw_bufsettings
-" call Decho("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. " (internal#7)")
+" call Decho("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. " (internal#7)",'~'.expand("<slnum>"))
if g:netrw_liststyle == s:LONGLIST
-" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1))
+" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1),'~'.expand("<slnum>"))
exe "setl ts=".(g:netrw_maxfilenamelen+1)
endif
if exists("s:treecurpos")
-" call Decho("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. " (internal#8)")
+" call Decho("s:treecurpos exists; restore posn",'~'.expand("<slnum>"))
+" call Decho("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. " (internal#8)",'~'.expand("<slnum>"))
NetrwKeepj call netrw#RestorePosn(s:treecurpos)
unlet s:treecurpos
endif
-" call Decho("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. " (return)")
+" call Decho("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. " (return)",'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol()." line($)=".line("$"),'~'.expand("<slnum>"))
" call Dret("s:PerformListing : curpos<".string(getpos(".")).">")
endfun
@@ -8947,7 +9263,7 @@ fun! s:SetupNetrwStatusLine(statline)
if !exists("s:netrw_setup_statline")
let s:netrw_setup_statline= 1
-" call Decho("do first-time status line setup")
+" call Decho("do first-time status line setup",'~'.expand("<slnum>"))
if !exists("s:netrw_users_stl")
let s:netrw_users_stl= &stl
@@ -8961,7 +9277,7 @@ fun! s:SetupNetrwStatusLine(statline)
redir @a
try
hi User9
- catch /^Vim\%((\a\+)\)\=:E411/
+ catch /^Vim\%((\a\{3,})\)\=:E411/
if &bg == "dark"
hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue
else
@@ -8977,7 +9293,7 @@ fun! s:SetupNetrwStatusLine(statline)
" make sure statusline is displayed
let &stl=a:statline
setl laststatus=2
-" call Decho("stl=".&stl)
+" call Decho("stl=".&stl,'~'.expand("<slnum>"))
redraw
" call Dret("SetupNetrwStatusLine : stl=".&stl)
@@ -8994,7 +9310,7 @@ endfun
" enforced here.
fun! s:NetrwRemoteFtpCmd(path,listcmd)
" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) w:netrw_method=".(exists("w:netrw_method")? w:netrw_method : (exists("b:netrw_method")? b:netrw_method : "???")))
-" call Decho("line($)=".line("$")." w:netrw_bannercnt=".w:netrw_bannercnt)
+" call Decho("line($)=".line("$")." w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
" sanity check: {{{3
if !exists("w:netrw_method")
if exists("b:netrw_method")
@@ -9009,11 +9325,11 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" WinXX ftp uses unix style input, so set ff to unix " {{{3
let ffkeep= &ff
setl ma ff=unix noro
-" call Decho("setl ma ff=unix noro")
+" call Decho("setl ma ff=unix noro",'~'.expand("<slnum>"))
" clear off any older non-banner lines " {{{3
" note that w:netrw_bannercnt indexes the line after the banner
-" call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d (clear off old non-banner lines)")
+" call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d (clear off old non-banner lines)",'~'.expand("<slnum>"))
exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
".........................................
@@ -9024,16 +9340,16 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
NetrwKeepj call setline(line("$")+1,a:listcmd)
-" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."),''~''.expand("<slnum>"))'
if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
- exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1),'~'.expand("<slnum>"))
+ exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)." ".s:ShellEscape(g:netrw_port,1)
else
-" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
- exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1),'~'.expand("<slnum>"))
+ exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".s:ShellEscape(g:netrw_machine,1)
endif
".........................................
@@ -9048,7 +9364,7 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" handle userid and password
let host= substitute(g:netrw_machine,'\..*$','','')
-" call Decho("host<".host.">")
+" call Decho("host<".host.">",'~'.expand("<slnum>"))
if exists("s:netrw_hup") && exists("s:netrw_hup[host]")
call NetUserPass("ftp:".host)
endif
@@ -9068,7 +9384,7 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
endif
if exists("g:netrw_ftpextracmd")
NetrwKeepj put =g:netrw_ftpextracmd
-" call Decho("filter input: ".getline('.'))
+" call Decho("filter input: ".getline('.'),'~'.expand("<slnum>"))
endif
NetrwKeepj call setline(line("$")+1,a:listcmd)
@@ -9077,11 +9393,11 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
if exists("w:netrw_bannercnt")
-" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."),''~''.expand("<slnum>"))'
call s:NetrwExe(s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
" else " Decho
-" call Decho("WARNING: w:netrw_bannercnt doesn't exist!")
-" g/^./call Decho("SKIPPING ftp#".line(".").": ".getline("."))
+" call Decho("WARNING: w:netrw_bannercnt doesn't exist!",'~'.expand("<slnum>"))
+" g/^./call Decho("SKIPPING ftp#".line(".").": ".getline("."),'~'.expand("<slnum>"))
endif
".........................................
@@ -9148,9 +9464,9 @@ fun! s:NetrwRemoteListing()
" sanity check:
if exists("b:netrw_method") && b:netrw_method =~ '[235]'
-" call Decho("b:netrw_method=".b:netrw_method)
+" call Decho("b:netrw_method=".b:netrw_method,'~'.expand("<slnum>"))
if !executable("ftp")
-" call Decho("ftp is not executable")
+" call Decho("ftp is not executable",'~'.expand("<slnum>"))
if !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18)
endif
@@ -9160,7 +9476,7 @@ fun! s:NetrwRemoteListing()
endif
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
-" call Decho("g:netrw_list_cmd<",(exists("g:netrw_list_cmd")? 'n/a' : "-empty-").">")
+" call Decho("g:netrw_list_cmd<",(exists("g:netrw_list_cmd")? 'n/a' : "-empty-").">",'~'.expand("<slnum>"))
if !exists("g:netrw_quiet")
if g:netrw_list_cmd == ""
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your g:netrw_list_cmd is empty; perhaps ".g:netrw_ssh_cmd." is not executable on your system",47)
@@ -9173,16 +9489,16 @@ fun! s:NetrwRemoteListing()
" call Dret("s:NetrwRemoteListing -1")
return -1
endif " (remote handling sanity check)
-" call Decho("passed remote listing sanity checks")
+" call Decho("passed remote listing sanity checks",'~'.expand("<slnum>"))
if exists("b:netrw_method")
-" call Decho("setting w:netrw_method to b:netrw_method<".b:netrw_method.">")
+" call Decho("setting w:netrw_method to b:netrw_method<".b:netrw_method.">",'~'.expand("<slnum>"))
let w:netrw_method= b:netrw_method
endif
if s:method == "ftp"
" use ftp to get remote file listing {{{3
-" call Decho("use ftp to get remote file listing")
+" call Decho("use ftp to get remote file listing",'~'.expand("<slnum>"))
let s:method = "ftp"
let listcmd = g:netrw_ftp_list_cmd
if g:netrw_sort_by =~ '^t'
@@ -9190,9 +9506,9 @@ fun! s:NetrwRemoteListing()
elseif g:netrw_sort_by =~ '^s'
let listcmd= g:netrw_ftp_sizelist_cmd
endif
-" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)")
+" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)",'~'.expand("<slnum>"))
call s:NetrwRemoteFtpCmd(s:path,listcmd)
-" exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
+" exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."),''~''.expand("<slnum>"))'
" report on missing file or directory messages
if search('[Nn]o such file or directory\|Failed to change directory')
@@ -9210,7 +9526,7 @@ fun! s:NetrwRemoteListing()
if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
" shorten the listing
-" call Decho("generate short listing")
+" call Decho("generate short listing",'~'.expand("<slnum>"))
exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt
" cleanup
@@ -9225,21 +9541,21 @@ fun! s:NetrwRemoteListing()
let line1= line(".")
exe "sil! NetrwKeepj ".w:netrw_bannercnt
let line2= search('\.\.\/\%(\s\|$\)','cnW')
-" call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt)
+" call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("<slnum>"))
if line2 == 0
-" call Decho("netrw is putting ../ into listing")
+" call Decho("netrw is putting ../ into listing",'~'.expand("<slnum>"))
sil! NetrwKeepj put='../'
endif
exe "sil! NetrwKeepj ".line1
sil! NetrwKeepj norm! 0
-" call Decho("line1=".line1." line2=".line2." line(.)=".line("."))
+" call Decho("line1=".line1." line2=".line2." line(.)=".line("."),'~'.expand("<slnum>"))
if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
-" call Decho("M$ ftp cleanup")
+" call Decho("M$ ftp cleanup",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
NetrwKeepj call histdel("/",-1)
else " normal ftp cleanup
-" call Decho("normal ftp cleanup")
+" call Decho("normal ftp cleanup",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
@@ -9251,12 +9567,12 @@ fun! s:NetrwRemoteListing()
else
" use ssh to get remote file listing {{{3
-" call Decho("use ssh to get remote file listing: s:path<".s:path.">")
+" call Decho("use ssh to get remote file listing: s:path<".s:path.">",'~'.expand("<slnum>"))
let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
-" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)")
+" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)",'~'.expand("<slnum>"))
if g:netrw_scp_cmd =~ '^pscp'
-" call Decho("1: exe r! ".shellescape(listcmd.s:path, 1))
- exe "NetrwKeepj r! ".listcmd.shellescape(s:path, 1)
+" call Decho("1: exe r! ".s:ShellEscape(listcmd.s:path, 1),'~'.expand("<slnum>"))
+ exe "NetrwKeepj r! ".listcmd.s:ShellEscape(s:path, 1)
" remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like
sil! NetrwKeepj g/^Listing directory/NetrwKeepj d
sil! NetrwKeepj g/^d[-rwx][-rwx][-rwx]/NetrwKeepj s+$+/+e
@@ -9270,18 +9586,18 @@ fun! s:NetrwRemoteListing()
endif
else
if s:path == ""
-" call Decho("2: exe r! ".listcmd)
+" call Decho("2: exe r! ".listcmd,'~'.expand("<slnum>"))
exe "NetrwKeepj keepalt r! ".listcmd
else
-" call Decho("3: exe r! ".listcmd.' '.shellescape(fnameescape(s:path),1))
- exe "NetrwKeepj keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1)
-" call Decho("listcmd<".listcmd."> path<".s:path.">")
+" call Decho("3: exe r! ".listcmd.' '.s:ShellEscape(fnameescape(s:path),1),'~'.expand("<slnum>"))
+ exe "NetrwKeepj keepalt r! ".listcmd.' '.s:ShellEscape(fnameescape(s:path),1)
+" call Decho("listcmd<".listcmd."> path<".s:path.">",'~'.expand("<slnum>"))
endif
endif
" cleanup
if g:netrw_ssh_browse_reject != ""
-" call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d")
+" call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d",'~'.expand("<slnum>"))
exe "sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d"
NetrwKeepj call histdel("/",-1)
endif
@@ -9289,7 +9605,7 @@ fun! s:NetrwRemoteListing()
if w:netrw_liststyle == s:LONGLIST
" do a long listing; these substitutions need to be done prior to sorting {{{3
-" call Decho("fix long listing:")
+" call Decho("fix long listing:",'~'.expand("<slnum>"))
if s:method == "ftp"
" cleanup
@@ -9312,12 +9628,12 @@ fun! s:NetrwRemoteListing()
endif
if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
-" call Decho("M$ ftp site listing cleanup")
+" call Decho("M$ ftp site listing cleanup",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$")
-" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
+" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"),'~'.expand("<slnum>"))
exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/ -> .*$//e'
- exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
+ exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2 \t\1/e'
exe 'sil NetrwKeepj '.w:netrw_bannercnt
NetrwKeepj call histdel("/",-1)
NetrwKeepj call histdel("/",-1)
@@ -9326,7 +9642,7 @@ fun! s:NetrwRemoteListing()
endif
" if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho
-" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
+" exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."),''~''.expand("<slnum>"))'
" endif " Decho
" call Dret("s:NetrwRemoteListing 0")
@@ -9337,13 +9653,13 @@ endfun
" s:NetrwRemoteRm: remove/delete a remote file or directory {{{2
fun! s:NetrwRemoteRm(usrhost,path) range
" call Dfunc("s:NetrwRemoteRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol("."))
-" call Decho("firstline=".a:firstline." lastline=".a:lastline)
+" call Decho("firstline=".a:firstline." lastline=".a:lastline,'~'.expand("<slnum>"))
let svpos= netrw#SavePosn()
let all= 0
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" remove all marked files
-" call Decho("remove all marked files with bufnr#".bufnr("%"))
+" call Decho("remove all marked files with bufnr#".bufnr("%"),'~'.expand("<slnum>"))
for fname in s:netrwmarkfilelist_{bufnr("%")}
let ok= s:NetrwRemoteRmFile(a:path,fname,all)
if ok =~ 'q\%[uit]'
@@ -9356,10 +9672,12 @@ fun! s:NetrwRemoteRm(usrhost,path) range
else
" remove files specified by range
-" call Decho("remove files specified by range")
+" call Decho("remove files specified by range",'~'.expand("<slnum>"))
" preparation for removing multiple files/directories
- let ctr= a:firstline
+ let keepsol = &l:sol
+ setl nosol
+ let ctr = a:firstline
" remove multiple files and directories
while ctr <= a:lastline
@@ -9372,10 +9690,11 @@ fun! s:NetrwRemoteRm(usrhost,path) range
endif
let ctr= ctr + 1
endwhile
+ let &l:sol = keepsol
endif
" refresh the (remote) directory listing
-" call Decho("refresh remote directory listing")
+" call Decho("refresh remote directory listing",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
NetrwKeepj call netrw#RestorePosn(svpos)
@@ -9392,10 +9711,10 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
if a:rmfile !~ '^"' && (a:rmfile =~ '@$' || a:rmfile !~ '[\/]$')
" attempt to remove file
-" call Decho("attempt to remove file (all=".all.")")
+" call Decho("attempt to remove file (all=".all.")",'~'.expand("<slnum>"))
if !all
echohl Statement
-" call Decho("case all=0:")
+" call Decho("case all=0:",'~'.expand("<slnum>"))
call inputsave()
let ok= input("Confirm deletion of file<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
call inputrestore()
@@ -9410,47 +9729,53 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
endif
if all || ok =~ 'y\%[es]' || ok == ""
-" call Decho("case all=".all." or ok<".ok.">".(exists("w:netrw_method")? ': netrw_method='.w:netrw_method : ""))
+" call Decho("case all=".all." or ok<".ok.">".(exists("w:netrw_method")? ': netrw_method='.w:netrw_method : ""),'~'.expand("<slnum>"))
if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
-" call Decho("case ftp:")
+" call Decho("case ftp:",'~'.expand("<slnum>"))
let path= a:path
- if path =~ '^\a\+://'
- let path= substitute(path,'^\a\+://[^/]\+/','','')
+ if path =~ '^\a\{3,}://'
+ let path= substitute(path,'^\a\{3,}://[^/]\+/','','')
endif
sil! NetrwKeepj .,$d
call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"')
else
-" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">")
+" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">",'~'.expand("<slnum>"))
let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd)
-" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
+" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">",'~'.expand("<slnum>"))
if !exists("b:netrw_curdir")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
let ok="q"
else
let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
-" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
-" call Decho("remotedir<".remotedir.">")
-" call Decho("rmfile<".a:rmfile.">")
+" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">",'~'.expand("<slnum>"))
+" call Decho("remotedir<".remotedir.">",'~'.expand("<slnum>"))
+" call Decho("rmfile<".a:rmfile.">",'~'.expand("<slnum>"))
if remotedir != ""
- let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(remotedir.a:rmfile))
+ let netrw_rm_cmd= netrw_rm_cmd." ".s:ShellEscape(fnameescape(remotedir.a:rmfile))
else
- let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(a:rmfile))
+ let netrw_rm_cmd= netrw_rm_cmd." ".s:ShellEscape(fnameescape(a:rmfile))
endif
-" call Decho("call system(".netrw_rm_cmd.")")
+" call Decho("call system(".netrw_rm_cmd.")",'~'.expand("<slnum>"))
let ret= system(netrw_rm_cmd)
- if ret != 0
- NetrwKeepj call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
+ if v:shell_error != 0
+ if exists("b:netrw_curdir") && b:netrw_curdir != getcwd() && !g:netrw_keepdir
+ call netrw#ErrorMsg(s:ERROR,"remove failed; perhaps due to vim's current directory<".getcwd()."> not matching netrw's (".b:netrw_curdir.") (see :help netrw-c)",102)
+ else
+ call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
+ endif
+ else if ret != 0
+ call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
endif
-" call Decho("returned=".ret." errcode=".v:shell_error)
+" call Decho("returned=".ret." errcode=".v:shell_error,'~'.expand("<slnum>"))
endif
endif
elseif ok =~ 'q\%[uit]'
-" call Decho("ok==".ok)
+" call Decho("ok==".ok,'~'.expand("<slnum>"))
endif
else
" attempt to remove directory
-" call Decho("attempt to remove directory")
+" call Decho("attempt to remove directory",'~'.expand("<slnum>"))
if !all
call inputsave()
let ok= input("Confirm deletion of directory<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
@@ -9469,17 +9794,17 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
else
let rmfile = substitute(a:path.a:rmfile,'/$','','')
- let netrw_rmdir_cmd = s:MakeSshCmd(netrw#WinPath(g:netrw_rmdir_cmd)).' '.shellescape(netrw#WinPath(rmfile))
-" call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")")
+ let netrw_rmdir_cmd = s:MakeSshCmd(netrw#WinPath(g:netrw_rmdir_cmd)).' '.s:ShellEscape(netrw#WinPath(rmfile))
+" call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")",'~'.expand("<slnum>"))
let ret= system(netrw_rmdir_cmd)
-" call Decho("returned=".ret." errcode=".v:shell_error)
+" call Decho("returned=".ret." errcode=".v:shell_error,'~'.expand("<slnum>"))
if v:shell_error != 0
-" call Decho("v:shell_error not 0")
- let netrw_rmf_cmd= s:MakeSshCmd(netrw#WinPath(g:netrw_rmf_cmd)).' '.shellescape(netrw#WinPath(substitute(rmfile,'[\/]$','','e')))
-" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")")
+" call Decho("v:shell_error not 0",'~'.expand("<slnum>"))
+ let netrw_rmf_cmd= s:MakeSshCmd(netrw#WinPath(g:netrw_rmf_cmd)).' '.s:ShellEscape(netrw#WinPath(substitute(rmfile,'[\/]$','','e')))
+" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")",'~'.expand("<slnum>"))
let ret= system(netrw_rmf_cmd)
-" call Decho("returned=".ret." errcode=".v:shell_error)
+" call Decho("returned=".ret." errcode=".v:shell_error,'~'.expand("<slnum>"))
if v:shell_error != 0 && !exists("g:netrw_quiet")
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
@@ -9488,7 +9813,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
endif
elseif ok =~ 'q\%[uit]'
-" call Decho("ok==".ok)
+" call Decho("ok==".ok,'~'.expand("<slnum>"))
endif
endif
@@ -9509,10 +9834,10 @@ fun! s:NetrwRemoteRename(usrhost,path) range
" rename files given by the markfilelist
if exists("s:netrwmarkfilelist_{bufnr('%')}")
for oldname in s:netrwmarkfilelist_{bufnr("%")}
-" call Decho("oldname<".oldname.">")
+" call Decho("oldname<".oldname.">",'~'.expand("<slnum>"))
if exists("subfrom")
let newname= substitute(oldname,subfrom,subto,'')
-" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("<slnum>"))
else
call inputsave()
let newname= input("Moving ".oldname." to : ",oldname)
@@ -9521,16 +9846,16 @@ fun! s:NetrwRemoteRename(usrhost,path) range
let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','')
let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','')
let newname = substitute(oldname,subfrom,subto,'')
-" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("<slnum>"))
endif
endif
-
+
if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
else
- let oldname= shellescape(a:path.oldname)
- let newname= shellescape(a:path.newname)
-" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")")
+ let oldname= s:ShellEscape(a:path.oldname)
+ let newname= s:ShellEscape(a:path.newname)
+" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")",'~'.expand("<slnum>"))
let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname)
endif
@@ -9540,11 +9865,13 @@ fun! s:NetrwRemoteRename(usrhost,path) range
else
" attempt to rename files/directories
+ let keepsol= &l:sol
+ setl nosol
while ctr <= a:lastline
exe "NetrwKeepj ".ctr
let oldname= s:NetrwGetWord()
-" call Decho("oldname<".oldname.">")
+" call Decho("oldname<".oldname.">",'~'.expand("<slnum>"))
call inputsave()
let newname= input("Moving ".oldname." to : ",oldname)
@@ -9553,14 +9880,15 @@ fun! s:NetrwRemoteRename(usrhost,path) range
if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
else
- let oldname= shellescape(a:path.oldname)
- let newname= shellescape(a:path.newname)
-" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")")
+ let oldname= s:ShellEscape(a:path.oldname)
+ let newname= s:ShellEscape(a:path.newname)
+" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")",'~'.expand("<slnum>"))
let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname)
endif
let ctr= ctr + 1
endwhile
+ let &l:sol= keepsol
endif
" refresh the directory
@@ -9589,37 +9917,37 @@ fun! netrw#FileUrlRead(fname)
" call Dfunc("netrw#FileUrlRead(fname<".a:fname.">)")
let fname = a:fname
if fname =~ '^file://localhost/'
-" call Decho('converting file://localhost/ -to- file:///')
+" call Decho('converting file://localhost/ -to- file:///','~'.expand("<slnum>"))
let fname= substitute(fname,'^file://localhost/','file:///','')
-" call Decho("fname<".fname.">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
endif
if (has("win32") || has("win95") || has("win64") || has("win16"))
if fname =~ '^file:///\=\a[|:]/'
-" call Decho('converting file:///\a|/ -to- file://\a:/')
+" call Decho('converting file:///\a|/ -to- file://\a:/','~'.expand("<slnum>"))
let fname = substitute(fname,'^file:///\=\(\a\)[|:]/','file://\1:/','')
-" call Decho("fname<".fname.">")
+" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
endif
endif
let fname2396 = netrw#RFC2396(fname)
let fname2396e= fnameescape(fname2396)
let plainfname= substitute(fname2396,'file://\(.*\)','\1',"")
if (has("win32") || has("win95") || has("win64") || has("win16"))
-" call Decho("windows exception for plainfname")
+" call Decho("windows exception for plainfname",'~'.expand("<slnum>"))
if plainfname =~ '^/\+\a:'
-" call Decho('removing leading "/"s')
+" call Decho('removing leading "/"s','~'.expand("<slnum>"))
let plainfname= substitute(plainfname,'^/\+\(\a:\)','\1','')
endif
endif
-" call Decho("fname2396<".fname2396.">")
-" call Decho("plainfname<".plainfname.">")
+" call Decho("fname2396<".fname2396.">",'~'.expand("<slnum>"))
+" call Decho("plainfname<".plainfname.">",'~'.expand("<slnum>"))
exe "sil doau BufReadPre ".fname2396e
exe 'NetrwKeepj r '.plainfname
exe 'sil! bdelete '.plainfname
exe 'keepalt file! '.plainfname
NetrwKeepj 1d
-" call Decho("setl nomod")
+" call Decho("setl nomod",'~'.expand("<slnum>"))
setl nomod
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("netrw#FileUrlRead")
exe "sil doau BufReadPost ".fname2396e
endfun
@@ -9627,6 +9955,7 @@ endfun
" ---------------------------------------------------------------------
" netrw#LocalBrowseCheck: {{{2
fun! netrw#LocalBrowseCheck(dirname)
+ " This function is called by netrwPlugin.vim's s:LocalBrowse() and by s:NetrwRexplore()
" unfortunate interaction -- split window debugging can't be
" used here, must use D-echoRemOn or D-echoTabOn -- the BufEnter
" event triggers another call to LocalBrowseCheck() when attempts
@@ -9635,33 +9964,32 @@ fun! netrw#LocalBrowseCheck(dirname)
" would hit when re-entering netrw windows, creating unexpected
" refreshes (and would do so in the middle of NetrwSaveOptions(), too)
" call Dfunc("netrw#LocalBrowseCheck(dirname<".a:dirname.">")
-" call Decho("isdir<".a:dirname.">=".isdirectory(a:dirname).((exists("s:treeforceredraw")? " treeforceredraw" : "")))
-" call Decho("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 Decho("isdir<".a:dirname.">=".isdirectory(s:NetrwFile(a:dirname)).((exists("s:treeforceredraw")? " treeforceredraw" : "")).expand("<slnum>"))
+" call Decho("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,'~'.expand("<slnum>"))
" call Dredir("ls!","ls!")
- norm! m`
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
+" call Decho("current buffer#".bufnr("%")."<".bufname("%")."> ft=".&ft,'~'.expand("<slnum>"))
let ykeep= @@
- if isdirectory(a:dirname)
-" call Decho("is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse)
- let svposn= netrw#SavePosn()
+ if isdirectory(s:NetrwFile(a:dirname))
+" call Decho("is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse,'~'.expand("<slnum>"))
if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1
-" call Decho("case 1 : ft=".&ft)
+" call Decho("case 1 : ft=".&ft,'~'.expand("<slnum>"))
+" call Decho("s:rexposn_".bufnr("%")."<".bufname("%")."> ".(exists("s:rexposn_".bufnr("%"))? "exists" : "does not exist"),'~'.expand("<slnum>"))
sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
- NetrwKeepj keepalt call netrw#RestorePosn(svposn)
elseif &ft == "netrw" && line("$") == 1
-" call Decho("case 2 (ft≡netrw && line($)≡1)")
+" call Decho("case 2 (ft≡netrw && line($)≡1)",'~'.expand("<slnum>"))
sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
- NetrwKeepj keepalt call netrw#RestorePosn(svposn)
elseif exists("s:treeforceredraw")
-" call Decho("case 3 (treeforceredraw)")
+" call Decho("case 3 (treeforceredraw)",'~'.expand("<slnum>"))
unlet s:treeforceredraw
sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
- NetrwKeepj keepalt call netrw#RestorePosn(svposn)
endif
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" call Dret("netrw#LocalBrowseCheck")
return
endif
@@ -9670,18 +9998,19 @@ fun! netrw#LocalBrowseCheck(dirname)
" IF g:netrw_fastbrowse is zero (ie. slow browsing selected)
" AND IF the listing style is not a tree listing
if exists("g:netrw_fastbrowse") && g:netrw_fastbrowse == 0 && g:netrw_liststyle != s:TREELIST
-" call Decho("wiping out currently unused netrw buffers")
+" call Decho("wiping out currently unused netrw buffers",'~'.expand("<slnum>"))
let ibuf = 1
let buflast = bufnr("$")
while ibuf <= buflast
- if bufwinnr(ibuf) == -1 && isdirectory(bufname(ibuf))
- exe "sil! keepalt ".ibuf."bw!"
+ if bufwinnr(ibuf) == -1 && isdirectory(s:NetrwFile(bufname(ibuf)))
+ exe "sil! keepj keepalt ".ibuf."bw!"
endif
let ibuf= ibuf + 1
endwhile
endif
let @@= ykeep
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
" not a directory, ignore it
" call Dret("netrw#LocalBrowseCheck : not a directory, ignoring it; dirname<".a:dirname.">")
endfun
@@ -9693,8 +10022,8 @@ endfun
" on the chance that s/he removed/created a file/directory with it.
fun! s:LocalBrowseRefresh()
" call Dfunc("s:LocalBrowseRefresh() tabpagenr($)=".tabpagenr("$"))
-" call Decho("s:netrw_browselist =".(exists("s:netrw_browselist")? string(s:netrw_browselist) : '<n/a>'))
-" call Decho("w:netrw_bannercnt =".(exists("w:netrw_bannercnt")? string(w:netrw_bannercnt) : '<n/a>'))
+" call Decho("s:netrw_browselist =".(exists("s:netrw_browselist")? string(s:netrw_browselist) : '<n/a>'),'~'.expand("<slnum>"))
+" call Decho("w:netrw_bannercnt =".(exists("w:netrw_bannercnt")? string(w:netrw_bannercnt) : '<n/a>'),'~'.expand("<slnum>"))
" determine which buffers currently reside in a tab
if !exists("s:netrw_browselist")
@@ -9719,36 +10048,38 @@ fun! s:LocalBrowseRefresh()
let itab = itab + 1
tabn
endwhile
-" call Decho("buftablist".string(buftablist))
-" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">")
+" call Decho("buftablist".string(buftablist),'~'.expand("<slnum>"))
+" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">",'~'.expand("<slnum>"))
" GO through all buffers on netrw_browselist (ie. just local-netrw buffers):
" | refresh any netrw window
" | wipe out any non-displaying netrw buffer
let curwin = winnr()
let ibl = 0
for ibuf in s:netrw_browselist
-" call Decho("bufwinnr(".ibuf.") index(buftablist,".ibuf.")=".index(buftablist,ibuf))
+" call Decho("bufwinnr(".ibuf.") index(buftablist,".ibuf.")=".index(buftablist,ibuf),'~'.expand("<slnum>"))
if bufwinnr(ibuf) == -1 && index(buftablist,ibuf) == -1
" wipe out any non-displaying netrw buffer
-" call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">")
- exe "sil! bd ".fnameescape(ibuf)
+" call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">",'~'.expand("<slnum>"))
+ exe "sil! keepj bd ".fnameescape(ibuf)
call remove(s:netrw_browselist,ibl)
-" call Decho("browselist=".string(s:netrw_browselist))
+" call Decho("browselist=".string(s:netrw_browselist),'~'.expand("<slnum>"))
continue
elseif index(tabpagebuflist(),ibuf) != -1
" refresh any netrw buffer
-" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf))
+" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf),'~'.expand("<slnum>"))
exe bufwinnr(ibuf)."wincmd w"
if getline(".") =~ 'Quick Help'
" decrement g:netrw_quickhelp to prevent refresh from changing g:netrw_quickhelp
" (counteracts s:NetrwBrowseChgDir()'s incrementing)
let g:netrw_quickhelp= g:netrw_quickhelp - 1
endif
-" call Decho("#3: quickhelp=".g:netrw_quickhelp)
+" call Decho("#3: quickhelp=".g:netrw_quickhelp,'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
endif
let ibl= ibl + 1
+" call Decho("bottom of s:netrw_browselist for loop: ibl=".ibl,'~'.expand("<slnum>"))
endfor
+" call Decho("restore window: exe ".curwin."wincmd w",'~'.expand("<slnum>"))
exe curwin."wincmd w"
let @@= ykeep
@@ -9759,10 +10090,10 @@ endfun
" s:LocalFastBrowser: handles setting up/taking down fast browsing for the local browser {{{2
"
" g:netrw_ Directory Is
-" fastbrowse Local Remote
+" fastbrowse Local Remote
" slow 0 D D D=Deleting a buffer implies it will not be re-used (slow)
" med 1 D H H=Hiding a buffer implies it may be re-used (fast)
-" fast 2 H H
+" fast 2 H H
"
" Deleting a buffer means that it will be re-loaded when examined, hence "slow".
" Hiding a buffer means that it will be re-used when examined, hence "fast".
@@ -9775,21 +10106,21 @@ endfun
" =2: autocmds installed (doesn't ignore any FocusGained events)
fun! s:LocalFastBrowser()
" call Dfunc("LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse)
-" call Decho("s:netrw_events ".(exists("s:netrw_events")? "exists" : 'n/a'))
-" call Decho("autocmd: ShellCmdPost ".(exists("#ShellCmdPost")? "installed" : "not installed"))
-" call Decho("autocmd: FocusGained ".(exists("#FocusGained")? "installed" : "not installed"))
+" call Decho("s:netrw_events ".(exists("s:netrw_events")? "exists" : 'n/a'),'~'.expand("<slnum>"))
+" call Decho("autocmd: ShellCmdPost ".(exists("#ShellCmdPost")? "installed" : "not installed"),'~'.expand("<slnum>"))
+" call Decho("autocmd: FocusGained ".(exists("#FocusGained")? "installed" : "not installed"),'~'.expand("<slnum>"))
" initialize browselist, a list of buffer numbers that the local browser has used
if !exists("s:netrw_browselist")
-" call Decho("initialize s:netrw_browselist")
+" call Decho("initialize s:netrw_browselist",'~'.expand("<slnum>"))
let s:netrw_browselist= []
endif
" append current buffer to fastbrowse list
if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1]
-" call Decho("appendng current buffer to browselist")
+" call Decho("appendng current buffer to browselist",'~'.expand("<slnum>"))
call add(s:netrw_browselist,bufnr("%"))
-" call Decho("browselist=".string(s:netrw_browselist))
+" call Decho("browselist=".string(s:netrw_browselist),'~'.expand("<slnum>"))
endif
" enable autocmd events to handle refreshing/removing local browser buffers
@@ -9803,10 +10134,10 @@ fun! s:LocalFastBrowser()
augroup AuNetrwEvent
au!
if (has("win32") || has("win95") || has("win64") || has("win16"))
-" call Decho("installing autocmd: ShellCmdPost")
+" call Decho("installing autocmd: ShellCmdPost",'~'.expand("<slnum>"))
au ShellCmdPost * call s:LocalBrowseRefresh()
else
-" call Decho("installing autocmds: ShellCmdPost FocusGained")
+" call Decho("installing autocmds: ShellCmdPost FocusGained",'~'.expand("<slnum>"))
au ShellCmdPost,FocusGained * call s:LocalBrowseRefresh()
endif
augroup END
@@ -9814,7 +10145,7 @@ fun! s:LocalFastBrowser()
" user must have changed fastbrowse to its fast setting, so remove
" the associated autocmd events
elseif g:netrw_fastbrowse > 1 && exists("#ShellCmdPost") && exists("s:netrw_events")
-" call Decho("remove AuNetrwEvent autcmd group")
+" call Decho("remove AuNetrwEvent autcmd group",'~'.expand("<slnum>"))
unlet s:netrw_events
augroup AuNetrwEvent
au!
@@ -9829,70 +10160,78 @@ endfun
" s:LocalListing: does the job of "ls" for local directories {{{2
fun! s:LocalListing()
" call Dfunc("s:LocalListing()")
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
+" call Decho("modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("<slnum>"))
+" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
-" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist") |endif
-" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist",'~'.expand("<slnum>")) |endif
+" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist",'~'.expand("<slnum>"))|endif
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" get the list of files contained in the current directory
let dirname = b:netrw_curdir
let dirnamelen = strlen(b:netrw_curdir)
- let filelist = glob(s:ComposePath(dirname,"*"),0,1)
- let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1)
-" call Decho("filelist=".string(filelist))
+ if v:version == 704 && has("patch656")
+" call Decho("using glob with patch656",'~'.expand("<slnum>"))
+ let filelist = glob(s:ComposePath(dirname,"*"),0,1,1)
+ let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1,1)
+ else
+" call Decho("using glob without patch656",'~'.expand("<slnum>"))
+ let filelist = glob(s:ComposePath(dirname,"*"),0,1)
+ let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1)
+ endif
+" call Decho("filelist=".string(filelist),'~'.expand("<slnum>"))
if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16"))
-" call Decho("filelist=".string(filelist))
+" call Decho("filelist=".string(filelist),'~'.expand("<slnum>"))
elseif index(filelist,'..') == -1 && b:netrw_curdir !~ '/'
" include ../ in the glob() entry if its missing
-" call Decho("forcibly including on \"..\"")
+" call Decho("forcibly including on \"..\"",'~'.expand("<slnum>"))
let filelist= filelist+[s:ComposePath(b:netrw_curdir,"../")]
-" call Decho("filelist=".string(filelist))
+" call Decho("filelist=".string(filelist),'~'.expand("<slnum>"))
endif
-" call Decho("before while: dirname<".dirname.">")
-" call Decho("before while: dirnamelen<".dirnamelen.">")
-" call Decho("before while: filelist=".string(filelist))
+" call Decho("before while: dirname<".dirname.">",'~'.expand("<slnum>"))
+" call Decho("before while: dirnamelen<".dirnamelen.">",'~'.expand("<slnum>"))
+" call Decho("before while: filelist=".string(filelist),'~'.expand("<slnum>"))
if get(g:, 'netrw_dynamic_maxfilenamelen', 0)
let filelistcopy = map(deepcopy(filelist),'fnamemodify(v:val, ":t")')
let g:netrw_maxfilenamelen = max(map(filelistcopy,'len(v:val)')) + 1
-" call Decho("dynamic_maxfilenamelen: filenames =".string(filelistcopy))
-" call Decho("dynamic_maxfilenamelen: g:netrw_maxfilenamelen=".g:netrw_maxfilenamelen)
+" call Decho("dynamic_maxfilenamelen: filenames =".string(filelistcopy),'~'.expand("<slnum>"))
+" call Decho("dynamic_maxfilenamelen: g:netrw_maxfilenamelen=".g:netrw_maxfilenamelen,'~'.expand("<slnum>"))
endif
-" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
+" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
for filename in filelist
-" call Decho(" ")
-" call Decho("for filename in filelist: filename<".filename.">")
+" call Decho(" ",'~'.expand("<slnum>"))
+" call Decho("for filename in filelist: filename<".filename.">",'~'.expand("<slnum>"))
if getftype(filename) == "link"
" indicate a symbolic link
-" call Decho("indicate <".filename."> is a symbolic link with trailing @")
+" call Decho("indicate <".filename."> is a symbolic link with trailing @",'~'.expand("<slnum>"))
let pfile= filename."@"
elseif getftype(filename) == "socket"
" indicate a socket
-" call Decho("indicate <".filename."> is a socket with trailing =")
+" call Decho("indicate <".filename."> is a socket with trailing =",'~'.expand("<slnum>"))
let pfile= filename."="
elseif getftype(filename) == "fifo"
" indicate a fifo
-" call Decho("indicate <".filename."> is a fifo with trailing |")
+" call Decho("indicate <".filename."> is a fifo with trailing |",'~'.expand("<slnum>"))
let pfile= filename."|"
- elseif isdirectory(filename)
+ elseif isdirectory(s:NetrwFile(filename))
" indicate a directory
-" call Decho("indicate <".filename."> is a directory with trailing /")
+" call Decho("indicate <".filename."> is a directory with trailing /",'~'.expand("<slnum>"))
let pfile= filename."/"
- elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(filename)
+ elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(s:NetrwFile(filename))
if (has("win32") || has("win95") || has("win64") || has("win16"))
if filename =~ '\.[eE][xX][eE]$' || filename =~ '\.[cC][oO][mM]$' || filename =~ '\.[bB][aA][tT]$'
" indicate an executable
-" call Decho("indicate <".filename."> is executable with trailing *")
+" call Decho("indicate <".filename."> is executable with trailing *",'~'.expand("<slnum>"))
let pfile= filename."*"
else
" normal file
@@ -9900,7 +10239,7 @@ fun! s:LocalListing()
endif
elseif executable(filename)
" indicate an executable
-" call Decho("indicate <".filename."> is executable with trailing *")
+" call Decho("indicate <".filename."> is executable with trailing *",'~'.expand("<slnum>"))
let pfile= filename."*"
else
" normal file
@@ -9911,45 +10250,45 @@ fun! s:LocalListing()
" normal file
let pfile= filename
endif
-" call Decho("pfile<".pfile."> (after *@/ appending)")
+" call Decho("pfile<".pfile."> (after *@/ appending)",'~'.expand("<slnum>"))
if pfile =~ '//$'
let pfile= substitute(pfile,'//$','/','e')
-" call Decho("change // to /: pfile<".pfile.">")
+" call Decho("change // to /: pfile<".pfile.">",'~'.expand("<slnum>"))
endif
let pfile= strpart(pfile,dirnamelen)
let pfile= substitute(pfile,'^[/\\]','','e')
-" call Decho("filename<".filename.">")
-" call Decho("pfile <".pfile.">")
+" call Decho("filename<".filename.">",'~'.expand("<slnum>"))
+" call Decho("pfile <".pfile.">",'~'.expand("<slnum>"))
if w:netrw_liststyle == s:LONGLIST
let sz = getfsize(filename)
let fsz = strpart(" ",1,15-strlen(sz)).sz
let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
-" call Decho("sz=".sz." fsz=".fsz)
+" call Decho("sz=".sz." fsz=".fsz,'~'.expand("<slnum>"))
endif
if g:netrw_sort_by =~ "^t"
" sort by time (handles time up to 1 quintillion seconds, US)
-" call Decho("getftime(".filename.")=".getftime(filename))
+" call Decho("getftime(".filename.")=".getftime(filename),'~'.expand("<slnum>"))
let t = getftime(filename)
let ft = strpart("000000000000000000",1,18-strlen(t)).t
-" call Decho("exe NetrwKeepj put ='".ft.'/'.filename."'")
+" call Decho("exe NetrwKeepj put ='".ft.'/'.filename."'",'~'.expand("<slnum>"))
let ftpfile= ft.'/'.pfile
sil! NetrwKeepj put=ftpfile
elseif g:netrw_sort_by =~ "^s"
" sort by size (handles file sizes up to 1 quintillion bytes, US)
-" call Decho("getfsize(".filename.")=".getfsize(filename))
+" call Decho("getfsize(".filename.")=".getfsize(filename),'~'.expand("<slnum>"))
let sz = getfsize(filename)
let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
-" call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'")
+" call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'",'~'.expand("<slnum>"))
let fszpfile= fsz.'/'.pfile
sil! NetrwKeepj put =fszpfile
else
" sort by name
-" call Decho("exe NetrwKeepj put ='".pfile."'")
+" call Decho("exe NetrwKeepj put ='".pfile."'",'~'.expand("<slnum>"))
sil! NetrwKeepj put=pfile
endif
endfor
@@ -9958,7 +10297,7 @@ fun! s:LocalListing()
sil! NetrwKeepj g/^$/d
sil! NetrwKeepj %s/\r$//e
call histdel("/",-1)
-" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1))
+" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1),'~'.expand("<slnum>"))
exe "setl ts=".(g:netrw_maxfilenamelen+1)
" call Dret("s:LocalListing")
@@ -9978,9 +10317,9 @@ fun! s:NetrwLocalExecute(cmd)
endif
let optargs= input(":!".a:cmd,"","file")
-" call Decho("optargs<".optargs.">")
+" call Decho("optargs<".optargs.">",'~'.expand("<slnum>"))
let result= system(a:cmd.optargs)
-" call Decho("result)
+" call Decho("result,'~'.expand("<slnum>"))
" strip any ansi escape sequences off
let result = substitute(result,"\e\\[[0-9;]*m","","g")
@@ -9998,32 +10337,39 @@ fun! s:NetrwLocalRename(path) range
" call Dfunc("NetrwLocalRename(path<".a:path.">)")
" preparation for removing multiple files/directories
- let ykeep = @@
- let ctr = a:firstline
- let svpos = netrw#SavePosn()
+ let ykeep = @@
+ let ctr = a:firstline
+ let svpos = netrw#SavePosn()
" rename files given by the markfilelist
if exists("s:netrwmarkfilelist_{bufnr('%')}")
for oldname in s:netrwmarkfilelist_{bufnr("%")}
-" call Decho("oldname<".oldname.">")
+" call Decho("oldname<".oldname.">",'~'.expand("<slnum>"))
if exists("subfrom")
let newname= substitute(oldname,subfrom,subto,'')
-" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("<slnum>"))
else
call inputsave()
- let newname= input("Moving ".oldname." to : ",oldname)
+ let newname= input("Moving ".oldname." to : ",oldname,"file")
call inputrestore()
+ if newname =~ ''
+ " two ctrl-x's : ignore all of string preceding the ctrl-x's
+ let newname = substitute(newname,'^.*','','')
+ elseif newname =~ ''
+ " one ctrl-x : ignore portion of string preceding ctrl-x but after last /
+ let newname = substitute(newname,'[^/]*','','')
+ endif
if newname =~ '^s/'
let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','')
let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','')
-" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("<slnum>"))
let newname = substitute(oldname,subfrom,subto,'')
endif
endif
call rename(oldname,newname)
endfor
call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
-
+
else
" attempt to rename files/directories
@@ -10043,21 +10389,21 @@ fun! s:NetrwLocalRename(path) range
NetrwKeepj norm! 0
let oldname= s:ComposePath(a:path,curword)
-" call Decho("oldname<".oldname.">")
+" call Decho("oldname<".oldname.">",'~'.expand("<slnum>"))
call inputsave()
let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e'))
call inputrestore()
call rename(oldname,newname)
-" call Decho("renaming <".oldname."> to <".newname.">")
+" call Decho("renaming <".oldname."> to <".newname.">",'~'.expand("<slnum>"))
let ctr= ctr + 1
endwhile
endif
" refresh the directory
-" call Decho("refresh the directory listing")
+" call Decho("refresh the directory listing",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
NetrwKeepj call netrw#RestorePosn(svpos)
let @@= ykeep
@@ -10069,7 +10415,7 @@ endfun
" s:NetrwLocalRm: {{{2
fun! s:NetrwLocalRm(path) range
" call Dfunc("s:NetrwLocalRm(path<".a:path.">)")
-" call Decho("firstline=".a:firstline." lastline=".a:lastline)
+" call Decho("firstline=".a:firstline." lastline=".a:lastline,'~'.expand("<slnum>"))
" preparation for removing multiple files/directories
let ykeep = @@
@@ -10079,7 +10425,7 @@ fun! s:NetrwLocalRm(path) range
if exists("s:netrwmarkfilelist_{bufnr('%')}")
" remove all marked files
-" call Decho("remove all marked files")
+" call Decho("remove all marked files",'~'.expand("<slnum>"))
for fname in s:netrwmarkfilelist_{bufnr("%")}
let ok= s:NetrwLocalRmFile(a:path,fname,all)
if ok =~ 'q\%[uit]' || ok == "no"
@@ -10092,8 +10438,10 @@ fun! s:NetrwLocalRm(path) range
else
" remove (multiple) files and directories
-" call Decho("remove files in range [".a:firstline.",".a:lastline."]")
+" call Decho("remove files in range [".a:firstline.",".a:lastline."]",'~'.expand("<slnum>"))
+ let keepsol= &l:sol
+ setl nosol
let ctr = a:firstline
while ctr <= a:lastline
exe "NetrwKeepj ".ctr
@@ -10116,10 +10464,11 @@ fun! s:NetrwLocalRm(path) range
endif
let ctr= ctr + 1
endwhile
+ let &l:sol= keepsol
endif
" refresh the directory
-" call Decho("bufname<".bufname("%").">")
+" call Decho("bufname<".bufname("%").">",'~'.expand("<slnum>"))
if bufname("%") != "NetrwMessage"
NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
NetrwKeepj call netrw#RestorePosn(svpos)
@@ -10134,16 +10483,16 @@ endfun
" Give confirmation prompt unless all==1
fun! s:NetrwLocalRmFile(path,fname,all)
" call Dfunc("s:NetrwLocalRmFile(path<".a:path."> fname<".a:fname."> all=".a:all)
-
+
let all= a:all
let ok = ""
NetrwKeepj norm! 0
- let rmfile= s:ComposePath(a:path,a:fname)
-" call Decho("rmfile<".rmfile.">")
+ let rmfile= s:NetrwFile(s:ComposePath(a:path,a:fname))
+" call Decho("rmfile<".rmfile.">",'~'.expand("<slnum>"))
if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
" attempt to remove file
-" call Decho("attempt to remove file<".rmfile.">")
+" call Decho("attempt to remove file<".rmfile.">",'~'.expand("<slnum>"))
if !all
echohl Statement
call inputsave()
@@ -10153,9 +10502,9 @@ fun! s:NetrwLocalRmFile(path,fname,all)
if ok == ""
let ok="no"
endif
-" call Decho("response: ok<".ok.">")
+" call Decho("response: ok<".ok.">",'~'.expand("<slnum>"))
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
-" call Decho("response: ok<".ok."> (after sub)")
+" call Decho("response: ok<".ok."> (after sub)",'~'.expand("<slnum>"))
if ok =~ 'a\%[ll]'
let all= 1
endif
@@ -10163,7 +10512,7 @@ fun! s:NetrwLocalRmFile(path,fname,all)
if all || ok =~ 'y\%[es]' || ok == ""
let ret= s:NetrwDelete(rmfile)
-" call Decho("errcode=".v:shell_error." ret=".ret)
+" call Decho("errcode=".v:shell_error." ret=".ret,'~'.expand("<slnum>"))
endif
else
@@ -10184,19 +10533,19 @@ fun! s:NetrwLocalRmFile(path,fname,all)
let rmfile= substitute(rmfile,'[\/]$','','e')
if all || ok =~ 'y\%[es]' || ok == ""
-" call Decho("1st attempt: system(netrw#WinPath(".g:netrw_localrmdir.') '.shellescape(rmfile).')')
- call system(netrw#WinPath(g:netrw_localrmdir).' '.shellescape(rmfile))
-" call Decho("v:shell_error=".v:shell_error)
+" call Decho("1st attempt: system(netrw#WinPath(".g:netrw_localrmdir.') '.s:ShellEscape(rmfile).')','~'.expand("<slnum>"))
+ call system(netrw#WinPath(g:netrw_localrmdir).' '.s:ShellEscape(rmfile))
+" call Decho("v:shell_error=".v:shell_error,'~'.expand("<slnum>"))
if v:shell_error != 0
-" call Decho("2nd attempt to remove directory<".rmfile.">")
+" call Decho("2nd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
let errcode= s:NetrwDelete(rmfile)
-" call Decho("errcode=".errcode)
+" call Decho("errcode=".errcode,'~'.expand("<slnum>"))
if errcode != 0
if has("unix")
-" call Decho("3rd attempt to remove directory<".rmfile.">")
- call system("rm ".shellescape(rmfile))
+" call Decho("3rd attempt to remove directory<".rmfile.">",'~'.expand("<slnum>"))
+ call system("rm ".s:ShellEscape(rmfile))
if v:shell_error != 0 && !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34)
let ok="no"
@@ -10232,6 +10581,18 @@ fun! netrw#Access(ilist)
return s:netrwmftgt
endfun
+" ---------------------------------------------------------------------
+" netrw#Call: allows user-specified mappings to call internal netrw functions {{{2
+fun! netrw#Call(funcname,...)
+" call Dfunc("netrw#Call(funcname<".a:funcname.">,".string(a:000).")")
+ if a:0 > 0
+ exe "call s:".a:funcname."(".string(a:000).")"
+ else
+ exe "call s:".a:funcname."()"
+ endif
+" call Dret("netrw#Call")
+endfun
+
" ------------------------------------------------------------------------
" netrw#RestorePosn: restores the cursor and file position as saved by netrw#SavePosn() {{{2
fun! netrw#RestorePosn(...)
@@ -10247,22 +10608,22 @@ fun! netrw#RestorePosn(...)
if a:0 > 0
exe "keepj ".a:1
endif
-" "call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'))
-" "call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+" "call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'),'~'.expand("<slnum>"))
+" "call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
if exists("liststyle") && exists("w:netrw_liststyle") && liststyle != w:netrw_liststyle
let usesrch= 1
else
let usesrch= 0
endif
-" "call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1))
-" "call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1))
-" "call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0))
-" "call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
+" "call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1),'~'.expand("<slnum>"))
+" "call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1),'~'.expand("<slnum>"))
+" "call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0),'~'.expand("<slnum>"))
+" "call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'),'~'.expand("<slnum>"))
" restore window
if exists("w:netrw_winnr")
-" "call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w")
+" "call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w",'~'.expand("<slnum>"))
exe "sil! ".w:netrw_winnr."wincmd w"
endif
" if v:shell_error == 0
@@ -10273,34 +10634,34 @@ fun! netrw#RestorePosn(...)
" restore top-of-screen line
if exists("w:netrw_hline")
-" "call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z")
+" "call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z",'~'.expand("<slnum>"))
exe "keepj norm! ".w:netrw_hline."G0z\<CR>"
endif
" restore position
" when the window's height x width has changed, the line,col is no longer useful
if w:netrw_winh == winheight(0) && w:netrw_winw == winwidth(0) && exists("w:netrw_line") && exists("w:netrw_col") && !usesrch
-" "call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
+" "call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|",'~'.expand("<slnum>"))
exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
elseif exists("w:netrw_winfile")
if !search('\<'.escape(w:netrw_winfile,g:netrw_fname_escape),'cw')
if exists("w:netrw_bannercnt")
-" "call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
exe "keepj ".w:netrw_bannercnt
norm! 0
else
" go to upper left corner
-" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
keepj 1
norm! 0
endif
else
-" "call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
+" "call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">",'~'.expand("<slnum>"))
endif
else
-" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
+" "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0),'~'.expand("<slnum>"))
keepj 1
norm! 0
endif
@@ -10310,6 +10671,39 @@ fun! netrw#RestorePosn(...)
endfun
" ---------------------------------------------------------------------
+" netrw#Expose: allows UserMaps and pchk to look at otherwise script-local variables {{{2
+" I expect this function to be used in
+" :PChkAssert netrw#Expose("netrwmarkfilelist")
+" for example.
+fun! netrw#Expose(varname)
+" call Dfunc("netrw#Expose(varname<".a:varname.">)")
+ exe "let retval= s:".a:varname
+ if exists("g:netrw_pchk")
+ if type(retval) == 3
+ let retval = copy(retval)
+ let i = 0
+ while i < len(retval)
+ let retval[i]= substitute(retval[i],expand("$HOME"),'~','')
+ let i = i + 1
+ endwhile
+ endif
+" call Dret("netrw#Expose ".string(retval))
+ return string(retval)
+ endif
+
+" call Dret("netrw#Expose ".string(retval))
+ return retval
+endfun
+
+" ---------------------------------------------------------------------
+" netrw#Modify: allows UserMaps to set (modify) script-local variables {{{2
+fun! netrw#Modify(varname,newvalue)
+" call Dfunc("netrw#Modify(varname<".a:varname.">,newvalue<".string(a:newvalue).">)")
+ exe "let s:".a:varname."= ".string(a:newvalue)
+" call Dret("netrw#Modify")
+endfun
+
+" ---------------------------------------------------------------------
" netrw#RFC2396: converts %xx into characters {{{2
fun! netrw#RFC2396(fname)
" call Dfunc("netrw#RFC2396(fname<".a:fname.">)")
@@ -10321,27 +10715,27 @@ endfun
" ---------------------------------------------------------------------
" netrw#SavePosn: saves position of cursor on screen {{{2
fun! netrw#SavePosn()
-" call Dfunc("netrw#SavePosn() line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol())
+" call Dfunc("netrw#SavePosn() win#".winnr()." line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol())
" Save current line and column
let w:netrw_winnr= winnr()
let w:netrw_line = line(".")
let w:netrw_col = virtcol(".")
-" "call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
+" "call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col,'~'.expand("<slnum>"))
" save filename under cursor
-" "call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
+" "call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'),'~'.expand("<slnum>"))
if exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt && &ft == "netrw"
let winfile = "|let w:netrw_winfile=\"".fnameescape(s:NetrwGetWord())."\""
else
let winfile= ""
endif
-" "call Decho("winfile<".winfile.">")
+" "call Decho("winfile<".winfile.">",'~'.expand("<slnum>"))
if exists("w:netrw_liststyle")
let liststyle = "|let liststyle=".w:netrw_liststyle
else
let liststyle= ""
endif
-" "call Decho("liststyle=".liststyle)
+" "call Decho("liststyle=".liststyle,'~'.expand("<slnum>"))
" Save top-of-screen line
keepj norm! H0
@@ -10356,11 +10750,51 @@ fun! netrw#SavePosn()
let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline."|let w:netrw_winh=".w:netrw_winh."|let w:netrw_winw=".w:netrw_winw.liststyle.winfile
keepj call netrw#RestorePosn()
-" call Dret("netrw#SavePosn : winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : "n/a")." line=".(exists("w:netrw_line")? w:netrw_line : "n/a")." col=".(exists("w:netrw_col")? w:netrw_col : "n/a")." hline=".(exists("w:netrw_hline")? w:netrw_hline : "n/a"))
+" call Dret("netrw#SavePosn : win#=".(exists("w:netrw_winnr")? w:netrw_winnr : "n/a")." line=".(exists("w:netrw_line")? w:netrw_line : "n/a")." col=".(exists("w:netrw_col")? w:netrw_col : "n/a")." hline=".(exists("w:netrw_hline")? w:netrw_hline : "n/a"))
return ret
endfun
" ---------------------------------------------------------------------
+" netrw#UserMaps: supports user-specified maps {{{2
+" see :help function()
+"
+" g:Netrw_UserMaps is a List with members such as:
+" [[keymap sequence, function reference],...]
+"
+" The referenced function may return a string,
+" refresh : refresh the display
+" -other- : this string will be executed
+" or it may return a List of strings.
+"
+" Each keymap-sequence will be set up with a nnoremap
+" to invoke netrw#UserMaps(islocal).
+" Related functions:
+" netrw#Expose(varname) -- see s:varname variables
+" netrw#Modify(varname,newvalue) -- modify value of s:varname variable
+" netrw#Call(funcname,...) -- call internal netrw function with optional arguments
+fun! netrw#UserMaps(islocal)
+" call Dfunc("netrw#UserMaps(islocal=".a:islocal.")")
+" call Decho("g:Netrw_UserMaps ".(exists("g:Netrw_UserMaps")? "exists" : "does NOT exist"),'~'.expand("<slnum>"))
+
+ " set up usermaplist
+ if exists("g:Netrw_UserMaps") && type(g:Netrw_UserMaps) == 3
+" call Decho("g:Netrw_UserMaps has type 3<List>",'~'.expand("<slnum>"))
+ for umap in g:Netrw_UserMaps
+" call Decho("type(umap[0]<".string(umap[0]).">)=".type(umap[0])." (should be 1=string)",'~'.expand("<slnum>"))
+" call Decho("type(umap[1])=".type(umap[1])." (should be 1=string)",'~'.expand("<slnum>"))
+ " if umap[0] is a string and umap[1] is a string holding a function name
+ if type(umap[0]) == 1 && type(umap[1]) == 1
+" call Decho("nno <buffer> <silent> ".umap[0]." :call s:UserMaps(".a:islocal.",".string(umap[1]).")<cr>",'~'.expand("<slnum>"))
+ exe "nno <buffer> <silent> ".umap[0]." :call <SID>UserMaps(".a:islocal.",'".umap[1]."')<cr>"
+ else
+ call netrw#ErrorMsg(s:WARNING,"ignoring usermap <".string(umap[0])."> -- not a [string,funcref] entry",99)
+ endif
+ endfor
+ endif
+" call Dret("netrw#UserMaps")
+endfun
+
+" ---------------------------------------------------------------------
" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2
fun! netrw#WinPath(path)
" call Dfunc("netrw#WinPath(path<".a:path.">)")
@@ -10386,7 +10820,7 @@ fun! s:ComposePath(base,subdir)
" call Dfunc("s:ComposePath(base<".a:base."> subdir<".a:subdir.">)")
if has("amiga")
-" call Decho("amiga")
+" call Decho("amiga",'~'.expand("<slnum>"))
let ec = a:base[s:Strlen(a:base)-1]
if ec != '/' && ec != ':'
let ret = a:base . "/" . a:subdir
@@ -10395,19 +10829,19 @@ fun! s:ComposePath(base,subdir)
endif
elseif a:subdir =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16"))
-" call Decho("windows")
+" call Decho("windows",'~'.expand("<slnum>"))
let ret= a:subdir
elseif a:base =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16"))
-" call Decho("windows")
+" call Decho("windows",'~'.expand("<slnum>"))
if a:base =~ '[/\\]$'
let ret= a:base.a:subdir
else
- let ret= a:base."/".a:subdir
+ let ret= a:base.'/'.a:subdir
endif
- elseif a:base =~ '^\a\+://'
-" call Decho("remote linux/macos")
+ elseif a:base =~ '^\a\{3,}://'
+" call Decho("remote linux/macos",'~'.expand("<slnum>"))
let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','')
let curpath = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\2','')
if a:subdir == '../'
@@ -10420,12 +10854,12 @@ fun! s:ComposePath(base,subdir)
else
let ret= urlbase.curpath.a:subdir
endif
-" call Decho("urlbase<".urlbase.">")
-" call Decho("curpath<".curpath.">")
-" call Decho("ret<".ret.">")
+" call Decho("urlbase<".urlbase.">",'~'.expand("<slnum>"))
+" call Decho("curpath<".curpath.">",'~'.expand("<slnum>"))
+" call Decho("ret<".ret.">",'~'.expand("<slnum>"))
else
-" call Decho("local linux/macos")
+" call Decho("local linux/macos",'~'.expand("<slnum>"))
let ret = substitute(a:base."/".a:subdir,"//","/","g")
if a:base =~ '^//'
" keeping initial '//' for the benefit of network share listing support
@@ -10471,9 +10905,9 @@ fun! s:FileReadable(fname)
" call Dfunc("s:FileReadable(fname<".a:fname.">)")
if g:netrw_cygwin
- let ret= filereadable(substitute(a:fname,g:netrw_cygdrive.'/\(.\)','\1:/',''))
+ let ret= filereadable(s:NetrwFile(substitute(a:fname,g:netrw_cygdrive.'/\(.\)','\1:/','')))
else
- let ret= filereadable(a:fname)
+ let ret= filereadable(s:NetrwFile(a:fname))
endif
" call Dret("s:FileReadable ".ret)
@@ -10490,14 +10924,14 @@ fun! s:GetTempfile(fname)
if !exists("b:netrw_tmpfile")
" get a brand new temporary filename
let tmpfile= tempname()
-" call Decho("tmpfile<".tmpfile."> : from tempname()")
+" call Decho("tmpfile<".tmpfile."> : from tempname()",'~'.expand("<slnum>"))
let tmpfile= substitute(tmpfile,'\','/','ge')
-" call Decho("tmpfile<".tmpfile."> : chgd any \\ -> /")
+" call Decho("tmpfile<".tmpfile."> : chgd any \\ -> /",'~'.expand("<slnum>"))
" sanity check -- does the temporary file's directory exist?
- if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+ if !isdirectory(s:NetrwFile(substitute(tmpfile,'[^/]\+$','','e')))
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
" call Dret("s:GetTempfile getcwd<".getcwd().">")
return ""
@@ -10505,7 +10939,7 @@ fun! s:GetTempfile(fname)
" let netrw#NetSource() know about the tmpfile
let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#BrowseX()
-" call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">")
+" call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">",'~'.expand("<slnum>"))
" o/s dependencies
if g:netrw_cygwin != 0
@@ -10518,17 +10952,17 @@ fun! s:GetTempfile(fname)
let tmpfile = tmpfile
endif
let b:netrw_tmpfile= tmpfile
-" call Decho("o/s dependent fixed tempname<".tmpfile.">")
+" call Decho("o/s dependent fixed tempname<".tmpfile.">",'~'.expand("<slnum>"))
else
" re-use temporary filename
let tmpfile= b:netrw_tmpfile
-" call Decho("tmpfile<".tmpfile."> re-using")
+" call Decho("tmpfile<".tmpfile."> re-using",'~'.expand("<slnum>"))
endif
" use fname's suffix for the temporary file
if a:fname != ""
if a:fname =~ '\.[^./]\+$'
-" call Decho("using fname<".a:fname.">'s suffix")
+" call Decho("using fname<".a:fname.">'s suffix",'~'.expand("<slnum>"))
if a:fname =~ '\.tar\.gz$' || a:fname =~ '\.tar\.bz2$' || a:fname =~ '\.tar\.xz$'
let suffix = ".tar".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
elseif a:fname =~ '.txz$'
@@ -10536,16 +10970,16 @@ fun! s:GetTempfile(fname)
else
let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
endif
-" call Decho("suffix<".suffix.">")
+" call Decho("suffix<".suffix.">",'~'.expand("<slnum>"))
let tmpfile= substitute(tmpfile,'\.tmp$','','e')
-" call Decho("chgd tmpfile<".tmpfile."> (removed any .tmp suffix)")
+" call Decho("chgd tmpfile<".tmpfile."> (removed any .tmp suffix)",'~'.expand("<slnum>"))
let tmpfile .= suffix
-" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">")
+" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">",'~'.expand("<slnum>"))
let s:netrw_tmpfile= tmpfile " supports netrw#NetSource()
endif
endif
-" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:GetTempfile <".tmpfile.">")
return tmpfile
endfun
@@ -10582,7 +11016,7 @@ fun! s:MakeBookmark(fname)
if index(g:netrw_bookmarklist,a:fname) == -1
" curdir not currently in g:netrw_bookmarklist, so include it
- if isdirectory(a:fname) && a:fname !~ '/$'
+ if isdirectory(s:NetrwFile(a:fname)) && a:fname !~ '/$'
call add(g:netrw_bookmarklist,a:fname.'/')
elseif a:fname !~ '/'
call add(g:netrw_bookmarklist,getcwd()."/".a:fname)
@@ -10598,13 +11032,13 @@ endfun
" ---------------------------------------------------------------------
" s:MergeBookmarks: merge current bookmarks with saved bookmarks {{{2
fun! s:MergeBookmarks()
-" call Dfunc("s:MergeBookmarks()")
+" call Dfunc("s:MergeBookmarks() : merge current bookmarks into .netrwbook")
" get bookmarks from .netrwbook file
let savefile= s:NetrwHome()."/.netrwbook"
- if filereadable(savefile)
-" call Decho("merge bookmarks (active and file)")
+ if filereadable(s:NetrwFile(savefile))
+" call Decho("merge bookmarks (active and file)",'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwBookHistSave()
-" call Decho("bookmark delete savefile<".savefile.">")
+" call Decho("bookmark delete savefile<".savefile.">",'~'.expand("<slnum>"))
NetrwKeepj call delete(savefile)
endif
" call Dret("s:MergeBookmarks")
@@ -10641,13 +11075,13 @@ fun! s:NetrwCursor()
if &ft != "netrw"
" if the current window isn't a netrw directory listing window, then use user cursorline/column
" settings. Affects when netrw is used to read/write a file using scp/ftp/etc.
-" call Decho("case ft!=netrw: use user cul,cuc")
+" call Decho("case ft!=netrw: use user cul,cuc",'~'.expand("<slnum>"))
let &l:cursorline = s:netrw_usercul
let &l:cursorcolumn = s:netrw_usercuc
elseif g:netrw_cursor == 4
" all styles: cursorline, cursorcolumn
-" call Decho("case g:netrw_cursor==4: setl cul cuc")
+" call Decho("case g:netrw_cursor==4: setl cul cuc",'~'.expand("<slnum>"))
setl cursorline
setl cursorcolumn
@@ -10655,11 +11089,11 @@ fun! s:NetrwCursor()
" thin-long-tree: cursorline, user's cursorcolumn
" wide : cursorline, cursorcolumn
if w:netrw_liststyle == s:WIDELIST
-" call Decho("case g:netrw_cursor==3 and wide: setl cul cuc")
+" call Decho("case g:netrw_cursor==3 and wide: setl cul cuc",'~'.expand("<slnum>"))
setl cursorline
setl cursorcolumn
else
-" call Decho("case g:netrw_cursor==3 and not wide: setl cul (use user's cuc)")
+" call Decho("case g:netrw_cursor==3 and not wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
setl cursorline
let &l:cursorcolumn = s:netrw_usercuc
endif
@@ -10667,7 +11101,7 @@ fun! s:NetrwCursor()
elseif g:netrw_cursor == 2
" thin-long-tree: cursorline, user's cursorcolumn
" wide : cursorline, user's cursorcolumn
-" call Decho("case g:netrw_cursor==2: setl cuc (use user's cul)")
+" call Decho("case g:netrw_cursor==2: setl cuc (use user's cul)",'~'.expand("<slnum>"))
let &l:cursorcolumn = s:netrw_usercuc
setl cursorline
@@ -10676,16 +11110,16 @@ fun! s:NetrwCursor()
" wide : cursorline, user's cursorcolumn
let &l:cursorcolumn = s:netrw_usercuc
if w:netrw_liststyle == s:WIDELIST
-" call Decho("case g:netrw_cursor==2 and wide: setl cul (use user's cuc)")
+" call Decho("case g:netrw_cursor==2 and wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
setl cursorline
else
-" call Decho("case g:netrw_cursor==2 and not wide: (use user's cul,cuc)")
+" call Decho("case g:netrw_cursor==2 and not wide: (use user's cul,cuc)",'~'.expand("<slnum>"))
let &l:cursorline = s:netrw_usercul
endif
else
" all styles: user's cursorline, user's cursorcolumn
-" call Decho("default: (use user's cul,cuc)")
+" call Decho("default: (use user's cul,cuc)",'~'.expand("<slnum>"))
let &l:cursorline = s:netrw_usercul
let &l:cursorcolumn = s:netrw_usercuc
endif
@@ -10722,11 +11156,11 @@ fun! s:NetrwDelete(path)
let result = delete(path)
let &shellslash = sskeep
else
-" call Decho("exe let result= ".a:cmd."('".path."')")
+" call Decho("exe let result= ".a:cmd."('".path."')",'~'.expand("<slnum>"))
let result= delete(path)
endif
else
-" call Decho("let result= delete(".path.")")
+" call Decho("let result= delete(".path.")",'~'.expand("<slnum>"))
let result= delete(path)
endif
if result < 0
@@ -10741,10 +11175,10 @@ endfun
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
fun! s:NetrwEnew(...)
" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$"))
-" call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">")
+" call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
" grab a function-local-variable copy of buffer variables
-" call Decho("make function-local copy of netrw variables")
+" call Decho("make function-local copy of netrw variables",'~'.expand("<slnum>"))
if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif
if exists("b:netrw_browser_active") |let netrw_browser_active = b:netrw_browser_active |endif
if exists("b:netrw_cpf") |let netrw_cpf = b:netrw_cpf |endif
@@ -10763,15 +11197,15 @@ fun! s:NetrwEnew(...)
if exists("b:netrw_prvdir") |let netrw_prvdir = b:netrw_prvdir |endif
NetrwKeepj call s:NetrwOptionRestore("w:")
-" call Decho("generate a buffer with NetrwKeepj keepalt enew!")
+" call Decho("generate a buffer with NetrwKeepj keepalt enew!",'~'.expand("<slnum>"))
let netrw_keepdiff= &l:diff
noswapfile NetrwKeepj keepalt enew!
let &l:diff= netrw_keepdiff
-" call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$"))
+" call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$"),'~'.expand("<slnum>"))
NetrwKeepj call s:NetrwOptionSave("w:")
" copy function-local-variables to buffer variable equivalents
-" call Decho("copy function-local variables back to buffer netrw variables")
+" call Decho("copy function-local variables back to buffer netrw variables",'~'.expand("<slnum>"))
if exists("netrw_bannercnt") |let b:netrw_bannercnt = netrw_bannercnt |endif
if exists("netrw_browser_active") |let b:netrw_browser_active = netrw_browser_active |endif
if exists("netrw_cpf") |let b:netrw_cpf = netrw_cpf |endif
@@ -10841,7 +11275,7 @@ fun! s:NetrwInsureWinVars()
endwhile
exe "keepalt ".curwin."wincmd w"
if exists("winvars")
-" call Decho("copying w#".iwin." window variables to w#".curwin)
+" call Decho("copying w#".iwin." window variables to w#".curwin,'~'.expand("<slnum>"))
for k in keys(winvars)
let w:{k}= winvars[k]
endfor
@@ -10860,7 +11294,7 @@ fun! s:NetrwLcd(newdir)
catch /^Vim\%((\a\+)\)\=:E344/
" Vim's lcd fails with E344 when attempting to go above the 'root' of a Windows share.
" Therefore, detect if a Windows share is present, and if E344 occurs, just settle at
- " 'root' (ie. '\'). The share name may start with either backslashes ('\\Foo') or
+ " 'root' (ie. '\'). The share name may start with either backslashes ('\\Foo') or
" forward slashes ('//Foo'), depending on whether backslashes have been converted to
" forward slashes by earlier code; so check for both.
if (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
@@ -10875,9 +11309,9 @@ fun! s:NetrwLcd(newdir)
let a:newdir= w:netrw_prvdir
else
call s:NetrwOptionRestore("w:")
-" call Decho("setl noma nomod nowrap")
+" call Decho("setl noma nomod nowrap",'~'.expand("<slnum>"))
exe "setl ".g:netrw_bufsettings
-" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
+" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
let a:newdir= dirname
" call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">")
return
@@ -10939,12 +11373,12 @@ fun! s:RemotePathAnalysis(dirname)
let s:machine = substitute(s:machine,dirpat,'\2','')
endif
-" call Decho("set up s:method <".s:method .">")
-" call Decho("set up s:user <".s:user .">")
-" call Decho("set up s:machine<".s:machine.">")
-" call Decho("set up s:port <".s:port.">")
-" call Decho("set up s:path <".s:path .">")
-" call Decho("set up s:fname <".s:fname .">")
+" call Decho("set up s:method <".s:method .">",'~'.expand("<slnum>"))
+" call Decho("set up s:user <".s:user .">",'~'.expand("<slnum>"))
+" call Decho("set up s:machine<".s:machine.">",'~'.expand("<slnum>"))
+" call Decho("set up s:port <".s:port.">",'~'.expand("<slnum>"))
+" call Decho("set up s:path <".s:path .">",'~'.expand("<slnum>"))
+" call Decho("set up s:fname <".s:fname .">",'~'.expand("<slnum>"))
" call Dret("s:RemotePathAnalysis")
endfun
@@ -10954,7 +11388,7 @@ endfun
" Returns status
" Runs system() on
" [cd REMOTEDIRPATH;] a:cmd
-" Note that it doesn't do shellescape(a:cmd)!
+" Note that it doesn't do s:ShellEscape(a:cmd)!
fun! s:RemoteSystem(cmd)
" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)")
if !executable(g:netrw_ssh_cmd)
@@ -10965,12 +11399,12 @@ fun! s:RemoteSystem(cmd)
let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME")
let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
if remotedir != ""
- let cmd= cmd.' cd '.shellescape(remotedir).";"
+ let cmd= cmd.' cd '.s:ShellEscape(remotedir).";"
else
let cmd= cmd.' '
endif
let cmd= cmd.a:cmd
-" call Decho("call system(".cmd.")")
+" call Decho("call system(".cmd.")",'~'.expand("<slnum>"))
let ret= system(cmd)
endif
" call Dret("s:RemoteSystem ".ret)
@@ -11009,23 +11443,26 @@ endfun
" is true) and a command, :Rexplore, which call this function.
"
" s:nbcd_curpos_{bufnr('%')} is set up by s:NetrwBrowseChgDir()
+"
+" s:rexposn_BUFNR used to save/restore cursor position
fun! s:NetrwRexplore(islocal,dirname)
if exists("s:netrwdrag")
return
endif
" call Dfunc("s:NetrwRexplore() w:netrw_rexlocal=".w:netrw_rexlocal." w:netrw_rexdir<".w:netrw_rexdir.">")
-" call Decho("ft=".&ft." win#".winnr()." w:netrw_rexfile<".(exists("w:netrw_rexfile")? w:netrw_rexfile : 'n/a').">")
+" call Decho("currently in bufname<".bufname("%").">",'~'.expand("<slnum>"))
+" call Decho("ft=".&ft." win#".winnr()." w:netrw_rexfile<".(exists("w:netrw_rexfile")? w:netrw_rexfile : 'n/a').">",'~'.expand("<slnum>"))
if &ft == "netrw" && exists("w:netrw_rexfile") && w:netrw_rexfile != ""
" a :Rex while in a netrw buffer means: edit the file in w:netrw_rexfile
-" call Decho("in netrw buffer, will edit file<".w:netrw_rexfile.">")
+" call Decho("in netrw buffer, will edit file<".w:netrw_rexfile.">",'~'.expand("<slnum>"))
exe "NetrwKeepj e ".w:netrw_rexfile
unlet w:netrw_rexfile
" call Dret("s:NetrwRexplore returning from netrw to buf#".bufnr("%")."<".bufname("%")."> (ft=".&ft.")")
return
" else " Decho
-" call Decho("treating as not-netrw-buffer: ft=".&ft.((&ft == "netrw")? " == netrw" : "!= netrw"))
-" call Decho("treating as not-netrw-buffer: w:netrw_rexfile<".((exists("w:netrw_rexfile"))? w:netrw_rexfile : 'n/a').">")
+" call Decho("treating as not-netrw-buffer: ft=".&ft.((&ft == "netrw")? " == netrw" : "!= netrw"),'~'.expand("<slnum>"))
+" call Decho("treating as not-netrw-buffer: w:netrw_rexfile<".((exists("w:netrw_rexfile"))? w:netrw_rexfile : 'n/a').">",'~'.expand("<slnum>"))
endif
" ---------------------------
@@ -11034,43 +11471,37 @@ fun! s:NetrwRexplore(islocal,dirname)
" record current file so :Rex can return to it from netrw
let w:netrw_rexfile= expand("%")
+" call Decho("set w:netrw_rexfile<".w:netrw_rexfile."> (win#".winnr().")",'~'.expand("<slnum>"))
if !exists("w:netrw_rexlocal")
" call Dret("s:NetrwRexplore w:netrw_rexlocal doesn't exist (".&ft.")")
return
endif
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
if w:netrw_rexlocal
- if g:netrw_keepj =~ "keepj"
- keepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
- else
- call netrw#LocalBrowseCheck(w:netrw_rexdir)
- endif
- elseif g:netrw_keepj =~ "keepj"
- keepj call s:NetrwBrowse(0,w:netrw_rexdir)
+ NetrwKeepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
else
- call s:NetrwBrowse(0,w:netrw_rexdir)
+ NetrwKeepj call s:NetrwBrowse(0,w:netrw_rexdir)
endif
if exists("s:initbeval")
setl beval
endif
if exists("s:rexposn_".bufnr("%"))
-" call Decho("restore posn, then unlet s:rexposn_".bufnr('%'))
- if g:netrw_keepj =~ "keepj"
- keepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
- else
- call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+" call Decho("restore posn, then unlet s:rexposn_".bufnr('%')."<".bufname("%").">",'~'.expand("<slnum>"))
+ " restore position in directory listing
+ NetrwKeepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+ if exists("s:rexposn_".bufnr('%'))
+ unlet s:rexposn_{bufnr('%')}
endif
- unlet s:rexposn_{bufnr('%')}
else
-" call Decho("s:rexposn_".bufnr('%')." doesn't exist")
+" call Decho("s:rexposn_".bufnr('%')."<".bufname("%")."> doesn't exist",'~'.expand("<slnum>"))
endif
if exists("s:explore_match")
exe "2match netrwMarkFile /".s:explore_match."/"
endif
-" call Decho("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 Decho("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,'~'.expand("<slnum>"))
" call Dret("s:NetrwRexplore : ft=".&ft)
endfun
@@ -11141,8 +11572,10 @@ endfun
" s:SetRexDir: set directory for :Rexplore {{{2
fun! s:SetRexDir(islocal,dirname)
" call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">)")
- let w:netrw_rexdir = a:dirname
- let w:netrw_rexlocal = a:islocal
+ let w:netrw_rexdir = a:dirname
+ let w:netrw_rexlocal = a:islocal
+ let s:rexposn_{bufnr("%")} = netrw#SavePosn()
+" call Decho("setting s:rexposn_".bufnr("%")."<".bufname("%")."> to SavePosn",'~'.expand("<slnum>"))
" call Dret("s:SetRexDir : win#".winnr()." ".(a:islocal? "local" : "remote")." dir: ".a:dirname)
endfun
@@ -11150,22 +11583,23 @@ endfun
" s:ShowLink: used to modify thin and tree listings to show links {{{2
fun! s:ShowLink()
" " call Dfunc("s:ShowLink()")
-" " call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
-" " call Decho(printf("line#%4d: %s",line("."),getline(".")))
+" " call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">",'~'.expand("<slnum>"))
+" " call Decho(printf("line#%4d: %s",line("."),getline(".")),'~'.expand("<slnum>"))
if exists("b:netrw_curdir")
norm! $?\a
let fname = b:netrw_curdir.'/'.s:NetrwGetWord()
let resname = resolve(fname)
- if resname =~ '^\M'.b:netrw_curdir
+" " call Decho("fname <".fname.">",'~'.expand("<slnum>"))
+" " call Decho("resname <".resname.">",'~'.expand("<slnum>"))
+" " call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("<slnum>"))
+ if resname =~ '^\M'.b:netrw_curdir.'/'
let dirlen = strlen(b:netrw_curdir)
let resname = strpart(resname,dirlen+1)
-" " call Decho("resname<".resname."> (b:netrw_curdir elided)")
-" " else " Decho
-" " call Decho("resname<".fname.">")
+" " call Decho("resname<".resname."> (b:netrw_curdir elided)",'~'.expand("<slnum>"))
endif
let modline = getline(".")."\t --> ".resname
-" " call Decho("fname <".fname.">")
-" " call Decho("modline<".modline.">")
+" " call Decho("fname <".fname.">",'~'.expand("<slnum>"))
+" " call Decho("modline<".modline.">",'~'.expand("<slnum>"))
setl noro ma
call setline(".",modline)
setl ro noma nomod
@@ -11203,22 +11637,22 @@ fun! s:Strlen(x)
if v:version >= 703 && exists("*strdisplaywidth")
let ret= strdisplaywidth(a:x)
-
+
elseif type(g:Align_xstrlen) == 1
" allow user to specify a function to compute the string length (ie. let g:Align_xstrlen="mystrlenfunc")
exe "let ret= ".g:Align_xstrlen."('".substitute(a:x,"'","''","g")."')"
-
+
elseif g:Align_xstrlen == 1
" number of codepoints (Latin a + combining circumflex is two codepoints)
" (comment from TM, solution from NW)
let ret= strlen(substitute(a:x,'.','c','g'))
-
+
elseif g:Align_xstrlen == 2
" number of spacing codepoints (Latin a + combining circumflex is one spacing
" codepoint; a hard tab is one; wide and narrow CJK are one each; etc.)
" (comment from TM, solution from TM)
let ret=strlen(substitute(a:x, '.\Z', 'x', 'g'))
-
+
elseif g:Align_xstrlen == 3
" virtual length (counting, for instance, tabs as anything between 1 and
" 'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately
@@ -11231,7 +11665,7 @@ fun! s:Strlen(x)
d
NetrwKeepj norm! k
let &l:mod= modkeep
-
+
else
" at least give a decent default
let ret= strlen(a:x)
@@ -11241,6 +11675,16 @@ fun! s:Strlen(x)
endfun
" ---------------------------------------------------------------------
+" s:ShellEscape: shellescape(), or special windows handling {{{2
+fun! s:ShellEscape(s, ...)
+ if (has('win32') || has('win64')) && $SHELL == '' && &shellslash
+ return printf('"%s"', substitute(a:s, '"', '""', 'g'))
+ endif
+ let f = a:0 > 0 ? a:1 : 0
+ return shellescape(a:s, f)
+endfun
+
+" ---------------------------------------------------------------------
" s:TreeListMove: {{{2
fun! s:TreeListMove(dir)
" call Dfunc("s:TreeListMove(dir<".a:dir.">)")
@@ -11249,33 +11693,33 @@ fun! s:TreeListMove(dir)
let nxtline = (line(".") < line("$"))? getline(line(".")+1) : ''
let curindent= substitute(curline,'^\([| ]*\).\{-}$','\1','')
let indentm1 = substitute(curindent,'^'.s:treedepthstring.' ','','')
-" call Decho("prvline <".prvline."> #".line(".")-1)
-" call Decho("curline <".curline."> #".line("."))
-" call Decho("nxtline <".nxtline."> #".line(".")+1)
-" call Decho("curindent<".curindent.">")
-" call Decho("indentm1 <".indentm1.">")
+" call Decho("prvline <".prvline."> #".line(".")-1,'~'.expand("<slnum>"))
+" call Decho("curline <".curline."> #".line("."),'~'.expand("<slnum>"))
+" call Decho("nxtline <".nxtline."> #".line(".")+1,'~'.expand("<slnum>"))
+" call Decho("curindent<".curindent.">",'~'.expand("<slnum>"))
+" call Decho("indentm1 <".indentm1.">",'~'.expand("<slnum>"))
if curline !~ '/$'
-" call Decho('regfile')
+" call Decho('regfile','~'.expand("<slnum>"))
if a:dir == '[' && prvline != ''
NetrwKeepj norm! 0
let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','bWe') " search backwards from regular file
-" call Decho("regfile srch back: ".nl)
+" call Decho("regfile srch back: ".nl,'~'.expand("<slnum>"))
elseif a:dir == ']' && nxtline != ''
NetrwKeepj norm! $
let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','We') " search forwards from regular file
-" call Decho("regfile srch fwd: ".nl)
+" call Decho("regfile srch fwd: ".nl,'~'.expand("<slnum>"))
endif
elseif a:dir == '[' && prvline != ''
NetrwKeepj norm! 0
let curline= line(".")
let nl = search('^'.curindent.'[^'.s:treedepthstring.']','bWe') " search backwards From directory, same indentation
-" call Decho("dir srch back ind: ".nl)
+" call Decho("dir srch back ind: ".nl,'~'.expand("<slnum>"))
if nl != 0
if line(".") == curline-1
let nl= search('^'.indentm1.'[^'.s:treedepthstring.']','bWe') " search backwards from directory, indentation - 1
-" call Decho("dir srch back ind-1: ".nl)
+" call Decho("dir srch back ind-1: ".nl,'~'.expand("<slnum>"))
endif
endif
@@ -11283,11 +11727,11 @@ fun! s:TreeListMove(dir)
NetrwKeepj norm! $
let curline = line(".")
let nl = search('^'.curindent.'[^'.s:treedepthstring.']','We') " search forwards from directory, same indentation
-" call Decho("dir srch fwd ind: ".nl)
+" call Decho("dir srch fwd ind: ".nl,'~'.expand("<slnum>"))
if nl != 0
if line(".") == curline+1
let nl= search('^'.indentm1.'[^'.s:treedepthstring.']','We') " search forwards from directory, indentation - 1
-" call Decho("dir srch fwd ind-1: ".nl)
+" call Decho("dir srch fwd ind-1: ".nl,'~'.expand("<slnum>"))
endif
endif
@@ -11333,6 +11777,48 @@ fun! s:UseBufWinVars()
endfun
" ---------------------------------------------------------------------
+" s:UserMaps: supports user-defined UserMaps {{{2
+" * calls a user-supplied funcref(islocal,curdir)
+" * interprets result
+" See netrw#UserMaps()
+fun! s:UserMaps(islocal,funcname)
+" call Dfunc("s:UserMaps(islocal=".a:islocal.",funcname<".a:funcname.">)")
+
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+ endif
+ let Funcref = function(a:funcname)
+ let result = Funcref(a:islocal)
+
+ if type(result) == 1
+ " if result from user's funcref is a string...
+" call Decho("result string from user funcref<".result.">",'~'.expand("<slnum>"))
+ if result == "refresh"
+" call Decho("refreshing display",'~'.expand("<slnum>"))
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ elseif result != ""
+" call Decho("executing result<".result.">",'~'.expand("<slnum>"))
+ exe result
+ endif
+
+ elseif type(result) == 3
+ " if result from user's funcref is a List...
+" call Decho("result List from user funcref<".string(result).">",'~'.expand("<slnum>"))
+ for action in result
+ if action == "refresh"
+" call Decho("refreshing display",'~'.expand("<slnum>"))
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ elseif action != ""
+" call Decho("executing action<".action.">",'~'.expand("<slnum>"))
+ exe action
+ endif
+ endfor
+ endif
+
+" call Dret("s:UserMaps")
+endfun
+
+" ---------------------------------------------------------------------
" Settings Restoration: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
diff --git a/runtime/autoload/pythoncomplete.vim b/runtime/autoload/pythoncomplete.vim
index 57add71cb..ecc36646d 100644
--- a/runtime/autoload/pythoncomplete.vim
+++ b/runtime/autoload/pythoncomplete.vim
@@ -377,6 +377,7 @@ class PyParser:
def __init__(self):
self.top = Scope('global',0)
self.scope = self.top
+ self.parserline = 0
def _parsedotname(self,pre=None):
#returns (dottedname, nexttoken)
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 3a8107ecd..d1fcb5d53 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.4. Last change: 2015 Sep 06
+*change.txt* For Vim version 7.4. Last change: 2015 Oct 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -863,6 +863,36 @@ either the first or second pattern in parentheses did not match, so either
:s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x"
<
+ *:sc* *:sce* *:scg* *:sci* *:scI* *:scl* *:scp* *:sg* *:sgc*
+ *:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
+ *:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
+ *:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
+ *:srn* *:srp*
+2-letter and 3-letter :substitute commands ~
+
+ List of :substitute commands
+ | c e g i I n p l r
+ | c :sc :sce :scg :sci :scI :scn :scp :scl ---
+ | e
+ | g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
+ | i :sic :sie --- :si :siI :sin :sip --- :sir
+ | I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
+ | n
+ | p
+ | l
+ | r :src --- :srg :sri :srI :srn :srp :srl :sr
+
+Exceptions:
+ :scr is `:scriptnames`
+ :se is `:set`
+ :sig is `:sign`
+ :sil is `:silent`
+ :sn is `:snext`
+ :sp is `:split`
+ :sl is `:sleep`
+ :sre is `:srewind`
+
+
Substitute with an expression *sub-replace-expression*
*sub-replace-\=* *s/\=*
When the substitute string starts with "\=" the remainder is interpreted as an
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 5e629aaf4..8d867837f 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Jan 05
+*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Oct 30
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -367,7 +367,12 @@ settings are described below, in |netrw-browser-options|, and in
fun! MyFuncRef()
endfun
let g:Netrw_funcref= function("MyFuncRef")
+
<
+ *g:Netrw_UserMaps* specifies a function or |List| of functions which can
+ be used to set up user-specified maps and functionality.
+ See |netrw-usermaps|
+
*g:netrw_ftp* if it doesn't exist, use default ftp
=0 use default ftp (uid password)
=1 use alternate ftp method (user uid password)
@@ -1064,9 +1069,10 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
- <c-h> Edit file hiding list |netrw-ctrl-h|
- <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
- <c-r> Browse using a gvim server |netrw-ctrl-r|
+ <c-h> Edit file hiding list |netrw-ctrl-h|
+ <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
+ <c-r> Browse using a gvim server |netrw-ctrl-r|
+ <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
- Makes Netrw go up one directory |netrw--|
a Toggles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide)
@@ -1079,6 +1085,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
gd Force treatment as directory |netrw-gd|
gf Force treatment as file |netrw-gf|
gh Quick hide/unhide of dot-files |netrw-gh|
+ gn Make top of tree the directory below the cursor |netrw-gn|
i Cycle between thin, long, wide, and tree listings |netrw-i|
mb Bookmark current directory |netrw-mb|
mc Copy marked files to marked-file target directory |netrw-mc|
@@ -1107,7 +1114,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
qf Display information on file |netrw-qf|
qF Mark files using a quickfix list |netrw-qF|
r Reverse sorting order |netrw-r|
- R Rename the designed file(s)/directory(ies) |netrw-R|
+ R Rename the designated file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
S Specify suffix priority for name-sorting |netrw-S|
t Enter the file/directory under the cursor in a new tab|netrw-t|
@@ -1176,10 +1183,10 @@ Addtionally, one may use :NetrwMB to bookmark files or directories. >
< No bang: enters files/directories into Netrw's bookmark system
No argument and in netrw buffer:
- if there are marked files: bookmark marked files
- otherwise : bookmark file/directory under cursor
+ if there are marked files : bookmark marked files
+ otherwise : bookmark file/directory under cursor
No argument and not in netrw buffer: bookmarks current open file
- Has arguments: globs them individually and bookmarks them
+ Has arguments : |glob()|s each arg and bookmarks them
With bang: deletes files/directories from Netrw's bookmark system
@@ -1396,8 +1403,8 @@ list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the
the opposite, see |netrw-U|.
The "u" map also accepts counts to go back in the history several slots.
-For your convenience, |netrw-qb| lists the history number which can be
-re-used in that count.
+For your convenience, qb (see |netrw-qb|) lists the history number which may
+be used in that count.
*.netrwhist*
See |g:netrw_dirhistmax| for how to control the quantity of history stack
@@ -1414,7 +1421,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
With the "U" map, one can change to a later directory (successor).
This map is the opposite of the "u" map. (see |netrw-u|) Use the
-q map to list both the bookmarks and history. (see |netrw-qb|)
+qb map to list both the bookmarks and history. (see |netrw-qb|)
The "U" map also accepts counts to go forward in the history several slots.
@@ -1422,7 +1429,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack
slots.
-CHANGING TREE TOP *netrw-ntree* *:Ntree* {{{2
+CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2
One may specify a new tree top for tree listings using >
@@ -1432,14 +1439,18 @@ Without a "dirname", the current line is used (and any leading depth
information is elided).
With a "dirname", the specified directory name is used.
+The "gn" map will take the word below the cursor and use that for
+changing the top of the tree listing.
+
NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
-With :NetrwClean one may easily remove netrw from one's home directory;
+With NetrwClean one may easily remove netrw from one's home directory;
more precisely, from the first directory on your |'runtimepath'|.
-With :NetrwClean!, netrw will remove netrw from all directories on your
-|'runtimepath'|.
+With NetrwClean!, netrw will attempt to remove netrw from all directories on
+your |'runtimepath'|. Of course, you have to have write/delete permissions
+correct to do this.
With either form of the command, netrw will first ask for confirmation
that the removal is in fact what you want to do. If netrw doesn't have
@@ -1456,6 +1467,7 @@ operating system). Netrw allows one to invoke such special handlers by: >
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
< (latter not available if the |g:netrw_nogx| variable exists)
+
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
@@ -1631,19 +1643,23 @@ DIRECTORY EXPLORATION COMMANDS {{{2
of the current tab. It will open a netrw window on the current
directory if [dir] is omitted; a :Lexplore [dir] will show the
specified directory in the left-hand side browser display no matter
- from which window the command is issued. By default, :Lexplore will
- change an uninitialized |g:netrw_chgwin| to 2; edits will thus
- preferentially be made in window#2.
- The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
+ from which window the command is issued.
+
+ By default, :Lexplore will change an uninitialized |g:netrw_chgwin|
+ to 2; edits will thus preferentially be made in window#2.
+
+ The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
window.
- Those who like this method often also like tree style displays;
+
+ Those who like this method often also often like tree style displays;
see |g:netrw_liststyle|.
- Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize|
- |netrw-p| |netrw-P| |g:netrw_browse_split|
+ Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw|
+ |netrw-p| |netrw-P| |g:netrw_chgwin|
+ |netrw-c-tab| |g:netrw_winsize|
:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
- will open on the right hand side, and an uninitialized |g:netrw_chgwin|
+ will open on the right hand side and an uninitialized |g:netrw_chgwin|
will be set to 1.
*netrw-:Sexplore*
@@ -2127,19 +2143,18 @@ is unlikely to be fixed.
UNMARKING FILES *netrw-mF* {{{2
- (also see |netrw-mf|)
+ (also see |netrw-mf|, |netrw-mu|)
-This command will unmark all files in the current buffer. One may also use
-mf (|netrw-mf|) on a specific file to unmark just that file.
+The "mF" command will unmark all files in the current buffer. One may also use
+mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
(also see |netrw-mf|)
-One may convert the |quickfix-error-lists| into a marked file list using
-"qF". You may then proceed with commands such as me (|netrw-me|) to
-edit them. Quickfix error lists are generated, for example, by calls
-to |:vimgrep|.
+One may convert |quickfix-error-lists| into a marked file list using "qF".
+You may then proceed with commands such as me (|netrw-me|) to edit them.
+Quickfix error lists are generated, for example, by calls to |:vimgrep|.
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
@@ -2157,14 +2172,17 @@ MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked-file list)
-The "mv" map causes netrw execute an arbitrary vim command on each file
-on the local marked file list, individually:
+The "mv" map causes netrw to execute an arbitrary vim command on each file on
+the local marked file list, individually:
* 1split
* sil! keepalt e file
* run vim command
* sil! keepalt wq!
+A prompt, "Enter vim command: ", will be issued to elicit the vim command
+you wish used.
+
MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2196,13 +2214,13 @@ command to be applied to all marked files on the global marked file list. The
command files
-It is useful, for example, to select files and make a tarball:
+This approach is useful, for example, to select files and make a tarball: >
(mark files)
mX
Enter command: tar cf mynewtarball.tar
-
-The command that will be run in this example:
+<
+The command that will be run with this example:
tar cf mynewtarball.tar 'file1' 'file2' ...
@@ -2255,7 +2273,7 @@ MARKED FILES: EDITING *netrw-me* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
-This command will place the marked files on the |arglist| and commence
+The "me" command will place the marked files on the |arglist| and commence
editing them. One may return the to explorer window with |:Rexplore|.
(use |:n| and |:p| to edit next and previous files in the arglist)
@@ -2263,26 +2281,33 @@ MARKED FILES: GREP *netrw-mg* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked file list)
-This command will apply |:vimgrep| to the marked files.
+The "mg" command will apply |:vimgrep| to the marked files.
The command will ask for the requested pattern; one may then enter: >
/pattern/[g][j]
! /pattern/[g][j]
pattern
<
-In the cases of "j" option usage as shown above, "mg" will winnow the current
-marked file list to just those possessing the specified pattern.
-Thus, one may use >
- mr ...file-pattern
- mg ..contents-pattern
-to have a marked file list satisfying the file-pattern but containing the
-desired contents-pattern.
+With /pattern/, editing will start with the first item on the |quickfix| list
+that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|). The |:vimgrep|
+command is in use, so without 'g' each line is added to quickfix list only
+once; with 'g' every match is included.
+
+With /pattern/j, "mg" will winnow the current marked file list to just those
+marked files also possessing the specified pattern. Thus, one may use >
+
+ mr ...file-pattern...
+ mg /pattern/j
+<
+to have a marked file list satisfying the file-pattern but also restricted to
+files containing some desired pattern.
+
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
-This command extracts the suffices of the marked files and toggles their
+The "mh" command extracts the suffices of the marked files and toggles their
presence on the hiding list. Please note that marking the same suffix
this way multiple times will result in the suffix's presence being toggled
for each file (so an even quantity of marked files having the same suffix
@@ -2311,16 +2336,16 @@ MARKED FILES: PRINTING *netrw-mp* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
-Netrw will apply the |:hardcopy| command to marked files. What it does
-is open each file in a one-line window, execute hardcopy, then close the
-one-line window.
+When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
+What netrw does is open each file in a one-line window, execute hardcopy, then
+close the one-line window.
MARKED FILES: SOURCING *netrw-ms* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
-Netrw will source the marked files (using vim's |:source| command)
+With "ms", netrw will source the marked files (using vim's |:source| command)
MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
@@ -2343,6 +2368,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
This command uses |<q-args>|, so spaces in the directory name are
permitted without escaping.
+ * With mouse-enabled vim or with gvim, one may select a target by using
+ <c-leftmouse>
+
There is only one copy/move-to target at a time in a vim session; ie. the
target is a script variable (see |s:var|) and is shared between all netrw
windows (in an instance of vim).
@@ -2419,9 +2447,13 @@ Related topics:
MARKED FILES: UNMARKING *netrw-mu* {{{2
- (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (See |netrw-mf|, |netrw-mF|)
+
+The "mu" mapping will unmark all currently marked files. This command differs
+from "mF" as the latter only unmarks files in the current directory whereas
+"mu" will unmark global and all buffer-local marked files.
+(see |netrw-mF|)
-The "mu" mapping will unmark all currently marked files.
*netrw-browser-settings*
NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
@@ -2726,6 +2758,11 @@ your browsing preferences. (see also: |netrw-settings|)
evaluation will be suppressed
(see |'ballooneval'|)
+ *g:netrw_usetab* if this variable exists and is non-zero, then
+ the <tab> map supporting shrinking/expanding a
+ Lexplore or netrw window will be enabled.
+ (see |netrw-c-tab|)
+
*g:netrw_remote_mkdir* command for making a remote directory
via ftp (also see |g:netrw_mkdir_cmd|)
default: "mkdir"
@@ -2762,7 +2799,8 @@ your browsing preferences. (see also: |netrw-settings|)
|netrw-ctrl-r| to use for its server.
default: "NETRWSERVER"
- *g:netrw_sort_by* sort by "name", "time", or "size"
+ *g:netrw_sort_by* sort by "name", "time", "size", or
+ "exten".
default: "name"
*g:netrw_sort_direction* sorting direction: "normal" or "reverse"
@@ -2874,6 +2912,10 @@ your browsing preferences. (see also: |netrw-settings|)
take effect, for example).
default: 50 (for 50%)
+ *g:netrw_wiw* =1 specifies the minimum window width to use
+ when shrinking a netrw/Lexplore window
+ (see |netrw-c-tab|).
+
*g:netrw_xstrlen* Controls how netrw computes string lengths,
including multi-byte characters' string
length. (thanks to N Weibull, T Mechelynck)
@@ -2919,7 +2961,7 @@ help on what each of the variables do.
==============================================================================
-OBTAINING A FILE *netrw-O* {{{2
+OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2
If there are no marked files:
@@ -2949,7 +2991,7 @@ Related topics:
* To automatically make the currently browsed directory the current
directory, see |g:netrw_keepdir|.
- *netrw-createfile*
+ *netrw-newfile* *netrw-createfile*
OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
To open a new file in netrw's current directory, press "%". This map
@@ -2981,10 +3023,13 @@ These will:
will use only 30% of the columns available; the rest of the window
is used for the preview window.
-Also see: |g:netrw_chgwin| |netrw-P|
+ Related: if you like this idea, you may also find :Lexplore
+ (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
+Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'|
-PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
+
+PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
To edit a file or directory in the previously used (last accessed) window (see
:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
@@ -3006,7 +3051,7 @@ Associated setting variables:
Also see: |g:netrw_chgwin| |netrw-p|
-REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
+REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2
To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
hit the <cr> when atop the ./ directory entry in the listing. One may also
@@ -3026,11 +3071,12 @@ RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
If there are no marked files: (see |netrw-mf|)
- Renaming/moving files and directories involves moving the cursor to the
+ Renaming files and directories involves moving the cursor to the
file/directory to be moved (renamed) and pressing "R". You will then be
- queried for where you want the file/directory to be moved. You may select
+ queried for what you want the file/directory to be renamed to You may select
a range of lines with the "V" command (visual selection), and then
- pressing "R".
+ press "R"; you will be queried for each file as to what you want it
+ renamed to.
If there are marked files: (see |netrw-mf|)
@@ -3048,6 +3094,14 @@ If there are marked files: (see |netrw-mf|)
This example will mark all *.c files and then rename them to *.cpp
files.
+ The ctrl-X character has special meaning for renaming files: >
+
+ <c-x> : a single ctrl-x tells netrw to ignore the portion of the response
+ lying between the last '/' and the ctrl-x.
+
+ <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
+ portion of the string preceding the double ctrl-x's.
+<
WARNING:~
Note that moving files is a dangerous operation; copies are safer. That's
@@ -3055,13 +3109,13 @@ If there are marked files: (see |netrw-mf|)
the copy fails and the delete does not, you may lose the file.
Use at your own risk.
-The g:netrw_rename_cmd variable is used to implement renaming. By default its
-value is:
+The g:netrw_rename_cmd variable is used to implement remote renaming. By
+default its value is:
ssh HOSTNAME mv
One may rename a block of files and directories by selecting them with
-the V (|linewise-visual|).
+V (|linewise-visual|) when using thin style
SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
@@ -3074,18 +3128,19 @@ Related topics: |netrw-r| |netrw-S|
Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
-SETTING EDITING WINDOW *netrw-C* *netrw-:NetrwC* {{{2
+SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2
One may select a netrw window for editing with the "C" mapping, using the
-:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window
+:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window
number. Subsequent selection of a file to edit (|netrw-cr|) will use that
window.
- * C by itself, will select the current window for editing via
- |netrw-cr|
+ * C : by itself, will select the current window holding a netrw buffer
+ for editing via |netrw-cr|. The C mapping is only available while in
+ netrw buffers.
- * [count]C the count will be used as the window number to be used
- for editing via |netrw-cr|.
+ * [count]C : the count will be used as the window number to be used
+ for subsequent editing via |netrw-cr|.
* :NetrwC will set |g:netrw_chgwin| to the current window
@@ -3094,12 +3149,91 @@ window.
Using >
let g:netrw_chgwin= -1
-will restore the default editing behavior (ie. use the current window).
+will restore the default editing behavior
+(ie. editing will use the current window).
Related topics: |netrw-cr| |g:netrw_browse_split|
Associated setting variables: |g:netrw_chgwin|
+SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2
+
+The <c-tab> key will toggle a netrw or |:Lexplore| window's width,
+but only if |g:netrw_usetab| exists and is non-zero (and, of course,
+only if your terminal supports differentiating <c-tab> from a plain
+<tab>).
+
+ * If the current window is a netrw window, toggle its width
+ (between |g:netrw_wiw| and its original width)
+
+ * Else if there is a |:Lexplore| window in the current tab, toggle
+ its width
+
+ * Else bring up a |:Lexplore| window
+
+If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping
+for <c-tab>, then the <tab> will not be mapped. One may map something other
+than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) >
+
+ nmap <unique> (whatever) <Plug>NetrwShrink
+<
+Related topics: |:Lexplore|
+Associated setting variable: |g:netrw_usetab|
+
+
+USER SPECIFIED MAPS *netrw-usermaps* {{{1
+
+One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|,
+to hold a |List| of lists of keymap strings and function names: >
+
+ [["keymap-sequence","ExampleUserMapFunc"],...]
+<
+When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps|
+exists, then the internal function netrw#UserMaps(islocal) is called.
+This function goes through all the entries in the |g:Netrw_UserMaps| list:
+
+ * sets up maps: >
+ nno <buffer> <silent> KEYMAP-SEQUENCE
+ :call s:UserMaps(islocal,"ExampleUserMapFunc")
+< * refreshes if result from that function call is the string
+ "refresh"
+ * if the result string is not "", then that string will be
+ executed (:exe result)
+ * if the result is a List, then the above two actions on results
+ will be taken for every string in the result List
+
+The user function is passed one argument; it resembles >
+
+ fun! ExampleUserMapFunc(islocal)
+<
+where a:islocal is 1 if its a local-directory system call or 0 when
+remote-directory system call.
+
+Use netrw#Expose("varname") to access netrw-internal (script-local)
+ variables.
+Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
+Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
+ specified arguments.
+
+Example: Get a copy of netrw's marked file list: >
+
+ let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
+<
+Example: Modify the value of netrw's marked file list: >
+
+ call netrw#Modify("netrwmarkfilelist",[])
+<
+Example: Clear netrw's marked file list via a mapping on gu >
+ " ExampleUserMap: {{{2
+ fun! ExampleUserMap(islocal)
+ call netrw#Modify("netrwmarkfilelist",[])
+ call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
+ let retval= ["refresh"]
+ return retval
+ endfun
+ let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
+<
+
10. Problems and Fixes *netrw-problems* {{{1
(This section is likely to grow as I get feedback)
@@ -3274,6 +3408,7 @@ Associated setting variables: |g:netrw_chgwin|
The first one (|g:netrw_ssh_cmd|) is the most important; most
of the others will use the string in g:netrw_ssh_cmd by
default.
+
*netrw-p9* *netrw-ml_get*
P9. I'm browsing, changing directory, and bang! ml_get errors
appear and I have to kill vim. Any way around this?
@@ -3300,6 +3435,14 @@ Associated setting variables: |g:netrw_chgwin|
P11. I want to have two windows; a thin one on the left and my editing
window on the right. How may I accomplish this?
+ You probably want netrw running as in a side window. If so, you
+ will likely find that ":[N]Lexplore" does what you want. The
+ optional "[N]" allows you to select the quantity of columns you
+ wish the Lexplorer window to start with (see |g:netrw_winsize|
+ for how this parameter works).
+
+ Previous solution:
+
* Put the following line in your <.vimrc>:
let g:netrw_altv = 1
* Edit the current directory: :e .
@@ -3313,6 +3456,7 @@ Associated setting variables: |g:netrw_chgwin|
<leftmouse> in the browser window and then press the
<middlemouse> to select the file.
+
*netrw-p12*
P12. My directory isn't sorting correctly, or unwanted letters are
appearing in the listed filenames, or things aren't lining
@@ -3390,7 +3534,7 @@ Associated setting variables: |g:netrw_chgwin|
to open a swap file.
(romainl) It looks like you are starting Vim from a protected
- directory. Start if from your $HOME or another writable
+ directory. Start netrw from your $HOME or other writable
directory.
*netrw-p17*
@@ -3414,6 +3558,58 @@ Associated setting variables: |g:netrw_chgwin|
"Using Vim to Remotely Edit A File on ServerB Only
Accessible From ServerA"
+ *netrw-P19*
+ P19. How do I get numbering on in directory listings?
+ With |g:netrw_bufsettings|, you can control netrw's buffer
+ settings; try putting >
+ let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
+< in your .vimrc. If you'd like to have relative numbering
+ instead, try >
+ let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
+<
+ *netrw-P20*
+ P20. How may I have gvim start up showing a directory listing?
+ Try putting the following code snippet into your .vimrc: >
+ augroup VimStartup
+ au!
+ au VimEnter * if expand("%") == "" && argc() == 0 &&
+ \ (v:servername =~ 'GVIM\d*' || v:servername == "")
+ \ | e . | endif
+ augroup END
+< You may use Lexplore instead of "e" if you're so inclined.
+ This snippet assumes that you have client-server enabled
+ (ie. a "huge" vim version).
+
+ *netrw-P21*
+ P21. I've made a directory (or file) with an accented character, but
+ netrw isn't letting me enter that directory/read that file:
+
+ Its likely that the shell or o/s is using a different encoding
+ than you have vim (netrw) using. A patch to vim supporting
+ "systemencoding" may address this issue in the future; for
+ now, just have netrw use the proper encoding. For example: >
+
+ au FileType netrw set enc=latin1
+<
+ *netrw-P22*
+ P22. I get an error message when I try to copy or move a file:
+
+ **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
+
+ What's wrong?
+
+ Netrw uses several system level commands to do things (see
+
+ |g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
+ |g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
+
+ You may need to adjust the default commands for one or more of
+ these commands by setting them properly in your .vimrc. Another
+ source of difficulty is that these commands use vim's local
+ directory, which may not be the same as the browsing directory
+ shown by netrw (see |g:netrw_keepdir|).
+
+
==============================================================================
11. Debugging Netrw Itself *netrw-debug* {{{1
@@ -3504,6 +3700,46 @@ netrw:
==============================================================================
12. History *netrw-history* {{{1
+ v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
+ a file was not treated properly as a file
+ due to g:netrw_keepdir == 1
+ Mar 25, 2015 * (requested by Ben Friz) one may now sort by
+ extension
+ Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
+ of buffer-local mappings; however, some
+ plugins (such as vim-surround) set up
+ conflicting mappings that cause vim to wait.
+ The "<nowait>" modifier has been included
+ with most of netrw's mappings to avoid that
+ delay.
+ Jun 26, 2015 * |netrw-gn| mapping implemted
+ * :Ntree NotADir resulted in having
+ the tree listing expand in the error messages
+ window. Fixed.
+ Jun 29, 2015 * Attempting to delete a file remotely caused
+ an error with "keepsol" mentioned; fixed.
+ Jul 08, 2015 * Several changes to keep the |:jumps| table
+ correct when working with
+ |g:netrw_fastbrowse| set to 2
+ * wide listing with accented characters fixed
+ (using %-S instead of %-s with a |printf()|
+ Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
+ but kfmclient not installed. Changed order
+ in netrw#BrowseX(): checks if kde and
+ kfmclient, then will use xdg-open on a unix
+ system (if xdg-open is executable)
+ Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
+ select a file in a open subdirectory.
+ * (McDonnell) when multiple subdirectories
+ were concurrently open in tree listing
+ mode, a ctrl-L wouldn't refresh properly.
+ * The netrw:target menu showed duplicate
+ entries
+ Oct 13, 2015 * (mattn) provided an exception to handle
+ windows with shellslash set but no shell
+ Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used
+ to control whether NetrwShrink is used
+ (see |netrw-c-tab|)
v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
May 14, 2014 * changed s:PerformListing() so that it
always sets ft=netrw for netrw buffers
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 1e3ea90d2..0e71a39e8 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 7.4. Last change: 2015 Sep 29
+*syntax.txt* For Vim version 7.4. Last change: 2015 Oct 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1081,7 +1081,7 @@ CPP *cpp.vim* *ft-cpp-syntax*
Most of things are same as |ft-c-syntax|.
Variable Highlight ~
-cpp_no_c11 don't highlight C++11 standard items
+cpp_no_cpp11 don't highlight C++11 standard items
CSH *csh.vim* *ft-csh-syntax*
@@ -3248,7 +3248,8 @@ improve screen updating rates (see |:syn-sync| for more on this). >
The g:vimsyn_embed option allows users to select what, if any, types of
embedded script highlighting they wish to have. >
- g:vimsyn_embed == 0 : don't embed any scripts
+ g:vimsyn_embed == 0 : don't support any embedded scripts
+ g:vimsyn_embed =~ 'l' : support embedded lua
g:vimsyn_embed =~ 'm' : support embedded mzscheme
g:vimsyn_embed =~ 'p' : support embedded perl
g:vimsyn_embed =~ 'P' : support embedded python
@@ -3266,6 +3267,7 @@ Some folding is now supported with syntax/vim.vim: >
g:vimsyn_folding == 0 or doesn't exist: no syntax-based folding
g:vimsyn_folding =~ 'a' : augroups
g:vimsyn_folding =~ 'f' : fold functions
+ g:vimsyn_folding =~ 'l' : fold lua script
g:vimsyn_folding =~ 'm' : fold mzscheme script
g:vimsyn_folding =~ 'p' : fold perl script
g:vimsyn_folding =~ 'P' : fold python script
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 75fd0bb3a..9b2a73b35 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2714,6 +2714,14 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:rviminfo starting.txt /*:rviminfo*
:s change.txt /*:s*
:s% change.txt /*:s%*
+:sI change.txt /*:sI*
+:sIc change.txt /*:sIc*
+:sIe change.txt /*:sIe*
+:sIg change.txt /*:sIg*
+:sIl change.txt /*:sIl*
+:sIn change.txt /*:sIn*
+:sIp change.txt /*:sIp*
+:sIr change.txt /*:sIr*
:sN windows.txt /*:sN*
:sNext windows.txt /*:sNext*
:s\= change.txt /*:s\\=*
@@ -2745,6 +2753,13 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sbr windows.txt /*:sbr*
:sbrewind windows.txt /*:sbrewind*
:sbuffer windows.txt /*:sbuffer*
+:sc change.txt /*:sc*
+:scI change.txt /*:scI*
+:sce change.txt /*:sce*
+:scg change.txt /*:scg*
+:sci change.txt /*:sci*
+:scl change.txt /*:scl*
+:scp change.txt /*:scp*
:scr repeat.txt /*:scr*
:scripte repeat.txt /*:scripte*
:scriptencoding repeat.txt /*:scriptencoding*
@@ -2778,8 +2793,20 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:sfind windows.txt /*:sfind*
:sfir windows.txt /*:sfir*
:sfirst windows.txt /*:sfirst*
+:sg change.txt /*:sg*
+:sgI change.txt /*:sgI*
+:sgc change.txt /*:sgc*
+:sge change.txt /*:sge*
+:sgi change.txt /*:sgi*
+:sgl change.txt /*:sgl*
+:sgn change.txt /*:sgn*
+:sgp change.txt /*:sgp*
+:sgr change.txt /*:sgr*
:sh various.txt /*:sh*
:shell various.txt /*:shell*
+:si change.txt /*:si*
+:sic change.txt /*:sic*
+:sie change.txt /*:sie*
:sig sign.txt /*:sig*
:sign sign.txt /*:sign*
:sign-define sign.txt /*:sign-define*
@@ -2794,6 +2821,9 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:silent various.txt /*:silent*
:sim gui_w32.txt /*:sim*
:simalt gui_w32.txt /*:simalt*
+:sin change.txt /*:sin*
+:sip change.txt /*:sip*
+:sir change.txt /*:sir*
:sl various.txt /*:sl*
:sla windows.txt /*:sla*
:slast windows.txt /*:slast*
@@ -2838,8 +2868,16 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:split_f windows.txt /*:split_f*
:spr windows.txt /*:spr*
:sprevious windows.txt /*:sprevious*
+:sr change.txt /*:sr*
+:srI change.txt /*:srI*
+:src change.txt /*:src*
:sre windows.txt /*:sre*
:srewind windows.txt /*:srewind*
+:srg change.txt /*:srg*
+:sri change.txt /*:sri*
+:srl change.txt /*:srl*
+:srn change.txt /*:srn*
+:srp change.txt /*:srp*
:st starting.txt /*:st*
:sta windows.txt /*:sta*
:stag windows.txt /*:stag*
@@ -5942,6 +5980,7 @@ g0 motion.txt /*g0*
g8 various.txt /*g8*
g: eval.txt /*g:*
g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu*
+g:Netrw_UserMaps pi_netrw.txt /*g:Netrw_UserMaps*
g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler*
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
g:ada#Comment ft_ada.txt /*g:ada#Comment*
@@ -6104,8 +6143,10 @@ g:netrw_uid pi_netrw.txt /*g:netrw_uid*
g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow*
g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf*
g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp*
+g:netrw_usetab pi_netrw.txt /*g:netrw_usetab*
g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
+g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:sh_isk syntax.txt /*g:sh_isk*
g:sh_noisk syntax.txt /*g:sh_noisk*
@@ -7064,6 +7105,10 @@ netrw-D pi_netrw.txt /*netrw-D*
netrw-O pi_netrw.txt /*netrw-O*
netrw-P pi_netrw.txt /*netrw-P*
netrw-P18 pi_netrw.txt /*netrw-P18*
+netrw-P19 pi_netrw.txt /*netrw-P19*
+netrw-P20 pi_netrw.txt /*netrw-P20*
+netrw-P21 pi_netrw.txt /*netrw-P21*
+netrw-P22 pi_netrw.txt /*netrw-P22*
netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S*
netrw-Tb pi_netrw.txt /*netrw-Tb*
@@ -7083,6 +7128,7 @@ netrw-browser-settings pi_netrw.txt /*netrw-browser-settings*
netrw-browser-var pi_netrw.txt /*netrw-browser-var*
netrw-browsing pi_netrw.txt /*netrw-browsing*
netrw-c pi_netrw.txt /*netrw-c*
+netrw-c-tab pi_netrw.txt /*netrw-c-tab*
netrw-cadaver pi_netrw.txt /*netrw-cadaver*
netrw-chgup pi_netrw.txt /*netrw-chgup*
netrw-clean pi_netrw.txt /*netrw-clean*
@@ -7104,6 +7150,7 @@ netrw-dir pi_netrw.txt /*netrw-dir*
netrw-dirlist pi_netrw.txt /*netrw-dirlist*
netrw-downdir pi_netrw.txt /*netrw-downdir*
netrw-edithide pi_netrw.txt /*netrw-edithide*
+netrw-editwindow pi_netrw.txt /*netrw-editwindow*
netrw-ex pi_netrw.txt /*netrw-ex*
netrw-explore pi_netrw.txt /*netrw-explore*
netrw-explore-cmds pi_netrw.txt /*netrw-explore-cmds*
@@ -7119,6 +7166,7 @@ netrw-getftype pi_netrw.txt /*netrw-getftype*
netrw-gf pi_netrw.txt /*netrw-gf*
netrw-gh pi_netrw.txt /*netrw-gh*
netrw-gitignore pi_netrw.txt /*netrw-gitignore*
+netrw-gn pi_netrw.txt /*netrw-gn*
netrw-gp pi_netrw.txt /*netrw-gp*
netrw-grep pi_netrw.txt /*netrw-grep*
netrw-gx pi_netrw.txt /*netrw-gx*
@@ -7164,12 +7212,14 @@ netrw-mv pi_netrw.txt /*netrw-mv*
netrw-mx pi_netrw.txt /*netrw-mx*
netrw-mz pi_netrw.txt /*netrw-mz*
netrw-netrc pi_netrw.txt /*netrw-netrc*
+netrw-newfile pi_netrw.txt /*netrw-newfile*
netrw-nexplore pi_netrw.txt /*netrw-nexplore*
netrw-noload pi_netrw.txt /*netrw-noload*
netrw-nread pi_netrw.txt /*netrw-nread*
netrw-ntree pi_netrw.txt /*netrw-ntree*
netrw-nwrite pi_netrw.txt /*netrw-nwrite*
netrw-o pi_netrw.txt /*netrw-o*
+netrw-obtain pi_netrw.txt /*netrw-obtain*
netrw-options pi_netrw.txt /*netrw-options*
netrw-p pi_netrw.txt /*netrw-p*
netrw-p1 pi_netrw.txt /*netrw-p1*
@@ -7211,6 +7261,7 @@ netrw-quickmaps pi_netrw.txt /*netrw-quickmaps*
netrw-r pi_netrw.txt /*netrw-r*
netrw-read pi_netrw.txt /*netrw-read*
netrw-ref pi_netrw.txt /*netrw-ref*
+netrw-refresh pi_netrw.txt /*netrw-refresh*
netrw-rename pi_netrw.txt /*netrw-rename*
netrw-reverse pi_netrw.txt /*netrw-reverse*
netrw-rexplore pi_netrw.txt /*netrw-rexplore*
@@ -7237,6 +7288,7 @@ netrw-transparent pi_netrw.txt /*netrw-transparent*
netrw-u pi_netrw.txt /*netrw-u*
netrw-updir pi_netrw.txt /*netrw-updir*
netrw-urls pi_netrw.txt /*netrw-urls*
+netrw-usermaps pi_netrw.txt /*netrw-usermaps*
netrw-userpass pi_netrw.txt /*netrw-userpass*
netrw-v pi_netrw.txt /*netrw-v*
netrw-var pi_netrw.txt /*netrw-var*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 573dc42bb..74f025dfd 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2015 Oct 13
+*todo.txt* For Vim version 7.4. Last change: 2015 Oct 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -83,18 +83,48 @@ work. (ZyX, 2013 Sep 28)
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
+Netrw update. (Charles 2015 Oct 23)
+
+Patch to use local value of 'errorformat' in :cexpr. (Christian Brabandt,
+2015 Oct 16) Only do this for :lexpr ?
+
+Update Oracle syntax file from:
+https://github.com/chrisbra/vim-sqloracle-syntax/blob/master/syntax/sqloracle.vim
+
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
+Updated syntax files. (Charles Campbell, 2015 Oct 19)
+
+Patch to include .desktop files in the distribution. PR #455.
+
+Better changelog syntax file. (Martin Florian, 2015 Oct 25)
+
+Better readline syntax file. (Raphael Bazaud, 2015 Oct 25)
+
+English spell checking has an error. Updating doesn't work.
+(Dominique Pelle, 2015 Oct 15)
+Hint for new URL: Christian Brabandt, 2015 Oct 15.
+But that file looks old.
+
Using ":windo" to set options in all windows has the side effect that it
changes the window layout and the current window. Make a variant that saves
and restores. Use in the matchparen plugin.
Perhaps we can use ":silent window"?
+Patch for documentation mistakes. (Hirohito Higashi, 2015 Oct 22)
+
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
+Patch for yaml indent, #458.
+
+Patch for Python to add isatty, readable, etc. (PR #464)
+
+Patch to add options for specifying dll names. (Kazuki Sakamoto, 2015 Oct 16)
+PR #452 Check if it's secure (can't set from modeline).
+
Unexpected delay when using CTRL-O u. It's not timeoutlen.
(Gary Johnson, 2015 Aug 28)
@@ -112,6 +142,12 @@ wrong name. (Aram, 2014 Nov 7) Vim 7.4.
Can't recognize the $ProgramFiles(x86) environment variable. Recognize it
specifically? First try with the parens, then without.
+Patch to add 'tagcase' option, whether to ignore case for tags.
+(Gary Johnson, 2015 Oct 17)
+
+Patch to fix "." after CTRL-A in Visual block mode. (Ozaki Kiichi, 2015 Oct
+24)
+
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistent with the documentation.
@@ -145,6 +181,8 @@ wildcards. Add a ":nowild" command modifier? (ZyX, 2015 March 4)
Proposal to make options.txt easier to read. (Arnaud Decara, 2015 Aug 5)
Update Aug 14.
+Crash in :cnext on MS-Windows. (Ben Fritz, 2015 Oct 27)
+
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
Sep 10)
@@ -199,6 +237,9 @@ Doesn't work completely (Dominique Orban)
Patch to add a "literal" argument to bufnr(). (Olaf Dabrunz, 2015 Aug 4)
+Cannot execute the shell when it's in a directory with a space.
+Issue #459.
+
When a session file is created and there are "nofile" buffers, these are not
filled. Need to trigger BufReadCmd autocommands. Also handle deleting the
initial empty buffer better. (ZyX, 2015 March 8)
@@ -300,6 +341,10 @@ them: ":repeats".
Patch for glob(), adding slash to normal files. (Ingo Karkat, 2014 Dec 22)
+When entering and leaving the preview window autocommands are triggered, but
+these may not work well. Perhaps set a flag to indicate that the preview
+window is involved? (John Otter, 2015 Oct 27)
+
Using "." to repeat an Ex command puts that command in history. Probably
should not happen. If the command is the result of a mapping it's not put in
history either. (Jacob Niehus, 2014 Nov 2)
diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt
index 6eaa9c14a..8f0820fbf 100644
--- a/runtime/doc/usr_43.txt
+++ b/runtime/doc/usr_43.txt
@@ -1,4 +1,4 @@
-*usr_43.txt* For Vim version 7.4. Last change: 2008 Dec 28
+*usr_43.txt* For Vim version 7.4. Last change: 2015 Oct 23
VIM USER MANUAL - by Bram Moolenaar
@@ -46,6 +46,7 @@ three-line comment. You do this with only two steps:
setlocal softtabstop=4
noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc>
+ let b:undo_ftplugin = "setl softtabstop< | unmap <buffer> <LocalLeader>c"
Try editing a C file. You should notice that the 'softtabstop' option is set
to 4. But when you edit another file it's reset to the default zero. That is
@@ -60,6 +61,11 @@ buffer. This works with any mapping command: ":map!", ":vmap", etc. The
|<LocalLeader>| in the mapping is replaced with the value of the
"maplocalleader" variable.
+The line to set b:undo_ftplugin is for when the filetype is set to another
+value. In that case you will want to undo your preferences. The
+b:undo_ftplugin variable is executed as a command. Watch out for characters
+with a special meaning inside a string, such as a backslash.
+
You can find examples for filetype plugins in this directory: >
$VIMRUNTIME/ftplugin/
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index cad4d31a0..3776ac30f 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -20,19 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
-let g:loaded_netrwPlugin = "v153"
-if v:version < 702
- echohl WarningMsg
- echo "***warning*** you need vim version 7.2 for this version of netrw"
- echohl None
- finish
-endif
-if v:version < 703 || (v:version == 703 && !has("patch465"))
- echohl WarningMsg
- echo "***warning*** this version of netrw needs vim 7.3.465 or later"
- echohl Normal
- finish
-endif
+let g:loaded_netrwPlugin = "v154"
let s:keepcpo = &cpo
set cpo&vim
"DechoRemOn
@@ -102,6 +90,12 @@ if !exists("g:netrw_nogx")
vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
endif
endif
+if exists("g:netrw_usetab") && g:netrw_usetab
+ if maparg('<c-tab>','n') == ""
+ nmap <unique> <c-tab> <Plug>NetrwShrink
+ endif
+ nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr>
+endif
" ---------------------------------------------------------------------
" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2
@@ -135,15 +129,19 @@ fun! s:LocalBrowse(dirname)
elseif isdirectory(a:dirname)
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
" call Dredir("LocalBrowse ft last set: ","verbose set ft")
+" call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
sil! call netrw#LocalBrowseCheck(a:dirname)
+" call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
exe w:netrw_bannercnt
+" call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
endif
else
" not a directory, ignore it
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
endif
+" call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
" call Dret("s:LocalBrowse")
endfun
diff --git a/runtime/syntax/autohotkey.vim b/runtime/syntax/autohotkey.vim
index 42d4cfdfe..764f94b11 100644
--- a/runtime/syntax/autohotkey.vim
+++ b/runtime/syntax/autohotkey.vim
@@ -1,7 +1,8 @@
" Vim syntax file
" Language: AutoHotkey script file
-" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-06-22
+" Maintainer: SungHyun Nam <goweol@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2015-10-29
if exists("b:current_syntax")
finish
@@ -179,6 +180,7 @@ syn keyword autohotkeyRepeat
syn keyword autohotkeyConditional
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
+ \ IfWinExist IfWinNotExist
syn match autohotkeyPreProcStart
\ nextgroup=
diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim
index 980fe5dde..718cee142 100644
--- a/runtime/syntax/netrw.vim
+++ b/runtime/syntax/netrw.vim
@@ -19,7 +19,6 @@ syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell
-"syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify,@NoSpell
syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index b95ff4d8c..90848094d 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change: Jun 11, 2015
-" Version: 87
+" Last Change: Oct 19, 2015
+" Version: 89
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -122,6 +122,11 @@ endif
if g:tex_fold_enabled && &fdm == "manual"
setl fdm=syntax
endif
+if g:tex_fold_enabled && has("folding")
+ com! -nargs=* TexFold <args> fold
+else
+ com! -nargs=* TexFold <args>
+endif
" (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1
" but _ is the only one that causes problems.
@@ -142,7 +147,7 @@ endif
" Clusters: {{{1
" --------
syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle
-if !exists("s:tex_no_error") || !s:tex_no_error
+if !s:tex_no_error
syn cluster texCmdGroup add=texMathError
endif
syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement
@@ -156,15 +161,16 @@ else
syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption
syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher
endif
-syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
+syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter
if !exists("g:tex_no_math")
+syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
syn cluster texMatchGroup add=@texMathZones
syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone
syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle
- if !exists("s:tex_no_error") || !s:tex_no_error
+ if !s:tex_no_error
syn cluster texMathMatchGroup add=texMathError
syn cluster texMathZoneGroup add=texMathError
endif
@@ -186,7 +192,7 @@ endif
" Try to flag {} and () mismatches: {{{1
if s:tex_fast =~ 'm'
- if !exists("s:tex_no_error") || !s:tex_no_error
+ if !s:tex_no_error
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError
syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError,@NoSpell
else
@@ -199,15 +205,15 @@ if s:tex_fast =~ 'm'
syn region texParen start="(" end=")" contains=@texMatchGroup
endif
endif
-if !exists("s:tex_no_error") || !s:tex_no_error
+if !s:tex_no_error
syn match texError "[}\])]"
endif
if s:tex_fast =~ 'M'
if !exists("g:tex_no_math")
- if !exists("s:tex_no_error") || !s:tex_no_error
+ if !s:tex_no_error
syn match texMathError "}" contained
endif
- syn region texMathMatcher matchgroup=Delimiter start="{" skip="\(\\\\\)*\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
+ syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
endif
endif
@@ -218,7 +224,7 @@ if exists("g:tex_tex") || b:tex_stylish
syn match texStatement "\\[a-zA-Z@]\+"
else
syn match texStatement "\\\a\+"
- if !exists("s:tex_no_error") || !s:tex_no_error
+ if !s:tex_no_error
syn match texError "\\\a*@[a-zA-Z@]*"
endif
endif
@@ -226,7 +232,7 @@ endif
" TeX/LaTeX delimiters: {{{1
syn match texDelimiter "&"
syn match texDelimiter "\\\\"
-"%syn match texDelimiter "[{}]"
+" syn match texDelimiter "[{}]"
" Tex/Latex Options: {{{1
syn match texOption "[^\\]\zs#\d\+\|^#\d\+"
@@ -247,7 +253,7 @@ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$"
" \begin{}/\end{} section markers: {{{1
syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName
if s:tex_fast =~ 'm'
- syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment
+ syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment
syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell
endif
@@ -337,54 +343,27 @@ syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
" Sections, subsections, etc: {{{1
if s:tex_fast =~ 'p'
if !exists("g:tex_nospell") || !g:tex_nospell
- if g:tex_fold_enabled && has("folding")
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell
- else
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell
- syn region texSpellZone matchgroup=texSpellZone start="%spellzone_start" end="%spellzone_end" contains=@Spell
- endif
+ TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
+ TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
+ TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
+ TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
+ TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
+ TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
+ TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
+ TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
+ TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell
+ TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell
else
- if g:tex_fold_enabled && has("folding")
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup
- else
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup
- endif
+ TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
+ TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup
+ TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup
+ TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup
+ TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
+ TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup
+ TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup
+ TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup
+ TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup
+ TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup
endif
endif
@@ -406,8 +385,8 @@ if s:tex_fast =~ 'b'
endif
" Bad Math (mismatched): {{{1
-if !exists("g:tex_no_math") && (!exists("s:tex_no_error") || !s:tex_no_error)
- syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|smallmatrix\|xxalignat\)\s*}"
+if !exists("g:tex_no_math") && !s:tex_no_error
+ syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
syn match texBadMath "\\[\])]"
endif
@@ -456,8 +435,9 @@ if !exists("g:tex_no_math")
call TexNewMathZone("G","gather",1)
call TexNewMathZone("H","math",1)
call TexNewMathZone("I","multline",1)
- call TexNewMathZone("J","xalignat",1)
- call TexNewMathZone("K","xxalignat",0)
+ call TexNewMathZone("J","subequations",0)
+ call TexNewMathZone("K","xalignat",1)
+ call TexNewMathZone("L","xxalignat",0)
" Inline Math Zones: {{{2
if s:tex_fast =~ 'M'
@@ -573,25 +553,23 @@ syn case ignore
syn keyword texTodo contained combak fixme todo xxx
syn case match
if s:extfname == "dtx"
- syn match texComment "\^\^A.*$" contains=@texCommentGroup
- syn match texComment "^%\+" contains=@texCommentGroup
+ syn match texComment "\^\^A.*$" contains=@texCommentGroup
+ syn match texComment "^%\+" contains=@texCommentGroup
else
- if g:tex_fold_enabled
- " allows syntax-folding of 2 or more contiguous comment lines
- " single-line comments are not folded
- syn match texComment "%.*$" contains=@texCommentGroup
- if s:tex_fast =~ 'c'
- syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' fold
- syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" fold contains=@texFoldGroup,@NoSpell
- syn region texSpellZone matchgroup=texComment start="%\s*spellzone_start" end="%\s*spellzone_end" fold contains=@Spell,@texFoldGroup
- endif
- else
- syn match texComment "%.*$" contains=@texCommentGroup
- if s:tex_fast =~ 'c'
- syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
- syn region texSpellZone matchgroup=texComment start="%\s*spellzone_start" end="%\s*spellzone_end" contains=@Spell,@texFoldGroup
- endif
+ if g:tex_fold_enabled
+ " allows syntax-folding of 2 or more contiguous comment lines
+ " single-line comments are not folded
+ syn match texComment "%.*$" contains=@texCommentGroup
+ if s:tex_fast =~ 'c'
+ TexFold syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]'
+ TexFold syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
endif
+ else
+ syn match texComment "%.*$" contains=@texCommentGroup
+ if s:tex_fast =~ 'c'
+ syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell
+ endif
+ endif
endif
" Separate lines used for verb` and verb# so that the end conditions {{{1
@@ -673,7 +651,7 @@ syn match texLength "\<\d\+\([.,]\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\
syn match texString "\(``\|''\|,,\)"
" makeatletter -- makeatother sections
-if !exists("s:tex_no_error") || !s:tex_no_error
+if !s:tex_no_error
if s:tex_fast =~ 'S'
syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained
endif
@@ -1353,6 +1331,7 @@ if did_tex_syntax_inits == 1
endif
" Cleanup: {{{1
+delc TexFold
unlet s:extfname
let b:current_syntax = "tex"
let &cpo = s:keepcpo
diff --git a/runtime/syntax/vhdl.vim b/runtime/syntax/vhdl.vim
index da2b975dd..eeba10a41 100644
--- a/runtime/syntax/vhdl.vim
+++ b/runtime/syntax/vhdl.vim
@@ -4,7 +4,6 @@
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
" Last Changed: 2015 Oct 13 by Daniel Kho
-" $Id: vhdl.vim,v 1.1 2004/06/13 15:34:56 vimboss Exp $
" VHSIC (Very High Speed Integrated Circuit) Hardware Description Language
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 50553b07a..d90d8843b 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 7.4 script
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Apr 02, 2015
-" Version: 7.4-33
+" Last Change: October 19, 2015
+" Version: 7.4-35
" Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2
@@ -28,28 +28,28 @@ syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained acd ambw ari aw backupext beval biosk breakindent bsdir cb cfu cinkeys cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rightleftcmd rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
-syn keyword vimOption contained ai anti arshape awa backupskip bex bioskey breakindentopt bsk cc ch cino cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt renderoptions rl ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
-syn keyword vimOption contained akm antialias autochdir background balloondelay bexpr bk bri bt ccv charconvert cinoptions cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re report rlc ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
-syn keyword vimOption contained al ar autoindent backspace ballooneval bg bkc briopt bufhidden cd ci cinw cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly restorescreen rnu ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
-syn keyword vimOption contained aleph arab autoread backup balloonexpr bh bl brk buflisted cdpath cin cinwords co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime revins ro rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
-syn keyword vimOption contained allowrevins arabic autowrite backupcopy bdir bin bomb browsedir buftype cedit cindent clipboard cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine ri rop runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
-syn keyword vimOption contained altkeymap arabicshape autowriteall backupdir bdlay binary breakat bs casemap cf cink cm cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleft rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
-syn keyword vimOption contained ambiwidth fixeol fixendofline
+syn keyword vimOption contained acd ambw arshape background ballooneval bg bkc bri bt ccv charconvert cinoptions cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rightleftcmd rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
+syn keyword vimOption contained ai anti autochdir backspace balloonexpr bh bl briopt bufhidden cd ci cinw cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt renderoptions rl ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
+syn keyword vimOption contained akm antialias autoindent backup bdir bin bo brk buflisted cdpath cin cinwords co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re report rlc ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
+syn keyword vimOption contained al ar autoread backupcopy bdlay binary bomb browsedir buftype cedit cindent clipboard cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly restorescreen rnu ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
+syn keyword vimOption contained aleph arab autowrite backupdir belloff biosk breakat bs casemap cf cink cm cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fixendofline fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime revins ro rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
+syn keyword vimOption contained allowrevins arabic autowriteall backupext beval bioskey breakindent bsdir cb cfu cinkeys cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fixeol foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine ri rop runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
+syn keyword vimOption contained altkeymap arabicshape aw backupskip bex bk breakindentopt bsk cc ch cino cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleft rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
+syn keyword vimOption contained ambiwidth ari awa balloondelay bexpr
" vimOptions: These are the turn-off setting variants {{{2
-syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofk nogd nohid nohkmap nohkp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
-syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofkmap nogdefault nohidden nohkmapp nohls noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
-syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofoldenable noguipty nohk nofixeol nofixendofline
+syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofixendofline nofkmap nogdefault nohidden nohkmapp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
+syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobiosk nobl nocf nocindent noconsk nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofixeol nofoldenable noguipty nohk nohkp noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
+syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobioskey nobomb noci nocompatible noconskey nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofk nogd nohid nohkmap nohls
" vimOptions: These are the invertible variants {{{2
-syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfk invgd invhid invhkmap invhkp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
-syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfkmap invgdefault invhidden invhkmapp invhls invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
-syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfoldenable invguipty invhk
+syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfixendofline invfkmap invgdefault invhidden invhkmapp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
+syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbiosk invbl invcf invcindent invconsk invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfixeol invfoldenable invguipty invhk invhkp invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
+syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbioskey invbomb invci invcompatible invconskey invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfk invgd invhid invhkmap invhls
" termcap codes (which can also be set) {{{2
-syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_da t_db t_dl t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR
-syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS
+syn keyword vimOption contained t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RB t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR
+syn keyword vimOption contained t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da t_dl
syn match vimOption contained "t_%1"
syn match vimOption contained "t_#2"
syn match vimOption contained "t_#4"
@@ -64,7 +64,7 @@ syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600
" AutoCmd Events {{{2
syn case ignore
-syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave
+syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave
" Highlight commonly used Groupnames {{{2
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
@@ -75,13 +75,66 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
-syn keyword vimFuncName contained abs and argidx asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setline setpos settabvar sha256 simplify sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack systemlist tabpagenr tagfiles tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
-syn keyword vimFuncName contained acos append arglistid atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setloclist setqflist settabwinvar shellescape sin soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth xor
-syn keyword vimFuncName contained add argc argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcmdpos setmatches setreg setwinvar shiftwidth sinh
+syn keyword vimFuncName contained abs and argidx asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdline getcmdwintype getfontname getftime getloclist getpos getregtype getwinposx glob has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setloclist setqflist settabwinvar shellescape sin soundfold split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack systemlist tabpagenr tagfiles tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
+syn keyword vimFuncName contained acos append arglistid atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdpos getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy glob2regpat has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth xor
+syn keyword vimFuncName contained add argc argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcharsearch getcmdtype getcwd getfsize getline getpid getreg gettabwinvar getwinvar globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setline setpos settabvar sha256 simplify sort spellsuggest
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
+" Set up folding commands
+if exists("g:vimsyn_folding") && g:vimsyn_folding =~ '[aflmpPrt]'
+ if g:vimsyn_folding =~ 'a'
+ com! -nargs=* VimFolda <args> fold
+ else
+ com! -nargs=* VimFolda <args>
+ endif
+ if g:vimsyn_folding =~ 'f'
+ com! -nargs=* VimFoldf <args> fold
+ else
+ com! -nargs=* VimFoldf <args>
+ endif
+ if g:vimsyn_folding =~ 'l'
+ com! -nargs=* VimFoldl <args> fold
+ else
+ com! -nargs=* VimFoldl <args>
+ endif
+ if g:vimsyn_folding =~ 'm'
+ com! -nargs=* VimFoldm <args> fold
+ else
+ com! -nargs=* VimFoldm <args>
+ endif
+ if g:vimsyn_folding =~ 'p'
+ com! -nargs=* VimFoldp <args> fold
+ else
+ com! -nargs=* VimFoldp <args>
+ endif
+ if g:vimsyn_folding =~ 'P'
+ com! -nargs=* VimFoldP <args> fold
+ else
+ com! -nargs=* VimFoldP <args>
+ endif
+ if g:vimsyn_folding =~ 'r'
+ com! -nargs=* VimFoldr <args> fold
+ else
+ com! -nargs=* VimFoldr <args>
+ endif
+ if g:vimsyn_folding =~ 't'
+ com! -nargs=* VimFoldt <args> fold
+ else
+ com! -nargs=* VimFoldt <args>
+ endif
+else
+ com! -nargs=* VimFolda <args>
+ com! -nargs=* VimFoldf <args>
+ com! -nargs=* VimFoldl <args>
+ com! -nargs=* VimFoldm <args>
+ com! -nargs=* VimFoldp <args>
+ com! -nargs=* VimFoldP <args>
+ com! -nargs=* VimFoldr <args>
+ com! -nargs=* VimFoldt <args>
+endif
+
" commands not picked up by the generator (due to non-standard format)
syn keyword vimCommand contained py3
@@ -104,7 +157,7 @@ syn match vimNumber "\<0[xX]\x\+"
syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
" All vimCommands are contained by vimIsCommands. {{{2
-syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
+syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
syn match vimVar "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>"
@@ -137,12 +190,8 @@ syn keyword vimFTOption contained detect indent off on plugin
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'a'
- syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
-else
- syn region vimAugroup matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
-endif
-syn match vimAugroup "aug\%[roup]!" contains=vimAugroupKey
+VimFolda syn region vimAugroup matchgroup=vimStatement start="\<aug\%[roup]\ze\s\+\%([eE][nN][dD]\>\)\@3<!\h\w*" matchgroup=vimStatement end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
+syn match vimAugroup "aug\%[roup]!" contains=vimAugroupKey
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
endif
@@ -150,11 +199,12 @@ syn keyword vimAugroupKey contained aug[roup]
" Operators: {{{2
" =========
+" COMBAK: vimOperParen used to have "oneline"
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
-syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
+syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
syn match vimOperError ")"
endif
@@ -162,15 +212,11 @@ endif
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
" =========
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
-syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
+syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
- syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
-else
- syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
-endif
-syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
+VimFoldf syn region vimFuncBody contained start="\ze(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)" contains=@vimFuncBodyList
+syn match vimFuncVar contained "a:\(\h\w*\|\d\+\)"
syn match vimFuncSID contained "\c<sid>\|\<s:"
syn keyword vimFuncKey contained fu[nction]
syn match vimFuncBlank contained "\s\+"
@@ -191,16 +237,14 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained
" =======================
syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
syn keyword vimUserCommand contained com[mand]
-syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList
-syn match vimUserAttrbError contained "-\a\+\ze\s"
-syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper
-syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
-syn match vimUserAttrb contained "-range\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
-syn match vimUserAttrb contained "-count\(=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
-syn match vimUserAttrb contained "-bang\>" contains=vimOper,vimUserAttrbKey
-syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey
-syn match vimUserAttrb contained "-buffer\>" contains=vimOper,vimUserAttrbKey
-syn match vimUserAttrb contained "-register\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserCommand,@vimUserCmdList
+syn match vimUserAttrb contained "-n\%[args]=[01*?+]" contains=vimUserAttrbKey,vimOper
+syn match vimUserAttrb contained "-com\%[plete]=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
+syn match vimUserAttrb contained "-ra\%[nge]\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-cou\%[nt]=\d\+" contains=vimNumber,vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-bang\=\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-re\%[gister]\>" contains=vimOper,vimUserAttrbKey
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
syn match vimUserCmdError contained "\S\+\>"
endif
@@ -274,7 +318,7 @@ syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumbe
syn match vimMarkNumber "[-+]\d\+" nextgroup=vimSubst contained contains=vimOper
syn match vimPlainMark contained "'[a-zA-Z0-9]"
-syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
+syn match vimRegister '[^,;[{]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
syn match vimRegister '@"'
@@ -294,7 +338,7 @@ syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
-syn match vimSetSep contained "[,:]" skipwhite nextgroup=vimCommand
+syn match vimSetSep contained "[,:]"
syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
" Let {{{2
@@ -329,11 +373,11 @@ syn keyword vimMap mapc[lear] smapc[lear]
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs
-syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
+syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend
-syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue
+syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimNotation,vimCtrlChar,vimContinue skipnl nextgroup=vimMapRhsExtend
syn case ignore
-syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
+syn keyword vimMapModKey contained buffer expr leader localleader plug script sid silent unique
syn case match
" Menus {{{2
@@ -363,8 +407,8 @@ syn case match
" User Function Highlighting {{{2
" (following Gautam Iyer's suggestion)
" ==========================
-syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
-syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
+syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
+syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>"
" Errors And Warnings: {{{2
@@ -410,7 +454,7 @@ syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
" Syntax: cluster {{{2
syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
-syn region vimClusterName contained matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
+syn region vimClusterName contained matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
syn match vimGroupAdd contained "add=" nextgroup=vimGroupList
syn match vimGroupRem contained "remove=" nextgroup=vimGroupList
syn cluster vimFuncBodyList add=vimSynType,vimGroupAdd,vimGroupRem
@@ -422,14 +466,14 @@ syn cluster vimFuncBodyList add=vimSynType
" Syntax: keyword {{{2
syn cluster vimSynKeyGroup contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
-syn region vimSynKeyRegion contained oneline keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
+syn region vimSynKeyRegion contained oneline keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
syn match vimSynKeyOpt contained "\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
syn cluster vimFuncBodyList add=vimSynType
" Syntax: match {{{2
syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
-syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
+syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
if has("conceal")
syn match vimSynMtchOpt contained "\<cchar=" nextgroup=vimSynMtchCchar
@@ -444,7 +488,7 @@ syn keyword vimSynType contained enable list manual off on reset
syn cluster vimSynRegPatGroup contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
syn cluster vimSynRegGroup contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
-syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
+syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
syn match vimSynRegOpt contained "\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat
syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
@@ -470,9 +514,9 @@ syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
-syn match vimSyncGroupName contained "\k\+" skipwhite nextgroup=vimSyncKey
+syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
-syn match vimSyncGroup contained "\k\+" skipwhite nextgroup=vimSynRegPat,vimSyncNone
+syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
syn keyword vimSyncNone contained NONE
" Additional IsCommand, here by reasons of precedence {{{2
@@ -553,52 +597,31 @@ syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' e
" Allows users to specify the type of embedded script highlighting
" they want: (perl/python/ruby/tcl support)
" g:vimsyn_embed == 0 : don't embed any scripts
-" g:vimsyn_embed =~ 'l' : embed lua (but only if vim supports it)
-" g:vimsyn_embed =~ 'm' : embed mzscheme (but only if vim supports it)
-" g:vimsyn_embed =~ 'p' : embed perl (but only if vim supports it)
-" g:vimsyn_embed =~ 'P' : embed python (but only if vim supports it)
-" g:vimsyn_embed =~ 'r' : embed ruby (but only if vim supports it)
-" g:vimsyn_embed =~ 't' : embed tcl (but only if vim supports it)
-if has("win32") || has("win95") || has("win64") || has("win16")
- " apparently has("tcl") has been hanging vim on some windows systems with cygwin
- let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
-else
- let s:trytcl= 1
-endif
+" g:vimsyn_embed ~= 'l' : embed lua (but only if vim supports it)
+" g:vimsyn_embed ~= 'm' : embed mzscheme (but only if vim supports it)
+" g:vimsyn_embed ~= 'p' : embed perl (but only if vim supports it)
+" g:vimsyn_embed ~= 'P' : embed python (but only if vim supports it)
+" g:vimsyn_embed ~= 'r' : embed ruby (but only if vim supports it)
+" g:vimsyn_embed ~= 't' : embed tcl (but only if vim supports it)
if !exists("g:vimsyn_embed")
- " for default g:vimsyn_embed, determine what to allow based on whether this vim supports it
- let g:vimsyn_embed= ""
- if has("lua") |let g:vimsyn_embed= g:vimsyn_embed."l"|endif
- if has("mzscheme") |let g:vimsyn_embed= g:vimsyn_embed."m"|endif
- if has("perl") |let g:vimsyn_embed= g:vimsyn_embed."p"|endif
- if has("python") |let g:vimsyn_embed= g:vimsyn_embed."P"
- elseif has("python3")|let g:vimsyn_embed= g:vimsyn_embed."P"|endif
- if has("ruby") |let g:vimsyn_embed= g:vimsyn_embed."r"|endif
- if s:trytcl
- if has("tcl") |let g:vimsyn_embed= g:vimsyn_embed."t"|endif
- endif
+ let g:vimsyn_embed= "lmpPr"
endif
" [-- lua --] {{{3
let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
if !filereadable(s:luapath)
- for luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
- if filereadable(luapath)
- let s:luapath= fnameescape(luapath)
+ for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
+ if filereadable(fnameescape(s:luapath))
+ let s:luapath= fnameescape(s:luapath)
break
endif
endfor
endif
-if g:vimsyn_embed =~ 'l' && has("lua") && filereadable(s:luapath)
+if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath)
unlet! b:current_syntax
exe "syn include @vimLuaScript ".s:luapath
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'l'
- syn region vimLuaRegion fold matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
- syn region vimLuaRegion fold matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
- else
- syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
- syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
- endif
+ VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
+ VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
syn cluster vimFuncBodyList add=vimLuaRegion
else
syn region vimEmbedError start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+
@@ -609,23 +632,18 @@ unlet s:luapath
" [-- perl --] {{{3
let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
if !filereadable(s:perlpath)
- for perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
- if filereadable(fnameescape(perlpath))
- let s:perlpath= fnameescape(perlpath)
+ for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
+ if filereadable(fnameescape(s:perlpath))
+ let s:perlpath= fnameescape(s:perlpath)
break
endif
endfor
endif
-if g:vimsyn_embed =~ 'p' && has("perl") && filereadable(s:perlpath)
+if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath)
unlet! b:current_syntax
exe "syn include @vimPerlScript ".s:perlpath
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'p'
- syn region vimPerlRegion fold matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
- syn region vimPerlRegion fold matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
- else
- syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
- syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
- endif
+ VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
+ VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
syn cluster vimFuncBodyList add=vimPerlRegion
else
syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+
@@ -636,21 +654,17 @@ unlet s:perlpath
" [-- ruby --] {{{3
let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
if !filereadable(s:rubypath)
- for rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
- if filereadable(fnameescape(rubypath))
- let s:rubypath= fnameescape(rubypath)
+ for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
+ if filereadable(fnameescape(s:rubypath))
+ let s:rubypath= fnameescape(s:rubypath)
break
endif
endfor
endif
-if g:vimsyn_embed =~ 'r' && has("ruby") && filereadable(s:rubypath)
+if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath)
unlet! b:current_syntax
exe "syn include @vimRubyScript ".s:rubypath
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'r'
- syn region vimRubyRegion fold matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
- else
- syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
- endif
+ VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
syn cluster vimFuncBodyList add=vimRubyRegion
else
@@ -662,9 +676,9 @@ unlet s:rubypath
" [-- python --] {{{3
let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
if !filereadable(s:pythonpath)
- for pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
- if filereadable(fnameescape(pythonpath))
- let s:pythonpath= fnameescape(pythonpath)
+ for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
+ if filereadable(fnameescape(s:pythonpath))
+ let s:pythonpath= fnameescape(s:pythonpath)
break
endif
endfor
@@ -672,33 +686,28 @@ endif
if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
unlet! b:current_syntax
exe "syn include @vimPythonScript ".s:pythonpath
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'P'
- syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
- syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
- syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
- syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
- else
- syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
- syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
- syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
- syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
- endif
+ VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
+ VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
syn cluster vimFuncBodyList add=vimPythonRegion
else
syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+
- syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
- syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+
endif
unlet s:pythonpath
" [-- tcl --] {{{3
+if has("win32") || has("win95") || has("win64") || has("win16")
+ " apparently has("tcl") has been hanging vim on some windows systems with cygwin
+ let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
+else
+ let s:trytcl= 1
+endif
if s:trytcl
let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
if !filereadable(s:tclpath)
- for tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
- if filereadable(fnameescape(tclpath))
- let s:tclpath= fnameescape(tclpath)
+ for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
+ if filereadable(fnameescape(s:tclpath))
+ let s:tclpath= fnameescape(s:tclpath)
break
endif
endfor
@@ -706,13 +715,8 @@ if s:trytcl
if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath)
unlet! b:current_syntax
exe "syn include @vimTclScript ".s:tclpath
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 't'
- syn region vimTclRegion fold matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
- syn region vimTclRegion fold matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
- else
- syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
- syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
- endif
+ VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
+ VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
syn cluster vimFuncBodyList add=vimTclScript
else
syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
@@ -728,9 +732,9 @@ unlet s:trytcl
" [-- mzscheme --] {{{3
let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
if !filereadable(s:mzschemepath)
- for mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
- if filereadable(fnameescape(mzschemepath))
- let s:mzschemepath= fnameescape(mzschemepath)
+ for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
+ if filereadable(fnameescape(s:mzschemepath))
+ let s:mzschemepath= fnameescape(s:mzschemepath)
break
endif
endfor
@@ -740,13 +744,8 @@ if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
let iskKeep= &isk
exe "syn include @vimMzSchemeScript ".s:mzschemepath
let &isk= iskKeep
- if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'm'
- syn region vimMzSchemeRegion fold matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
- syn region vimMzSchemeRegion fold matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
- else
- syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
- syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
- endif
+ VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
+ VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
syn cluster vimFuncBodyList add=vimMzSchemeRegion
else
syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+
@@ -771,6 +770,7 @@ syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
" Highlighting Settings {{{2
" ====================
+
if !exists("g:vimsyn_noerror")
hi def link vimBehaveError vimError
hi def link vimCollClassErr vimError
@@ -791,6 +791,7 @@ endif
hi def link vimAbb vimCommand
hi def link vimAddress vimMark
+hi def link vimAugroupError vimError
hi def link vimAugroupKey vimCommand
hi def link vimAuHighlight vimHighlight
hi def link vimAutoCmdOpt vimOption
@@ -924,7 +925,6 @@ hi def link vimUserAttrbCmpltFunc Special
hi def link vimUserAttrbCmplt vimSpecial
hi def link vimUserAttrbKey vimOption
hi def link vimUserAttrb vimSpecial
-hi def link vimUserAttrbError Error
hi def link vimUserCmdError Error
hi def link vimUserCommand vimCommand
hi def link vimUserFunc Normal
@@ -936,6 +936,14 @@ let b:current_syntax = "vim"
" ---------------------------------------------------------------------
" Cleanup: {{{1
+delc VimFolda
+delc VimFoldf
+delc VimFoldl
+delc VimFoldm
+delc VimFoldp
+delc VimFoldP
+delc VimFoldr
+delc VimFoldt
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:ts=18 fdm=marker