diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-04-22 22:40:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-22 22:40:14 +0100 |
commit | 71badf9547e8f89571b9a095183671cbb333d528 (patch) | |
tree | 60d0393cb0236345eb4b5d26f98c8c9d030ce8b0 | |
parent | 80406c26188219f3773b2e9c49160caeeb386ee2 (diff) |
Update runtime files
63 files changed, 3695 insertions, 818 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0963685ae7..61c8606d7c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -29,17 +29,24 @@ runtime/colors/delek.vim @habamax @romainl @neutaaaaan runtime/colors/desert.vim @habamax @romainl @neutaaaaan runtime/colors/elflord.vim @habamax @romainl @neutaaaaan runtime/colors/evening.vim @habamax @romainl @neutaaaaan +runtime/colors/habamax.vim @habamax @romainl @neutaaaaan runtime/colors/industry.vim @habamax @romainl @neutaaaaan runtime/colors/koehler.vim @habamax @romainl @neutaaaaan +runtime/colors/lunaperche.vim @habamax @romainl @neutaaaaan runtime/colors/morning.vim @habamax @romainl @neutaaaaan runtime/colors/murphy.vim @habamax @romainl @neutaaaaan runtime/colors/pablo.vim @habamax @romainl @neutaaaaan runtime/colors/peachpuff.vim @habamax @romainl @neutaaaaan +runtime/colors/quiet.vim @habamax @romainl @neutaaaaan +runtime/colors/retrobox.vim @habamax @romainl @neutaaaaan runtime/colors/ron.vim @habamax @romainl @neutaaaaan runtime/colors/shine.vim @habamax @romainl @neutaaaaan runtime/colors/slate.vim @habamax @romainl @neutaaaaan +runtime/colors/sorbet.vim @habamax @romainl @neutaaaaan runtime/colors/tools @habamax @romainl @neutaaaaan runtime/colors/torte.vim @habamax @romainl @neutaaaaan +runtime/colors/wildcharm.vim @habamax @romainl @neutaaaaan +runtime/colors/zaibatsu.vim @habamax @romainl @neutaaaaan runtime/colors/zellner.vim @habamax @romainl @neutaaaaan runtime/compiler/checkstyle.vim @dkearns runtime/compiler/cm3.vim @dkearns @@ -215,6 +222,7 @@ runtime/ftplugin/wget2.vim @dkearns runtime/ftplugin/xml.vim @chrisbra runtime/ftplugin/xs.vim @petdance runtime/ftplugin/zsh.vim @chrisbra +runtime/import/dist/vimhighlight.vim @lacygoill runtime/indent/basic.vim @dkearns runtime/indent/bst.vim @tpope runtime/indent/cdl.vim @dkearns @@ -367,6 +375,7 @@ runtime/syntax/haml.vim @tpope runtime/syntax/hare.vim @rsaihe runtime/syntax/haskell.vim @coot runtime/syntax/hgcommit.vim @k-takata +runtime/syntax/hitest.vim @lacygoill runtime/syntax/hollywood.vim @sodero runtime/syntax/html.vim @dkearns runtime/syntax/i3config.vim @hiqua diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 4e0906d8b4..3d9d60a75b 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: Bram Moolenaar <Bram@vim.org> -# Last Change: 2022 Dec 14 +# Last Change: 2023 Apr 22 # These functions are moved here from runtime/filetype.vim to make startup # faster. diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index e95c633fcf..cefc3b241d 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: Bram Moolenaar <Bram@vim.org> -# Last Change: 2022 Nov 24 +# Last Change: 2023 Apr 17 export def DetectFiletype() var line1 = getline(1) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 29310aabd4..1372de4dfc 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Aug 16, 2021 -" Version: 171 +" Date: Mar 15, 2023 +" Version: 172 " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -43,7 +43,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v171" +let g:loaded_netrw = "v172" if !exists("s:NOTE") let s:NOTE = 0 let s:WARNING = 1 @@ -208,7 +208,6 @@ let g:netrw_localcopycmdopt = "" let g:netrw_localcopydircmdopt = "" let g:netrw_localmkdiropt = "" let g:netrw_localmovecmdopt = "" -let g:netrw_localrmdiropt = "" " --------------------------------------------------------------------- " Default values for netrw's global protocol variables {{{2 @@ -1186,6 +1185,11 @@ endfun " --------------------------------------------------------------------- " netrw#Lexplore: toggle Explorer window, keeping it on the left of the current tab {{{2 +" Uses g:netrw_chgwin : specifies the window where Lexplore files are to be opened +" t:netrw_lexposn : winsaveview() output (used on Lexplore window) +" t:netrw_lexbufnr: the buffer number of the Lexplore buffer (internal to this function) +" s:lexplore_win : window number of Lexplore window (serves to indicate which window is a Lexplore window) +" w:lexplore_buf : buffer number of Lexplore window (serves to indicate which window is a Lexplore window) fun! netrw#Lexplore(count,rightside,...) " call Dfunc("netrw#Lexplore(count=".a:count." rightside=".a:rightside.",...) a:0=".a:0." ft=".&ft) let curwin= winnr() @@ -1202,6 +1206,8 @@ fun! netrw#Lexplore(count,rightside,...) " call Decho("exe Explore ".fnameescape(a:1),'~'.expand("<slnum>")) exe "Explore ".fnameescape(a1) exe curwin."wincmd w" + let s:lexplore_win= curwin + let w:lexplore_buf= bufnr("%") if exists("t:netrw_lexposn") " call Decho("forgetting t:netrw_lexposn",'~'.expand("<slnum>")) unlet t:netrw_lexposn @@ -1276,7 +1282,7 @@ fun! netrw#Lexplore(count,rightside,...) let t:netrw_lexbufnr = bufnr("%") " done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore. " Since the intended use of :Lexplore is to have an always-present explorer window, the extra - " effort to mis-use :Lex is warranted. + " effort to prevent mis-use of :Lex is warranted. set bh=wipe " call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr) " call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a")) @@ -1680,7 +1686,7 @@ fun! s:NetrwOptionsSave(vt) endif let {a:vt}netrw_fokeep = &l:fo " formatoptions let {a:vt}netrw_gdkeep = &l:gd " gdefault - let {a:vt}netrw_gokeep = &l:go " guioptions + let {a:vt}netrw_gokeep = &go " guioptions let {a:vt}netrw_hidkeep = &l:hidden let {a:vt}netrw_imkeep = &l:im let {a:vt}netrw_iskkeep = &l:isk @@ -1751,8 +1757,9 @@ fun! s:NetrwOptionsSafe(islocal) if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif setl fo=nroql2 - " call s:NetrwSetSafeSetting("&go","begmr") - if &go =~ '\ca' | call s:NetrwSetSafeSetting("&go",substitute(&go,'\ca','','g')) | endif + if &go =~ 'a' | set go-=a | endif + if &go =~ 'A' | set go-=A | endif + if &go =~ 'P' | set go-=P | endif call s:NetrwSetSafeSetting("&l:hid",0) call s:NetrwSetSafeSetting("&l:im",0) setl isk+=@ isk+=* isk+=/ @@ -1791,11 +1798,13 @@ fun! s:NetrwOptionsRestore(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") " call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("<slnum>")) - if !isdirectory(expand('%')) + if filereadable(expand("%")) " call Decho("..doing filetype detect anyway") - filetype detect + filetype detect +" 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>")) + else + setl ft=netrw 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,'~'.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:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist") return @@ -1835,7 +1844,7 @@ fun! s:NetrwOptionsRestore(vt) " call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_fokeep" ,"&l:fo") call s:NetrwRestoreSetting(a:vt."netrw_gdkeep" ,"&l:gd") - call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&l:go") + call s:NetrwRestoreSetting(a:vt."netrw_gokeep" ,"&go") call s:NetrwRestoreSetting(a:vt."netrw_hidkeep" ,"&l:hidden") " call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines) call s:NetrwRestoreSetting(a:vt."netrw_imkeep" ,"&l:im") @@ -1906,11 +1915,9 @@ fun! s:NetrwOptionsRestore(vt) " were having their filetype detect-generated settings overwritten by " NetrwOptionRestore. if &ft != "netrw" - if !isdirectory(expand('%')) -" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("<slnum>")) - filetype detect -" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("<slnum>")) - endif +" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("<slnum>")) + filetype detect +" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("<slnum>")) endif " call Decho("(s:NetrwOptionsRestore) lines=".&lines) " 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>")) @@ -2985,13 +2992,19 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " rename buffer back to remote filename call s:NetrwBufRename(rfile) + " Jan 19, 2022: COMBAK -- bram problem with https://github.com/vim/vim/pull/9554.diff filetype " 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",'~'.expand("<slnum>")) - let iskkeep= &l:isk +" call Decho("detect filetype of local version of remote file<".rfile.">",'~'.expand("<slnum>")) +" call Decho("..did_filetype()=".did_filetype()) + setl ft= +" call Decho("..initial filetype<".&ft."> for buf#".bufnr()."<".bufname().">") + let iskkeep= &isk setl isk-=/ - let &l:isk= iskkeep + filetype detect +" call Decho("..local filetype<".&ft."> for buf#".bufnr()."<".bufname().">") + let &isk= iskkeep " call Dredir("ls!","NetrwGetFile (renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">)") let line1 = 1 let line2 = line("$") @@ -4272,7 +4285,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif " call Decho(" bufnum#".bufnum,'~'.expand("<slnum>")) - " hijack the current buffer + " highjack the current buffer " IF the buffer already has the desired name " AND it is empty let curbuf = bufname("%") @@ -4280,7 +4293,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) let curbuf = getcwd() endif " call Dredir("ls!","NetrwGetFile (renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">)") -" call Decho("deciding if netrw may hijack the current buffer#".bufnr("%")."<".curbuf.">",'~'.expand("<slnum>")) +" call Decho("deciding if netrw may highjack the current buffer#".bufnr("%")."<".curbuf.">",'~'.expand("<slnum>")) " call Decho("..dirname<".dirname."> IF dirname == bufname",'~'.expand("<slnum>")) " call Decho("..curbuf<".curbuf.">",'~'.expand("<slnum>")) " call Decho("..line($)=".line("$")." AND this is 1",'~'.expand("<slnum>")) @@ -4289,7 +4302,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Dret("s:NetrwGetBuffer 0<cleared buffer> : highjacking buffer#".bufnr("%")) return 0 else " DEBUG -" call Decho("..did NOT hijack buffer",'~'.expand("<slnum>")) +" call Decho("..did NOT highjack buffer",'~'.expand("<slnum>")) endif " Aug 14, 2021: was thinking about looking for a [No Name] buffer here and using it, but that might cause problems @@ -4325,19 +4338,25 @@ fun! s:NetrwGetBuffer(islocal,dirname) else " Re-use the buffer " call Decho("--re-use buffer#".bufnum." (bufnum#".bufnum.">=0 AND bufexists(".bufnum.")=".bufexists(bufnum)."!=0)",'~'.expand("<slnum>")) + " ignore all events 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,'~'.expand("<slnum>")) - exe "sil! NetrwKeepj noswapfile keepalt b ".bufnum + + if &ft == "netrw" +" call Decho("buffer type is netrw; not using keepalt with b ".bufnum) + exe "sil! NetrwKeepj noswapfile b ".bufnum +" call Dredir("ls!","one") else -" call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum,'~'.expand("<slnum>")) - exe "sil! NetrwKeepj noswapfile keepalt b ".bufnum +" call Decho("buffer type is not netrw; using keepalt with b ".bufnum) + call s:NetrwEditBuf(bufnum) +" call Dredir("ls!","two") endif " call Decho(" line($)=".line("$"),'~'.expand("<slnum>")) if bufname("%") == '.' call s:NetrwBufRename(getcwd()) endif + + " restore ei let &ei= eikeep if line("$") <= 1 && getline(1) == "" @@ -4988,7 +5007,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " the point where netrw actually edits the (local) file " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will - " no keepalt to support :e # to return to a directory listing + " use keepalt to support :e # to return to a directory listing if !&mod " if e the new file would fail due to &mod, then don't change any of the flags let dolockout= 1 @@ -4999,12 +5018,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " others like c-^ to return to the netrw buffer " Apr 30, 2020: used to have e! here. That can cause loss of a modified file, " so emit error E37 instead. - if exists("g:netrw_altfile") && g:netrw_altfile - exe "NetrwKeepj keepalt e ".fnameescape(dirname) - else - exe "NetrwKeepj e ".fnameescape(dirname) - endif -" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>")) + call s:NetrwEditFile("e","",dirname) +" call Decho("edit-a-file: after e ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>")) " COMBAK -- cuc cul related call s:NetrwCursor(1) if &hidden || &bufhidden == "hide" @@ -5345,8 +5360,8 @@ fun! netrw#BrowseX(fname,remote) " g:Netrw_corehandler is a List of function references (see :help Funcref) " call Decho("g:Netrw_corehandler is a List",'~'.expand("<slnum>")) for Fncref in g:Netrw_corehandler - if type(FncRef) == 2 - call FncRef(a:fname) + if type(Fncref) == 2 + call Fncref(a:fname) endif endfor endif @@ -5419,6 +5434,8 @@ fun! netrw#BrowseX(fname,remote) else let redir= &srr . "/dev/null" endif + else + let redir= "" endif " call Decho("set up redirection: redir{".redir."} srr{".&srr."}",'~'.expand("<slnum>")) @@ -5709,6 +5726,35 @@ fun! s:NetrwClearExplore() endfun " --------------------------------------------------------------------- +" s:NetrwEditBuf: decides whether or not to use keepalt to edit a buffer {{{2 +fun! s:NetrwEditBuf(bufnum) +" call Dfunc("s:NetrwEditBuf(fname<".a:bufnum.">)") + if exists("g:netrw_altfile") && g:netrw_altfile && &ft == "netrw" +" call Decho("exe sil! NetrwKeepj keepalt noswapfile b ".fnameescape(a:bufnum)) + exe "sil! NetrwKeepj keepalt noswapfile b ".fnameescape(a:bufnum) + else +" call Decho("exe sil! NetrwKeepj noswapfile b ".fnameescape(a:bufnum)) + exe "sil! NetrwKeepj noswapfile b ".fnameescape(a:bufnume) + endif +" call Dret("s:NetrwEditBuf") +endfun + +" --------------------------------------------------------------------- +" s:NetrwEditFile: decides whether or not to use keepalt to edit a file {{{2 +" NetrwKeepj [keepalt] <OPT> <CMD> <FILENAME> +fun! s:NetrwEditFile(cmd,opt,fname) +" call Dfunc("s:NetrwEditFile(cmd<".a:cmd.">,opt<".a:opt.">,fname<".a:fname.">) ft<".&ft.">") + if exists("g:netrw_altfile") && g:netrw_altfile && &ft == "netrw" +" call Decho("exe NetrwKeepj keepalt ".a:opt." ".a:cmd." ".fnameescape(a:fname)) + exe "NetrwKeepj keepalt ".a:opt." ".a:cmd." ".fnameescape(a:fname) + else +" call Decho("exe NetrwKeepj ".a:opt." ".a:cmd." ".fnameescape(a:fname)) + exe "NetrwKeepj ".a:opt." ".a:cmd." ".fnameescape(a:fname) + endif +" call Dret("s:NetrwEditFile") +endfun + +" --------------------------------------------------------------------- " s:NetrwExploreListUniq: {{{2 fun! s:NetrwExploreListUniq(explist) " call Dfunc("s:NetrwExploreListUniq(explist<".string(a:explist).">)") @@ -7814,8 +7860,16 @@ fun! s:NetrwMarkFileMove(islocal) " call Decho("movecmd<".movecmd."> (#3 linux or cygwin)",'~'.expand("<slnum>")) endif for fname in s:netrwmarkfilelist_{bufnr("%")} + if g:netrw_keepdir + " Jul 19, 2022: fixing file move when g:netrw_keepdir is 1 + let fname= b:netrw_curdir."/".fname + endif if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16")) let fname= substitute(fname,'/','\\','g') + if g:netrw_keepdir + " Jul 19, 2022: fixing file move when g:netrw_keepdir is 1 + let fname= b:netrw_curdir."\\".fname + endif endif " call Decho("system(".movecmd." ".s:ShellEscape(fname)." ".tgt.")",'~'.expand("<slnum>")) let ret= system(movecmd.g:netrw_localmovecmdopt." ".s:ShellEscape(fname)." ".tgt) @@ -8573,21 +8627,28 @@ endfun " choice = 2 : didn't save modified file, opened window " choice = 3 : cancel open fun! s:NetrwPrevWinOpen(islocal) -" call Dfunc("s:NetrwPrevWinOpen(islocal=".a:islocal.")") +" call Dfunc("s:NetrwPrevWinOpen(islocal=".a:islocal.") win#".winnr()) let ykeep= @@ " grab a copy of the b:netrw_curdir to pass it along to newly split windows let curdir = b:netrw_curdir +" call Decho("COMBAK#1: mod=".&mod." win#".winnr()) " get last window number and the word currently under the cursor let origwin = winnr() let lastwinnr = winnr("$") - let curword = s:NetrwGetWord() - let choice = 0 - let s:prevwinopen= 1 " lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it +" call Decho("origwin#".origwin." lastwinnr#".lastwinnr) +" call Decho("COMBAK#2: mod=".&mod." win#".winnr()) + let curword = s:NetrwGetWord() + let choice = 0 + let s:prevwinopen= 1 " lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it (s:NetrwTreeDir() will unlet s:prevwinopen) +" call Decho("COMBAK#3: mod=".&mod." win#".winnr()) let s:treedir = s:NetrwTreeDir(a:islocal) +" call Decho("COMBAK#4: mod=".&mod." win#".winnr()) let curdir = s:treedir +" call Decho("COMBAK#5: mod=".&mod." win#".winnr()) " call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("<slnum>")) +" call Decho("COMBAK#6: mod=".&mod." win#".winnr()) let didsplit = 0 if lastwinnr == 1 @@ -8610,11 +8671,26 @@ fun! s:NetrwPrevWinOpen(islocal) " call Decho("did split",'~'.expand("<slnum>")) else +" call Decho("COMBAK#7: mod=".&mod." win#".winnr()) NetrwKeepj call s:SaveBufVars() +" call Decho("COMBAK#8: mod=".&mod." win#".winnr()) let eikeep= &ei +" call Decho("COMBAK#9: mod=".&mod." win#".winnr()) setl ei=all +" call Decho("COMBAK#10: mod=".&mod." win#".winnr()) wincmd p +" call Decho("COMBAK#11: mod=".&mod) " call Decho("wincmd p (now in win#".winnr().") curdir<".curdir.">",'~'.expand("<slnum>")) +" call Decho("COMBAK#12: mod=".&mod) + + if exists("s:lexplore_win") && s:lexplore_win == winnr() + " whoops -- user trying to open file in the Lexplore window. + " Use Lexplore's opening-file window instead. +" call Decho("whoops -- user trying to open file in Lexplore Window. Use win#".g:netrw_chgwin." instead") +" exe g:netrw_chgwin."wincmd w" + wincmd p + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + endif " prevwinnr: the window number of the "prev" window " prevbufnr: the buffer number of the buffer in the "prev" window @@ -8624,8 +8700,10 @@ fun! s:NetrwPrevWinOpen(islocal) let prevbufname = bufname("%") let prevmod = &mod let bnrcnt = 0 +" call Decho("COMBAK#13: mod=".&mod." win#".winnr()) NetrwKeepj call s:RestoreBufVars() " call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr,'~'.expand("<slnum>")) +" call Decho("COMBAK#14: mod=".&mod." win#".winnr()) " 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 @@ -8635,6 +8713,7 @@ fun! s:NetrwPrevWinOpen(islocal) windo if winbufnr(0) == prevbufnr | let bnrcnt=bnrcnt+1 | endif " call Decho("prevbufnr=".prevbufnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr()=".winnr()." prevwinnr#".prevwinnr,'~'.expand("<slnum>")) exe prevwinnr."wincmd w" +" call Decho("COMBAK#15: mod=".&mod." win#".winnr()) if bnrcnt == 1 && &hidden == 0 " only one copy of the modified buffer in a window, and @@ -8642,6 +8721,7 @@ fun! s:NetrwPrevWinOpen(islocal) let choice = confirm("Save modified buffer<".prevbufname."> first?","&Yes\n&No\n&Cancel") " call Decho("prevbufname<".prevbufname."> choice=".choice." current-winnr#".winnr(),'~'.expand("<slnum>")) let &ei= eikeep +" call Decho("COMBAK#16: mod=".&mod." win#".winnr()) if choice == 1 " Yes -- write file & then browse @@ -8674,6 +8754,7 @@ fun! s:NetrwPrevWinOpen(islocal) endif let &ei= eikeep endif +" call Decho("COMBAK#17: mod=".&mod." win#".winnr()) " restore b:netrw_curdir (window split/enew may have lost it) let b:netrw_curdir= curdir @@ -9361,19 +9442,23 @@ fun! s:NetrwTreeDir(islocal) if exists("s:prevwinopen") unlet s:prevwinopen endif +" call Decho("COMBAK#18 : mod=".&mod." win#".winnr()) 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.">",'~'.expand("<slnum>")) +" call Decho("COMBAK#19 : mod=".&mod." win#".winnr()) let s:treecurpos= winsaveview() " call Decho("saving posn to s:treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>")) +" call Decho("COMBAK#20 : mod=".&mod." win#".winnr()) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST " call Decho("w:netrw_liststyle is TREELIST:",'~'.expand("<slnum>")) " call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">",'~'.expand("<slnum>")) +" call Decho("COMBAK#21 : mod=".&mod." win#".winnr()) " extract tree directory if on a line specifying a subdirectory (ie. ends with "/") let curline= substitute(getline('.'),"\t -->.*$",'','') @@ -9389,6 +9474,7 @@ fun! s:NetrwTreeDir(islocal) " call Decho("do not extract tree subdirectory from current line and set treedir to empty",'~'.expand("<slnum>")) let treedir= "" endif +" call Decho("COMBAK#22 : mod=".&mod." win#".winnr()) " detect user attempting to close treeroot " call Decho("check if user is attempting to close treeroot",'~'.expand("<slnum>")) @@ -9404,10 +9490,12 @@ fun! s:NetrwTreeDir(islocal) " else " Decho " call Decho(".user not attempting to close treeroot",'~'.expand("<slnum>")) endif +" call Decho("COMBAK#23 : mod=".&mod." win#".winnr()) " call Decho("islocal=".a:islocal." curline<".curline.">",'~'.expand("<slnum>")) let potentialdir= s:NetrwFile(substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)@$','\1','')) " call Decho("potentialdir<".potentialdir."& |