• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修訂75ff30a7818963b44ea95e7849f0790ad415f4d2 (tree)
時間2020-09-20 02:00:04
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

Update runtime files.

Commit: https://github.com/vim/vim/commit/1d59aa1fdfb191d9872ff87eb94652acd374b293
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 19 18:50:13 2020 +0200

Update runtime files.

Change Summary

差異

diff -r 701d200ab63c -r 75ff30a78189 .github/CODEOWNERS
--- a/.github/CODEOWNERS Sat Sep 19 18:30:04 2020 +0200
+++ b/.github/CODEOWNERS Sat Sep 19 19:00:04 2020 +0200
@@ -3,22 +3,25 @@
33 # You can use github users with @user or email addresses
44
55 # These owners will be the default owners for everything in the repo.
6-* @brammool
6+#* @brammool
77
88 # Order is important. The last matching pattern has the most precedence.
99 # So if a pull request only touches javascript files, only these owners
1010 # will be requested to review.
1111
12-src/libvterm/* @leonerd
12+src/iscygpty.* @k-takata
13+src/libvterm/ @leonerd
1314
1415 runtime/autoload/getscript.vim @cecamp
1516 runtime/autoload/netrw.vim @cecamp
1617 runtime/autoload/netrwFileHandlers.vim @cecamp
1718 runtime/autoload/netrwSettings.vim @cecamp
19+runtime/autoload/rubycomplete.vim @segfault @dkearns
1820 runtime/autoload/tar.vim @cecamp
1921 runtime/autoload/vimball.vim @cecamp
2022 runtime/autoload/zip.vim @cecamp
2123 runtime/compiler/checkstyle.vim @dkearns
24+runtime/compiler/cucumber.vim @tpope
2225 runtime/compiler/dart.vim @dkearns
2326 runtime/compiler/dart2js.vim @dkearns
2427 runtime/compiler/dart2native.vim @dkearns
@@ -29,15 +32,20 @@
2932 runtime/compiler/eruby.vim @dkearns
3033 runtime/compiler/gawk.vim @dkearns
3134 runtime/compiler/gjs.vim @dkearns
35+runtime/compiler/haml.vim @tpope
3236 runtime/compiler/javac.vim @dkearns
3337 runtime/compiler/jest.vim @dkearns
3438 runtime/compiler/jjs.vim @dkearns
3539 runtime/compiler/jshint.vim @dkearns
3640 runtime/compiler/jsonlint.vim @dkearns
3741 runtime/compiler/php.vim @dkearns
42+runtime/compiler/rake.vim @tpope @dkearns
3843 runtime/compiler/rhino.vim @dkearns
44+runtime/compiler/rspec.vim @tpope @dkearns
3945 runtime/compiler/rubocop.vim @dkearns
46+runtime/compiler/ruby.vim @tpope @dkearns
4047 runtime/compiler/rubyunit.vim @dkearns
48+runtime/compiler/sass.vim @tpope
4149 runtime/compiler/se.vim @dkearns
4250 runtime/compiler/stylelint.vim @dkearns
4351 runtime/compiler/tcl.vim @dkearns
@@ -53,40 +61,92 @@
5361 runtime/doc/pi_tar.txt @cecamp
5462 runtime/doc/pi_vimball.txt @cecamp
5563 runtime/doc/pi_zip.txt @cecamp
64+runtime/ftplugin/bst.vim @tpope
5665 runtime/ftplugin/css.vim @dkearns
66+runtime/ftplugin/cucumber.vim @tpope
5767 runtime/ftplugin/eiffel.vim @dkearns
68+runtime/ftplugin/eruby.vim @tpope @dkearns
69+runtime/ftplugin/git.vim @tpope
70+runtime/ftplugin/gitcommit.vim @tpope
71+runtime/ftplugin/gitconfig.vim @tpope
72+runtime/ftplugin/gitrebase.vim @tpope
73+runtime/ftplugin/gitsendemail.vim @tpope
74+runtime/ftplugin/haml.vim @tpope
75+runtime/ftplugin/hgcommit.vim @k-takata
5876 runtime/ftplugin/javascript.vim @dkearns
5977 runtime/ftplugin/javascriptreact.vim @dkearns
78+runtime/ftplugin/liquid.vim @tpope
79+runtime/ftplugin/markdown.vim @tpope
80+runtime/ftplugin/matlab.vim @cecamp
81+runtime/ftplugin/nsis.vim @k-takata
82+runtime/ftplugin/pdf.vim @tpope
83+runtime/ftplugin/ruby.vim @tpope @dkearns
84+runtime/ftplugin/sass.vim @tpope
85+runtime/ftplugin/scss.vim @tpope
86+runtime/ftplugin/tmux.vim @ericpruitt
6087 runtime/ftplugin/typescript.vim @dkearns
6188 runtime/ftplugin/typescriptreact.vim @dkearns
62-runtime/plugin/amiga.vim @cecamp
63-runtime/plugin/csh.vim @cecamp
64-runtime/plugin/dcl.vim @cecamp
65-runtime/plugin/exports.vim @cecamp
89+runtime/indent/bst.vim @tpope
90+runtime/indent/cucumber.vim @tpope
91+runtime/indent/dosbatch.vim @k-takata
92+runtime/indent/eruby.vim @tpope @dkearns
93+runtime/indent/gitconfig.vim @tpope
94+runtime/indent/haml.vim @tpope
95+runtime/indent/liquid.vim @tpope
96+runtime/indent/nsis.vim @k-takata
97+runtime/indent/ruby.vim @AndrewRadev @dkearns
98+runtime/indent/sass.vim @tpope
99+runtime/indent/scss.vim @tpope
100+runtime/indent/teraterm.vim @k-takata
66101 runtime/plugin/getscriptPlugin.vim @cecamp
67-runtime/plugin/lex.vim @cecamp
68-runtime/plugin/lisp.vim @cecamp
69102 runtime/plugin/logiPat.vim @cecamp
70-runtime/plugin/maple.vim @cecamp
71-runtime/plugin/netrw.vim @cecamp
72103 runtime/plugin/netrwPlugin.vim @cecamp
73-runtime/plugin/rpcgen.vim @cecamp
74-runtime/plugin/sh.vim @cecamp
75-runtime/plugin/sm.vim @cecamp
76-runtime/plugin/tags.vim @cecamp
77104 runtime/plugin/tarPlugin.vim @cecamp
78-runtime/plugin/tex.vim @cecamp
79-runtime/plugin/vim.vim @cecamp
80105 runtime/plugin/vimballPlugin.vim @cecamp
81-runtime/plugin/wlmfilt.vim @cecamp
82-runtime/plugin/xmath.vim @cecamp
83-runtime/plugin/xxd.vim @cecamp
84-runtime/plugin/yacc.vim @cecamp
85106 runtime/plugin/zipPlugin.vim @cecamp
107+runtime/syntax/amiga.vim @cecamp
108+runtime/syntax/bst.vim @tpope
109+runtime/syntax/csh.vim @cecamp
110+runtime/syntax/cucumber.vim @tpope
111+runtime/syntax/dcl.vim @cecamp
112+runtime/syntax/elmfilt.vim @cecamp
113+runtime/syntax/eruby.vim @tpope @dkearns
114+runtime/syntax/exports.vim @cecamp
115+runtime/syntax/git.vim @tpope
116+runtime/syntax/gitcommit.vim @tpope
117+runtime/syntax/gitconfig.vim @tpope
118+runtime/syntax/gitrebase.vim @tpope
119+runtime/syntax/haml.vim @tpope
120+runtime/syntax/hgcommit.vim @k-takata
121+runtime/syntax/lex.vim @cecamp
122+runtime/syntax/liquid.vim @tpope
123+runtime/syntax/lisp.vim @cecamp
86124 runtime/syntax/lynx.vim @dkearns
87125 runtime/syntax/mailcap.vim @dkearns
126+runtime/syntax/make.vim @rohieb
127+runtime/syntax/make.vim @rohieb
128+runtime/syntax/maple.vim @cecamp
129+runtime/syntax/markdown.vim @tpope
130+runtime/syntax/netrw.vim @cecamp
131+runtime/syntax/nsis.vim @k-takata
132+runtime/syntax/pdf.vim @tpope
133+runtime/syntax/php.vim @TysonAndre
88134 runtime/syntax/privoxy.vim @dkearns
135+runtime/syntax/rpcgen.vim @cecamp
89136 runtime/syntax/ruby.vim @dkearns
137+runtime/syntax/sass.vim @tpope
138+runtime/syntax/scss.vim @tpope
139+runtime/syntax/sh.vim @cecamp
140+runtime/syntax/sm.vim @cecamp
141+runtime/syntax/tags.vim @cecamp
142+runtime/syntax/teraterm.vim @k-takata
143+runtime/syntax/tex.vim @cecamp
90144 runtime/syntax/tidy.vim @dkearns
145+runtime/syntax/tmux.vim @ericpruitt
146+runtime/syntax/vim.vim @cecamp
91147 runtime/syntax/wget.vim @dkearns
92148 runtime/syntax/xbl.vim @dkearns
149+runtime/syntax/xmath.vim @cecamp
150+runtime/syntax/xslt.vim @Boobies
151+runtime/syntax/xxd.vim @cecamp
152+runtime/syntax/yacc.vim @cecamp
diff -r 701d200ab63c -r 75ff30a78189 nsis/lang/italian.nsi
--- a/nsis/lang/italian.nsi Sat Sep 19 18:30:04 2020 +0200
+++ b/nsis/lang/italian.nsi Sat Sep 19 19:00:04 2020 +0200
@@ -58,10 +58,10 @@
5858 "Versione console di Vim (vim.exe)."
5959
6060 LangString str_section_batch ${LANG_ITALIAN} \
61- "Crea file di invocazione (MS-DOS) .bat"
61+ "Crea file .bat"
6262 LangString str_desc_batch ${LANG_ITALIAN} \
63- "Crea file di invocazione .bat per varianti di Vim nella directory \
64- di Windows, per utilizzo da linea di comando (MS-DOS)."
63+ "Crea file .bat per varianti di Vim nella directory \
64+ di Windows, per utilizzo da riga di comando."
6565
6666 LangString str_group_icons ${LANG_ITALIAN} \
6767 "Crea icone per Vim"
diff -r 701d200ab63c -r 75ff30a78189 runtime/autoload/netrw.vim
--- a/runtime/autoload/netrw.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/autoload/netrw.vim Sat Sep 19 19:00:04 2020 +0200
@@ -1,7 +1,7 @@
11 " netrw.vim: Handles file transfer and remote directory listing across
22 " AUTOLOAD SECTION
3-" Date: Jan 07, 2020
4-" Version: 168
3+" Date: Sep 18, 2020
4+" Version: 170
55 " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
66 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
77 " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@@ -43,7 +43,7 @@
4343 endfor
4444 endif
4545
46-let g:loaded_netrw = "v168"
46+let g:loaded_netrw = "v170"
4747 if !exists("s:NOTE")
4848 let s:NOTE = 0
4949 let s:WARNING = 1
@@ -86,7 +86,16 @@
8686 endif
8787 " call Decho("level=".level,'~'.expand("<slnum>"))
8888
89- if g:netrw_use_errorwindow
89+ if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486")))
90+ " use popup window
91+ if type(a:msg) == 3
92+ let msg = [level]+a:msg
93+ else
94+ let msg= level.a:msg
95+ endif
96+ let s:popuperr_id = popup_beval(msg,{})
97+ let s:popuperr_text= ""
98+ elseif g:netrw_use_errorwindow
9099 " (default) netrw creates a one-line window to show error/warning
91100 " messages (reliably displayed)
92101
@@ -203,7 +212,11 @@
203212
204213 " ---------------------------------------------------------------------
205214 " Default values for netrw's global protocol variables {{{2
206-call s:NetrwInit("g:netrw_use_errorwindow",1)
215+if (v:version > 802 || (v:version == 802 && has("patch486"))) && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") && has("mouse")
216+ call s:NetrwInit("g:netrw_use_errorwindow",2)
217+else
218+ call s:NetrwInit("g:netrw_use_errorwindow",1)
219+endif
207220
208221 if !exists("g:netrw_dav_cmd")
209222 if executable("cadaver")
@@ -559,6 +572,7 @@
559572 if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
560573 " call Decho("installed beval events",'~'.expand("<slnum>"))
561574 let &l:bexpr = "netrw#BalloonHelp()"
575+" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr())
562576 au FileType netrw setl beval
563577 au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif
564578 au VimEnter * let s:initbeval= &beval
@@ -591,7 +605,18 @@
591605 if &ft != "netrw"
592606 return ""
593607 endif
594- if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
608+ if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {}
609+ " popup error window is still showing
610+ " s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg()
611+ if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text
612+ " text under mouse hasn't changed; only close window when it changes
613+ call popup_close(s:popuperr_id)
614+ unlet s:popuperr_text
615+ else
616+ let s:popuperr_text= v:beval_text
617+ endif
618+ let mesg= ""
619+ elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
595620 let mesg= ""
596621 elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing"
597622 let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file"
@@ -1247,6 +1272,10 @@
12471272 setlocal winfixwidth
12481273 let g:netrw_altv = keep_altv
12491274 let t:netrw_lexbufnr = bufnr("%")
1275+ " done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore.
1276+ " Since the intended use of :Lexplore is to have an always-present explorer window, the extra
1277+ " effort to mis-use :Lex is warranted.
1278+ set bh=wipe
12501279 " call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr)
12511280 " call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a"))
12521281 if exists("t:netrw_lexposn")
@@ -1908,7 +1937,7 @@
19081937 if type(a:setting) == 0
19091938 exe "let ".a:setting."= ".keepvarval
19101939 elseif type(a:setting) == 1
1911- exe "let ".a:setting."= '".keepvarval."'"
1940+ exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'"
19121941 else
19131942 call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105)
19141943 endif
@@ -3640,6 +3669,8 @@
36403669 let savefile= s:NetrwHome()."/.netrwhist"
36413670 " call Decho("savefile<".savefile.">",'~'.expand("<slnum>"))
36423671 1split
3672+
3673+ " setting up a new buffer which will become .netrwhist
36433674 call s:NetrwEnew()
36443675 " call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("<slnum>"))
36453676 if g:netrw_use_noswf
@@ -4722,7 +4753,7 @@
47224753 " "new directory name" is actually a file,
47234754 " NetrwBrowseChgDir() edits the file.
47244755 fun! s:NetrwBrowseChgDir(islocal,newdir,...)
4725-" 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 : "").">")
4756+" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
47264757 " call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
47274758
47284759 let ykeep= @@
@@ -4751,13 +4782,14 @@
47514782 let newdir = a:newdir
47524783 let dolockout = 0
47534784 let dorestore = 1
4785+" call Decho("win#".winnr(),'~'.expand("<slnum>"))
47544786 " call Decho("dirname<".dirname.">",'~'.expand("<slnum>"))
47554787 " call Decho("newdir<".newdir.">",'~'.expand("<slnum>"))
47564788
47574789 " ignore <cr>s when done in the banner
47584790 " call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("<slnum>"))
47594791 if g:netrw_banner
4760-" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
4792+" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
47614793 if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
47624794 if getline(".") =~# 'Quick Help'
47634795 " 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>"))
@@ -4794,7 +4826,7 @@
47944826 " ------------------------------
47954827 " NetrwBrowseChgDir: edit a file {{{3
47964828 " ------------------------------
4797-" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
4829+" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
47984830
47994831 " save position for benefit of Rexplore
48004832 let s:rexposn_{bufnr("%")}= winsaveview()
@@ -4829,7 +4861,7 @@
48294861 NetrwKeepj call s:NetrwOptionsRestore("s:")
48304862 let curdir= b:netrw_curdir
48314863 if !exists("s:didsplit")
4832-" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("<slnum>"))
4864+" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("<slnum>"))
48334865 if type(g:netrw_browse_split) == 3
48344866 " open file in server
48354867 " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
@@ -4837,22 +4869,27 @@
48374869 call s:NetrwServerEdit(a:islocal,dirname)
48384870 " call Dret("s:NetrwBrowseChgDir")
48394871 return
4872+
48404873 elseif g:netrw_browse_split == 1
48414874 " horizontally splitting the window first
48424875 " call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("<slnum>"))
4843- keepalt new
4876+ let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
4877+ exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
48444878 if !&ea
48454879 keepalt wincmd _
48464880 endif
48474881 call s:SetRexDir(a:islocal,curdir)
4882+
48484883 elseif g:netrw_browse_split == 2
48494884 " vertically splitting the window first
48504885 " call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("<slnum>"))
4851- keepalt rightb vert new
4886+ let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
4887+ exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
48524888 if !&ea
48534889 keepalt wincmd |
48544890 endif
48554891 call s:SetRexDir(a:islocal,curdir)
4892+
48564893 elseif g:netrw_browse_split == 3
48574894 " open file in new tab
48584895 " call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("<slnum>"))
@@ -4861,6 +4898,7 @@
48614898 let b:netrw_curdir= getcwd()
48624899 endif
48634900 call s:SetRexDir(a:islocal,curdir)
4901+
48644902 elseif g:netrw_browse_split == 4
48654903 " act like "P" (ie. open previous window)
48664904 " call Decho("edit-a-file: use previous window for edit",'~'.expand("<slnum>"))
@@ -4870,13 +4908,14 @@
48704908 return
48714909 endif
48724910 call s:SetRexDir(a:islocal,curdir)
4911+
48734912 else
48744913 " handling a file, didn't split, so remove menu
48754914 " call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("<slnum>"))
48764915 call s:NetrwMenu(0)
48774916 " optional change to window
48784917 if g:netrw_chgwin >= 1
4879-" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("<slnum>"))
4918+" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("<slnum>"))
48804919 if winnr("$")+1 == g:netrw_chgwin
48814920 " if g:netrw_chgwin is set to one more than the last window, then
48824921 " vertically split the last window to make that window available.
@@ -4889,19 +4928,26 @@
48894928 endif
48904929 call s:SetRexDir(a:islocal,curdir)
48914930 endif
4931+
48924932 endif
48934933
48944934 " the point where netrw actually edits the (local) file
48954935 " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will
48964936 " no keepalt to support :e # to return to a directory listing
4937+ if !&mod
4938+ " if e the new file would fail due to &mod, then don't change any of the flags
4939+ let dolockout= 1
4940+ endif
48974941 if a:islocal
48984942 " call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("<slnum>"))
48994943 " some like c-^ to return to the last edited file
49004944 " others like c-^ to return to the netrw buffer
4945+ " Apr 30, 2020: used to have e! here. That can cause loss of a modified file,
4946+ " so emit error E37 instead.
49014947 if exists("g:netrw_altfile") && g:netrw_altfile
4902- exe "NetrwKeepj keepalt e! ".fnameescape(dirname)
4948+ exe "NetrwKeepj keepalt e ".fnameescape(dirname)
49034949 else
4904- exe "NetrwKeepj e! ".fnameescape(dirname)
4950+ exe "NetrwKeepj e ".fnameescape(dirname)
49054951 endif
49064952 " call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
49074953 call s:NetrwCursor()
@@ -4912,7 +4958,6 @@
49124958 else
49134959 " call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("<slnum>"))
49144960 endif
4915- let dolockout= 1
49164961
49174962 " handle g:Netrw_funcref -- call external-to-netrw functions
49184963 " This code will handle g:Netrw_funcref as an individual function reference
@@ -5376,16 +5421,6 @@
53765421 endif
53775422 let ret= v:shell_error
53785423
5379- elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
5380-" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
5381- call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
5382- let ret= v:shell_error
5383-
5384- elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
5385-" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
5386- call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir)
5387- let ret= v:shell_error
5388-
53895424 elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril")
53905425 " call Decho("(netrw#BrowseX) unix and atril",'~'.expand("<slnum>"))
53915426 if a:fname =~ '^https\=://'
@@ -5400,9 +5435,19 @@
54005435 endif
54015436 let ret= v:shell_error
54025437
5438+ elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
5439+" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
5440+ call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
5441+ let ret= v:shell_error
5442+
5443+ elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
5444+" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
5445+ call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&')
5446+ let ret= v:shell_error
5447+
54035448 elseif has("unix") && executable("xdg-open")
54045449 " call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("<slnum>"))
5405- call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir)
5450+ call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&')
54065451 let ret= v:shell_error
54075452
54085453 elseif has("macunix") && executable("open")
@@ -6107,10 +6152,10 @@
61076152 " Duplicate characters don't matter.
61086153 " Remove all such characters from the '/~@#...890' string.
61096154 " Use the first character left as a separator character.
6110-" call Decho("find a character not in the hide string to use as a separator")
6155+" call Decho("find a character not in the hide string to use as a separator",'~'.expand("<slnum>"))
61116156 let listhide= g:netrw_list_hide
61126157 let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
6113-" call Decho("sep=".sep," (sep not in hide string)'~'.expand("<slnum>"))
6158+" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("<slnum>"))
61146159
61156160 while listhide != ""
61166161 if listhide =~ ','
@@ -6120,7 +6165,7 @@
61206165 let hide = listhide
61216166 let listhide = ""
61226167 endif
6123-" call Decho("..extracted from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
6168+" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
61246169 if g:netrw_sort_by =~ '^[ts]'
61256170 if hide =~ '^\^'
61266171 " call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("<slnum>"))
@@ -6132,7 +6177,7 @@
61326177 endif
61336178
61346179 " Prune the list by hiding any files which match
6135-" call Decho("..prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">")
6180+" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">")
61366181 if g:netrw_hide == 1
61376182 " call Decho("..hiding<".hide.">",'~'.expand("<slnum>"))
61386183 exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
@@ -9215,6 +9260,7 @@
92159260 " (full path directory with trailing slash returned)
92169261 fun! s:NetrwTreeDir(islocal)
92179262 " call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
9263+" call Decho("Determine tree directory given current cursor position")
92189264 " call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("<slnum>"))
92199265 " call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
92209266 " call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("<slnum>"))
@@ -9320,7 +9366,6 @@
93209366 call setline(line("$")+1,a:depth.shortdir.'/')
93219367 endif
93229368 " call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("<slnum>"))
9323-
93249369 " append a / to dir if its missing one
93259370 let dir= a:dir
93269371
@@ -9334,7 +9379,7 @@
93349379 let listhide= split(g:netrw_list_hide,',')
93359380 " call Decho("listhide=".string(listhide))
93369381 for pat in listhide
9337- call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"')
9382+ call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"')
93389383 endfor
93399384
93409385 elseif g:netrw_hide == 2
@@ -9472,6 +9517,7 @@
94729517 " 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>"))
94739518
94749519 " display from treetop on down
9520+" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">")
94759521 NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
94769522 " call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("<slnum>"))
94779523
@@ -9742,7 +9788,7 @@
97429788
97439789 " Hiding... -or- Showing... {{{3
97449790 if g:netrw_banner
9745-" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
9791+" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
97469792 if g:netrw_list_hide != "" && g:netrw_hide
97479793 if g:netrw_hide == 1
97489794 NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide
@@ -9795,7 +9841,7 @@
97959841 " 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>"))
97969842
97979843 if !g:netrw_banner || line("$") >= w:netrw_bannercnt
9798-" call Decho("manipulate directory listing (hide)",'~'.expand("<slnum>"))
9844+" call Decho("manipulate directory listing (support hide)",'~'.expand("<slnum>"))
97999845 " call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
98009846 if g:netrw_hide && g:netrw_list_hide != ""
98019847 NetrwKeepj call s:NetrwListHide()
@@ -11808,7 +11854,7 @@
1180811854 " ---------------------------------------------------------------------
1180911855 " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
1181011856 fun! s:NetrwEnew(...)
11811-" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
11857+" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
1181211858 " call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
1181311859
1181411860 " grab a function-local-variable copy of buffer variables
@@ -11875,6 +11921,9 @@
1187511921 endif
1187611922 endif
1187711923 endif
11924+ if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
11925+ let &l:bexpr = "netrw#BalloonHelp()"
11926+ endif
1187811927
1187911928 " call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$"))
1188011929 endfun
@@ -11934,6 +11983,7 @@
1193411983 " -1=failed
1193511984 fun! s:NetrwLcd(newdir)
1193611985 " call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)")
11986+" call Decho("changing local directory",'~'.expand("<slnum>"))
1193711987
1193811988 let err472= 0
1193911989 try
@@ -11969,6 +12019,8 @@
1196912019 return -1
1197012020 endif
1197112021
12022+" call Decho("getcwd <".getcwd().">")
12023+" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
1197212024 " call Dret("s:NetrwLcd 0")
1197312025 return 0
1197412026 endfun
diff -r 701d200ab63c -r 75ff30a78189 runtime/autoload/netrwFileHandlers.vim
--- a/runtime/autoload/netrwFileHandlers.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/autoload/netrwFileHandlers.vim Sat Sep 19 19:00:04 2020 +0200
@@ -1,8 +1,8 @@
11 " netrwFileHandlers: contains various extension-based file handlers for
22 " netrw's browsers' x command ("eXecute launcher")
33 " Author: Charles E. Campbell
4-" Date: May 03, 2013
5-" Version: 11b ASTRO-ONLY
4+" Date: Sep 18, 2020
5+" Version: 11
66 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
77 " Permission is hereby granted to use and distribute this code,
88 " with or without modifications, provided that this copyright
@@ -20,7 +20,7 @@
2020 if exists("g:loaded_netrwFileHandlers") || &cp
2121 finish
2222 endif
23-let g:loaded_netrwFileHandlers= "v11b"
23+let g:loaded_netrwFileHandlers= "v11"
2424 if v:version < 702
2525 echohl WarningMsg
2626 echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/cmdline.txt
--- a/runtime/doc/cmdline.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/cmdline.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*cmdline.txt* For Vim version 8.2. Last change: 2020 Aug 09
1+*cmdline.txt* For Vim version 8.2. Last change: 2020 Sep 14
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -797,7 +797,7 @@
797797 <
798798
799799 Visual Mode and Range *v_:*
800-
800+ *:star-visual-range*
801801 {Visual}: Starts a command-line with the Visual selected lines as a
802802 range. The code `:'<,'>` is used for this range, which makes
803803 it possible to select a similar line from the command-line
@@ -873,34 +873,37 @@
873873 \\# \#
874874 Also see |`=|.
875875
876- *:<cword>* *<cword>* *:<cWORD>* *<cWORD>*
877- *:<cexpr>* *<cexpr>* *:<cfile>* *<cfile>*
878- *:<afile>* *<afile>* *:<abuf>* *<abuf>*
879- *:<amatch>* *<amatch>* *:<stack>* *<stack>*
880- *:<sfile>* *<sfile>* *:<slnum>* *<slnum>*
881- *:<sflnum>* *<sflnum>* *E499* *E500*
876+ *E499* *E500*
882877 Note: these are typed literally, they are not special keys!
878+ *:<cword>* *<cword>*
883879 <cword> is replaced with the word under the cursor (like |star|)
880+ *:<cWORD>* *<cWORD>*
884881 <cWORD> is replaced with the WORD under the cursor (see |WORD|)
882+ *:<cexpr>* *<cexpr>*
885883 <cexpr> is replaced with the word under the cursor, including more
886884 to form a C expression. E.g., when the cursor is on "arg"
887885 of "ptr->arg" then the result is "ptr->arg"; when the
888886 cursor is on "]" of "list[idx]" then the result is
889887 "list[idx]". This is used for |v:beval_text|.
888+ *:<cfile>* *<cfile>*
890889 <cfile> is replaced with the path name under the cursor (like what
891890 |gf| uses)
891+ *:<afile>* *<afile>*
892892 <afile> When executing autocommands, is replaced with the file name
893893 of the buffer being manipulated, or the file for a read or
894894 write. *E495*
895+ *:<abuf>* *<abuf>*
895896 <abuf> When executing autocommands, is replaced with the currently
896897 effective buffer number (for ":r file" and ":so file" it is
897898 the current buffer, the file being read/sourced is not in a
898899 buffer). *E496*
900+ *:<amatch>* *<amatch>*
899901 <amatch> When executing autocommands, is replaced with the match for
900902 which this autocommand was executed. *E497*
901903 It differs from <afile> only when the file name isn't used
902904 to match with (for FileType, Syntax and SpellFileMissing
903905 events).
906+ *:<sfile>* *<sfile>*
904907 <sfile> When executing a ":source" command, is replaced with the
905908 file name of the sourced file. *E498*
906909 When executing a function, is replaced with the call stack,
@@ -908,18 +911,24 @@
908911 <stack> is preferred).
909912 Note that filename-modifiers are useless when <sfile> is
910913 not used inside a script.
914+ *:<stack>* *<stack>*
911915 <stack> is replaced with the call stack, using
912916 "function {function-name}[{lnum}]" for a function line
913917 and "script {file-name}[{lnum}]" for a script line, and
914918 ".." in between items. E.g.:
915919 "function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
920+ *:<slnum>* *<slnum>*
916921 <slnum> When executing a ":source" command, is replaced with the
917922 line number. *E842*
918923 When executing a function it's the line number relative to
919924 the start of the function.
925+ *:<sflnum>* *<sflnum>*
920926 <sflnum> When executing a script, is replaced with the line number.
921927 It differs from <slnum> in that <sflnum> is replaced with
922928 the script line number in any situation. *E961*
929+ *:<client>* *<client>*
930+ <client> is replaced with the {clinetid} of the last received
931+ message in |server2client()|
923932
924933 *filename-modifiers*
925934 *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S*
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/eval.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*eval.txt* For Vim version 8.2. Last change: 2020 Sep 06
1+*eval.txt* For Vim version 8.2. Last change: 2020 Sep 16
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4302,6 +4302,7 @@
43024302 <afile> autocmd file name
43034303 <abuf> autocmd buffer number (as a String!)
43044304 <amatch> autocmd matched name
4305+ <cexpr> C expression under the cursor
43054306 <sfile> sourced script file or function name
43064307 <slnum> sourced script line number or function
43074308 line number
@@ -4309,6 +4310,7 @@
43094310 a function
43104311 <SID> "<SNR>123_" where "123" is the
43114312 current script ID |<SID>|
4313+ <stack> call stack
43124314 <cword> word under the cursor
43134315 <cWORD> WORD under the cursor
43144316 <client> the {clientid} of the last received
@@ -5489,7 +5491,7 @@
54895491 local marks defined in buffer {expr}. For the use of {expr},
54905492 see |bufname()|.
54915493
5492- Each item in the retuned List is a |Dict| with the following:
5494+ Each item in the returned List is a |Dict| with the following:
54935495 name - name of the mark prefixed by "'"
54945496 pos - a |List| with the position of the mark:
54955497 [bufnum, lnum, col, off]
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/insert.txt
--- a/runtime/doc/insert.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/insert.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*insert.txt* For Vim version 8.2. Last change: 2020 Apr 30
1+*insert.txt* For Vim version 8.2. Last change: 2020 Sep 19
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1843,6 +1843,7 @@
18431843
18441844 *A*
18451845 A Append text at the end of the line [count] times.
1846+ For using "A" in Visual block mode see |v_b_A|.
18461847
18471848 <insert> or *i* *insert* *<Insert>*
18481849 i Insert text before the cursor [count] times.
@@ -1855,6 +1856,7 @@
18551856 When the 'H' flag is present in 'cpoptions' and the
18561857 line only contains blanks, insert start just before
18571858 the last blank.
1859+ For using "I" in Visual block mode see |v_b_I|.
18581860
18591861 *gI*
18601862 gI Insert text in column 1 [count] times.
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/map.txt
--- a/runtime/doc/map.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/map.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*map.txt* For Vim version 8.2. Last change: 2020 Sep 06
1+*map.txt* For Vim version 8.2. Last change: 2020 Sep 09
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1506,7 +1506,7 @@
15061506 <bang> (See the '-bang' attribute) Expands to a ! if the
15071507 command was executed with a ! modifier, otherwise
15081508 expands to nothing.
1509- *<mods>* *:command-modifiers*
1509+ *<mods>* *<q-mods>* *:command-modifiers*
15101510 <mods> The command modifiers, if specified. Otherwise, expands to
15111511 nothing. Supported modifiers are |:aboveleft|, |:belowright|,
15121512 |:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|,
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/options.txt
--- a/runtime/doc/options.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/options.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*options.txt* For Vim version 8.2. Last change: 2020 Sep 06
1+*options.txt* For Vim version 8.2. Last change: 2020 Sep 15
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2806,7 +2806,10 @@
28062806 'emoji' 'emo' boolean (default: on)
28072807 global
28082808 When on all Unicode emoji characters are considered to be full width.
2809-
2809+ This excludes "text emoji" characters, which are normally displayed as
2810+ single width. Unfortunately there is no good specification for this
2811+ and it has been determined on trial-and-error basis. Use the
2812+ |setcellwidths()| function to change the behavior.
28102813
28112814 *'encoding'* *'enc'* *E543*
28122815 'encoding' 'enc' string (default: "latin1" or value from $LANG)
@@ -7288,8 +7291,8 @@
72887291 N N Printer page number. (Only works in the 'printheader' option.)
72897292 l N Line number.
72907293 L N Number of lines in buffer.
7291- c N Column number.
7292- v N Virtual column number.
7294+ c N Column number (byte index).
7295+ v N Virtual column number (screen column).
72937296 V N Virtual column number as -{num}. Not displayed if equal to 'c'.
72947297 p N Percentage through file in lines as in |CTRL-G|.
72957298 P S Percentage through file of displayed window. This is like the
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/pi_netrw.txt
--- a/runtime/doc/pi_netrw.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/pi_netrw.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*pi_netrw.txt* For Vim version 8.2. Last change: 2020 Aug 15
1+*pi_netrw.txt* For Vim version 8.2. Last change: 2020 Sep 19
22
33 ------------------------------------------------
44 NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -437,9 +437,13 @@
437437 *g:netrw_silent* =0 : transfers done normally
438438 =1 : transfers done silently
439439
440- *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
440+ *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window
441+ Move the mouse and pause to remove the popup window.
442+ (default value if popup windows are availble)
443+ =1 : messages from netrw will use a separate one
441444 line window. This window provides reliable
442- delivery of messages. (default)
445+ delivery of messages.
446+ (default value if popup windows are not availble)
443447 =0 : messages from netrw will use echoerr ;
444448 messages don't always seem to show up this
445449 way, but one doesn't have to quit the window.
@@ -725,6 +729,8 @@
725729 See |netrw-activate| for more on how to encourage your vim to use plugins
726730 such as netrw.
727731
732+For password-free use of scp:, see |netrw-ssh-hack|.
733+
728734
729735 ==============================================================================
730736 7. Ex Commands *netrw-ex* {{{1
@@ -1063,7 +1069,7 @@
10631069 Reverse sorting order.........................|netrw-r|
10641070
10651071
1066- *netrw-quickmap* *netrw-quickmaps*
1072+ *netrw-quickmap* *netrw-quickmaps*
10671073 QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
10681074 >
10691075 --- ----------------- ----
@@ -1080,7 +1086,7 @@
10801086 a Cycles between normal display, |netrw-a|
10811087 hiding (suppress display of files matching g:netrw_list_hide)
10821088 and showing (display only files which match g:netrw_list_hide)
1083- c Make browsing directory the current directory |netrw-c|
1089+ cd Make browsing directory the current directory |netrw-cd|
10841090 C Setting the editing window |netrw-C|
10851091 d Make a directory |netrw-d|
10861092 D Attempt to remove the file(s)/directory(ies) |netrw-D|
@@ -2098,7 +2104,7 @@
20982104 set Vim's notion of the current directory to netrw's current browsing
20992105 directory.
21002106
2101-*netrw-c* : This map's name has been changed from "c" to cd (see |netrw-cd|).
2107+|netrw-cd|: This map's name was changed from "c" to cd (see |netrw-cd|).
21022108 This change was done to allow for |netrw-cb| and |netrw-cB| maps.
21032109
21042110 Associated setting variable: |g:netrw_keepdir|
@@ -2753,7 +2759,7 @@
27532759 =0 keep the current directory the same as the
27542760 browsing directory.
27552761 The current browsing directory is contained in
2756- b:netrw_curdir (also see |netrw-c|)
2762+ b:netrw_curdir (also see |netrw-cd|)
27572763
27582764 *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the
27592765 |:jumps| table unaffected.
@@ -3054,7 +3060,7 @@
30543060 (see |netrw-c-tab|).
30553061
30563062 *g:netrw_xstrlen* Controls how netrw computes string lengths,
3057- including multibyte characters' string
3063+ including multi-byte characters' string
30583064 length. (thanks to N Weibull, T Mechelynck)
30593065 =0: uses Vim's built-in strlen()
30603066 =1: number of codepoints (Latin a + combining
@@ -3124,7 +3130,8 @@
31243130
31253131 Related topics:
31263132 * To see what the current directory is, use |:pwd|
3127- * To make the currently browsed directory the current directory, see |netrw-c|
3133+ * To make the currently browsed directory the current directory, see
3134+ |netrw-cd|
31283135 * To automatically make the currently browsed directory the current
31293136 directory, see |g:netrw_keepdir|.
31303137
@@ -3799,9 +3806,15 @@
37993806 or
38003807 http://vim.sourceforge.net/scripts/script.php?script_id=120
38013808
3802- Decho.vim is provided as a "vimball"; see |vimball-intro|.
3803-
3804- 2. Edit the <netrw.vim> file by typing: >
3809+ Decho.vim is provided as a "vimball"; see |vimball-intro|. You
3810+ should edit the Decho.vba.gz file and source it in: >
3811+
3812+ vim Decho.vba.gz
3813+ :so %
3814+ :q
3815+<
3816+ 2. To turn on debug tracing in netrw, then edit the <netrw.vim>
3817+ file by typing: >
38053818
38063819 vim netrw.vim
38073820 :DechoOn
@@ -3823,14 +3836,34 @@
38233836 read/write your file over the network in a separate tab or
38243837 server vim window.
38253838
3826- To save the file, use >
3839+ Change the netrw.vimrc file to include the Decho plugin: >
3840+
3841+ set nocp
3842+ so $HOME/.vim/plugin/Decho.vim
3843+ so $HOME/.vim/plugin/netrwPlugin.vim
3844+<
3845+ You should continue to run vim with >
3846+
3847+ vim -u netrw.vimrc --noplugins -i NONE [some path here]
3848+<
3849+ to avoid entanglements with options and other plugins.
3850+
3851+ To save the file: under linux, the output will be in a separate
3852+ remote server window; in it, just save the file with >
3853+
3854+ :w! DBG
3855+
3856+< Under a vim that doesn't support clientserver, your debugging
3857+ output will appear in another tab: >
38273858
38283859 :tabnext
38293860 :set bt=
38303861 :w! DBG
3831-
3832-< Furthermore, it'd be helpful if you would type >
3862+<
3863+ Furthermore, it'd be helpful if you would type >
3864+
38333865 :Dsep <command>
3866+
38343867 < where <command> is the command you're about to type next,
38353868 thereby making it easier to associate which part of the
38363869 debugging trace is due to which command.
@@ -3838,17 +3871,34 @@
38383871 Please send that information to <netrw.vim>'s maintainer along
38393872 with the o/s you're using and the vim version that you're using
38403873 (see |:version|) (remove the embedded NOSPAM first) >
3874+
38413875 NcampObell@SdrPchip.AorgM-NOSPAM
38423876 <
38433877 ==============================================================================
38443878 12. History *netrw-history* {{{1
38453879
3880+ v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree
3881+ would not hide with the ^\..* pattern
3882+ correctly.
3883+ * (Marcin Szamotulski) NetrwOptionRestore
3884+ did not restore options correctly that
3885+ had a single quote in the option string.
3886+ Apr 13, 2020 * implemented error handling via popup
3887+ windows (see |popup_beval()|)
3888+ Apr 30, 2020 * (reported by Manatsu Takahashi) while
3889+ using Lexplore, a modified file could
3890+ be overwritten. Sol'n: will not overwrite,
3891+ but will emit an |E37| (although one cannot
3892+ add an ! to override)
3893+ Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking
3894+ :Lexplore and quitting it left unused
3895+ hidden buffers. Netrw will now set netrw
3896+ buffers created by :Lexplore to |bh|=wipe.
38463897 v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x
38473898 (|netrw-x|) would throw an error when
38483899 attempting to open a local directory.
38493900 v168: Dec 12, 2019 * scp timeout error message not reported,
38503901 hopefully now fixed (Shane Xb Qian)
3851-
38523902 v167: Nov 29, 2019 * netrw does a save&restore on @* and @+.
38533903 That causes problems with the clipboard.
38543904 Now restores occurs only if @* or @+ have
@@ -4306,4 +4356,4 @@
43064356
43074357 ==============================================================================
43084358 Modelines: {{{1
4309- vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker
4359+vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/popup.txt
--- a/runtime/doc/popup.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/popup.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*popup.txt* For Vim version 8.2. Last change: 2020 Jul 27
1+*popup.txt* For Vim version 8.2. Last change: 2020 Sep 08
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -915,6 +915,12 @@
915915 Vim recognizes the Esc key. If you do use Esc, it is recommended to set the
916916 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'.
917917
918+ *popup-filter-errors*
919+If the filter function can't be called, e.g. because the name is wrong, then
920+the popup is closed. If the filter causes an error then it is assumed to
921+return zero. If this happens three times in a row the popup is closed. If
922+the popup gives errors fewer than 10% of the calls then it won't be closed.
923+
918924
919925 POPUP CALLBACK *popup-callback*
920926
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/tags
--- a/runtime/doc/tags Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/tags Sat Sep 19 19:00:04 2020 +0200
@@ -1975,6 +1975,7 @@
19751975 :<cWORD> cmdline.txt /*:<cWORD>*
19761976 :<cexpr> cmdline.txt /*:<cexpr>*
19771977 :<cfile> cmdline.txt /*:<cfile>*
1978+:<client> cmdline.txt /*:<client>*
19781979 :<cword> cmdline.txt /*:<cword>*
19791980 :<sfile> cmdline.txt /*:<sfile>*
19801981 :<sflnum> cmdline.txt /*:<sflnum>*
@@ -3160,6 +3161,7 @@
31603161 :sta windows.txt /*:sta*
31613162 :stag windows.txt /*:stag*
31623163 :star repeat.txt /*:star*
3164+:star-visual-range cmdline.txt /*:star-visual-range*
31633165 :start insert.txt /*:start*
31643166 :startgreplace insert.txt /*:startgreplace*
31653167 :startinsert insert.txt /*:startinsert*
@@ -3614,6 +3616,7 @@
36143616 <cexpr> cmdline.txt /*<cexpr>*
36153617 <cfile> cmdline.txt /*<cfile>*
36163618 <character> intro.txt /*<character>*
3619+<client> cmdline.txt /*<client>*
36173620 <count> map.txt /*<count>*
36183621 <cword> cmdline.txt /*<cword>*
36193622 <f-args> map.txt /*<f-args>*
@@ -3643,6 +3646,7 @@
36433646 <mods> map.txt /*<mods>*
36443647 <nomodeline> autocmd.txt /*<nomodeline>*
36453648 <q-args> map.txt /*<q-args>*
3649+<q-mods> map.txt /*<q-mods>*
36463650 <range> map.txt /*<range>*
36473651 <reg> map.txt /*<reg>*
36483652 <register> map.txt /*<register>*
@@ -7751,6 +7755,7 @@
77517755 matcharg() eval.txt /*matcharg()*
77527756 matchdelete() eval.txt /*matchdelete()*
77537757 matchend() eval.txt /*matchend()*
7758+matchfuzzy() eval.txt /*matchfuzzy()*
77547759 matchit-install usr_05.txt /*matchit-install*
77557760 matchlist() eval.txt /*matchlist()*
77567761 matchparen pi_paren.txt /*matchparen*
@@ -7929,7 +7934,6 @@
79297934 netrw-browser-settings pi_netrw.txt /*netrw-browser-settings*
79307935 netrw-browser-var pi_netrw.txt /*netrw-browser-var*
79317936 netrw-browsing pi_netrw.txt /*netrw-browsing*
7932-netrw-c pi_netrw.txt /*netrw-c*
79337937 netrw-c-tab pi_netrw.txt /*netrw-c-tab*
79347938 netrw-cB pi_netrw.txt /*netrw-cB*
79357939 netrw-cadaver pi_netrw.txt /*netrw-cadaver*
@@ -8392,6 +8396,7 @@
83928396 popup-close popup.txt /*popup-close*
83938397 popup-examples popup.txt /*popup-examples*
83948398 popup-filter popup.txt /*popup-filter*
8399+popup-filter-errors popup.txt /*popup-filter-errors*
83958400 popup-filter-mode popup.txt /*popup-filter-mode*
83968401 popup-function-details popup.txt /*popup-function-details*
83978402 popup-functions popup.txt /*popup-functions*
@@ -10029,6 +10034,8 @@
1002910034 vim7 version7.txt /*vim7*
1003010035 vim8 version8.txt /*vim8*
1003110036 vim9 vim9.txt /*vim9*
10037+vim9-classes vim9.txt /*vim9-classes*
10038+vim9-const vim9.txt /*vim9-const*
1003210039 vim9-declaration vim9.txt /*vim9-declaration*
1003310040 vim9-declarations usr_46.txt /*vim9-declarations*
1003410041 vim9-differences vim9.txt /*vim9-differences*
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/todo.txt
--- a/runtime/doc/todo.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/todo.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*todo.txt* For Vim version 8.2. Last change: 2020 Sep 07
1+*todo.txt* For Vim version 8.2. Last change: 2020 Sep 19
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -40,24 +40,13 @@
4040
4141 Why does Test_invalid_sid() not work in the GUI?
4242
43+Add matchfuzzy() and matchfuzzypos() Yegappan, #6947
44+ should be ready now
45+
4346 Making everything work:
44-- Should :const work the same as in legacy script?
45- Or should it work like in Typescript: only the variable is fixed, not the
46- value itself.
47- Then use ":const!" to also fix/lock the value?
48- Typescript uses "as const", which is weird.
49- Alternative: const var = <const>value
50- looks quite strange quite verbose
51- But can be used in several places:
52- SomeFunc(<const>[1, 2, 3])
53- In Vim this basically means "lock this value".
54- How about:
55- SomeFunc(<const>[[1], [2], [3]]) # are sub-lists immutable?
56- SomeFunc(<const>myList) # is myList mutable afterwards?
57-
58-- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
59-- :put with a "=" register argument doesn't work, need to find the expression
60- and compile it. (#6397)
47+- Fix memory leak in test_vim9_func (through compile_nested_function and
48+ get_lambda_tv())
49+- Fix memory leaks in test_vim9_script
6150 - At the Vim9 script level, keep script variables local to the block they are
6251 declared in, like in Javascript (using :let).
6352 -> Need to remember what variables were declared and delete them when
@@ -80,6 +69,7 @@
8069 assertfail
8170 unknown
8271 endassertfail E99:.*unknown
72+- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
8373 - In autocmd: use legacy syntax, not whatever the current script uses?
8474 - need to check type when a declaration specifies a type: #6507
8575 let nr: number = 'asdf'
@@ -87,6 +77,9 @@
8777 the script-local function, not a global one.
8878 - Make sure that where a callback is expected a function can be used (without
8979 quotes). E.g. sort() and map(). Also at the script level.
80+- assignment to more complex lval: list[1][2][3] = 8
81+- ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
82+ Add command to parse range at runtime?
9083 - Make map() give an error if the resulting type is wrong.
9184 Add mapnew() to create a new List/Dict for the result, which can have a
9285 different value type.
@@ -108,6 +101,9 @@
108101 - Test that a function defined inside a :def function is local to that
109102 function, g: functions can be defined and script-local functions cannot be
110103 defined.
104+- Does this work already: can use func as reference:
105+ def SomeFunc() ...
106+ map(list, SomeFunc)
111107 - Support passing v:none to use the default argument value. (#6504)
112108 - make 0 == 'string' fail on the script level, like inside :def.
113109 - Check that when using a user function name without prefix, it does not find
@@ -123,10 +119,6 @@
123119 - Compile redir to local variable: var_redir_start().
124120 - Compile builtin functions that access local variables:
125121 islocked()
126-- possible memory leak in test_vim9_func through compile_nested_function.
127-- memory leaks in test_vim9_expr
128-- memory leaks in test_vim9_script
129-- memory leaks in test_vim9_cmd
130122 - When evaluating constants for script variables, some functions could work:
131123 has('asdf'), len('string')
132124 - Implement "as Name" in "import Item as Name from ..."
@@ -151,24 +143,23 @@
151143 - Make Foo.Bar() work to call the dict function. (#5676)
152144 - Error in any command in "vim9script" aborts sourcing.
153145 - Find a way to test expressions in legacy and Vim9 script without duplication
154-- Fix memory leaks for test_vim9_disassemble, test_vim9_expr, test_vim9_script
155146 - Test each level of expressions properly, with type checking
156147 - Test try/catch and throw better, also nested.
157148 Test return inside try/finally jumps to finally and then returns.
158-- can use func as reference:
159- def SomeFunc() ...
160- map(list, SomeFunc)
161149 - Test: Function declared inside a :def function is local, disappears at the
162150 end of the function. Unless g: is used, just like with variables.
163151 - implement :type
164152 - import type declaration?
165-- implement class
166-- implement interface
167-- predefined class: Promise<T>
153+- Future work: See |vim9-classes|
168154 - implement enum
169155 - Make accessing varargs faster: arg[expr]
170156 EVAL expr
171157 LOADVARARG (varags idx)
158+- Make debugging work - at least per function. Need to recompile a function
159+ to step through it line-by-line? Evaluate the stack and variables on the
160+ stack?
161+- Make profiling work - Add ISN_PROFILE instructions after every line?
162+- List commands when 'verbose' is set or :verbose is used.
172163 Further improvements:
173164 - compile options that are an expression, e.g. "expr:" in 'spellsuggest',
174165 'foldexpr', 'foldtext', 'printexpr', 'diffexpr', 'patchexpr', 'charconvert',
@@ -292,7 +283,7 @@
292283 Error numbers available: E653
293284
294285 Patch to implement the vimtutor with a plugin: #6414
295-Was originally writtten by Felipe Morales.
286+Was originally written by Felipe Morales.
296287
297288 Remove SPACE_IN_FILENAME ? It is only used for completion.
298289
@@ -303,6 +294,9 @@
303294
304295 Patch for blockwise paste reporting changes: #6660.
305296
297+Expanding <mods> should put the tab number from cmdmod.tab before "tab".
298+Any way to convert "$" back by using a special value? (#6901)
299+
306300 Can we detect true color support? https://gist.github.com/XVilka/8346728
307301 Try setting a color then request the current color, like using t_u7.
308302
@@ -397,6 +391,9 @@
397391 ":find testfile.c" does not ignore case.
398392 Might be related to #6088.
399393
394+Error for reverse range when using :vimgrep in file "[id-01] file.txt".
395+(#6919)
396+
400397 When changing the crypt key the buffer should be considered modified.
401398 Like when changing 'fileformat'. Save the old key in save_file_ff().
402399 (Ninu-Ciprian Marginean)
@@ -514,7 +511,7 @@
514511 Modeless selection doesn't work in gvim. (#4783)
515512 Caused by patch 8.1.1534.
516513
517-Visual highlight not removed when 'dipslay' is "lastline" and line doesn't
514+Visual highlight not removed when 'display' is "lastline" and line doesn't
518515 fit. (Kevin Lawler, #4457)
519516
520517 Current position in the changelist should be local to the buffer. (#2173)
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/version8.txt
--- a/runtime/doc/version8.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/version8.txt Sat Sep 19 19:00:04 2020 +0200
@@ -42445,7 +42445,7 @@
4244542445
4244642446 Patch 8.2.0216
4244742447 Problem: Several Vim9 instructions are not tested.
42448-Solution: Add more tests. Fix :disassamble output. Make catch with pattern
42448+Solution: Add more tests. Fix :disassemble output. Make catch with pattern
4244942449 work.
4245042450 Files: src/testdir/test_vim9_script.vim, src/vim9execute.c,
4245142451 src/vim9compile.c
@@ -42665,7 +42665,7 @@
4266542665 Files: src/vim9compile.c
4266642666
4266742667 Patch 8.2.0253
42668-Problem: Crash when using :disassamble without argument. (Dhiraj Mishra)
42668+Problem: Crash when using :disassemble without argument. (Dhiraj Mishra)
4266942669 Solution: Check for missing argument. (Dominique Pellé, closes #5635,
4267042670 closes #5637)
4267142671 Files: src/vim9execute.c, src/testdir/test_vim9_disassemble.vim,
diff -r 701d200ab63c -r 75ff30a78189 runtime/doc/vim9.txt
--- a/runtime/doc/vim9.txt Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/doc/vim9.txt Sat Sep 19 19:00:04 2020 +0200
@@ -1,4 +1,4 @@
1-*vim9.txt* For Vim version 8.2. Last change: 2020 Sep 13
1+*vim9.txt* For Vim version 8.2. Last change: 2020 Sep 17
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -19,6 +19,7 @@
1919 3. New style functions |fast-functions|
2020 4. Types |vim9-types|
2121 5. Namespace, Import and Export |vim9script|
22+6. Future work: classes |vim9-classes|
2223
2324 9. Rationale |vim9-rationale|
2425
@@ -49,13 +50,14 @@
4950 The Vim9 script syntax and semantics are used in:
5051 - a function defined with the `:def` command
5152 - a script file where the first command is `vim9script`
52-- an autocommand defined in the context of these
53+- an autocommand defined in the context of the above
5354
5455 When using `:function` in a Vim9 script file the legacy syntax is used.
5556 However, this can be confusing and is therefore discouraged.
5657
5758 Vim9 script and legacy Vim script can be mixed. There is no requirement to
58-rewrite old scripts, they keep working as before.
59+rewrite old scripts, they keep working as before. You may want to use a few
60+`:def` functions for code that needs to be fast.
5961
6062 ==============================================================================
6163
@@ -834,6 +836,8 @@
834836 To import all exported items under a specific identifier: >
835837 import * as That from 'thatscript.vim'
836838
839+{not implemented yet: using "This as That"}
840+
837841 Then you can use "That.EXPORTED_CONST", "That.someValue", etc. You are free
838842 to choose the name "That", but it is highly recommended to use the name of the
839843 script file to avoid confusion.
@@ -902,6 +906,37 @@
902906
903907 ==============================================================================
904908
909+6. Future work: classes *vim9-classes*
910+
911+Above "class" was mentioned a few times, but it has not been implemented yet.
912+Most of Vim9 script can be created without this funcionality, and since
913+implementing classes is going to be a lot of work, it is left for the future.
914+For now we'll just make sure classes can be added later.
915+
916+Thoughts:
917+- `class` / `endclass`, everything in one file
918+- Class names are always CamelCase
919+- Single constructor
920+- Single inheritance with `class ThisClass extends BaseClass`
921+- `abstract class`
922+- `interface` (Abstract class without any implementation)
923+- `class SomeClass implements SomeInterface`
924+- Generics for class: `class <Tkey, Tentry>`
925+- Generics for function: `def <Tkey> GetLast(key: Tkey)`
926+
927+Again, much of this is from TypeScript.
928+
929+Some things that look like good additions:
930+- Use a class as an interface (like Dart)
931+- Extend a class with methods, using an import (like Dart)
932+
933+An important class that will be provided is "Promise". Since Vim is single
934+threaded, connecting asynchronous operations is a natural way of allowing
935+plugins to do their work without blocking the user. It's a uniform way to
936+invoke callbacks and handle timeouts and errors.
937+
938+==============================================================================
939+
905940 9. Rationale *vim9-rationale*
906941
907942 The :def command ~
@@ -933,36 +968,37 @@
933968 of the arguments and decide what kind of addition to do. And when the
934969 type is dictionary throw an error. If the types are known to be numbers then
935970 an "add number" instruction can be used, which is faster. The error can be
936-given at compile time, no error handling is needed at runtime.
971+given at compile time, no error handling is needed at runtime, adding two
972+numbers cannot fail.
937973
938974 The syntax for types is similar to Java, since it is easy to understand and
939975 widely used. The type names are what were used in Vim before, with some
940976 additions such as "void" and "bool".
941977
942978
943-Compiling functions early ~
944-
945-Functions are compiled when called or when `:defcompile` is used. Why not
946-compile them early, so that syntax and type errors are reported early?
947-
948-The functions can't be compiled right away when encountered, because there may
949-be forward references to functions defined later. Consider defining functions
950-A, B and C, where A calls B, B calls C, and C calls A again. It's impossible
951-to reorder the functions to avoid forward references.
979+Removing clutter and weirdness ~
952980
953-An alternative would be to first scan through the file to locate items and
954-figure out their type, so that forward references are found, and only then
955-execute the script and compile the functions. This means the script has to be
956-parsed twice, which is slower, and some conditions at the script level, such
957-as checking if a feature is supported, are hard to use. An attempt was made
958-to see if it works, but it turned out to be impossible to make work nicely.
981+Once decided that `:def` functions have different syntax than legacy functions,
982+we are free to add improvements to make the code more familiar for users who
983+know popular programming languages. In other words: remove weird things that
984+only Vim uses.
959985
960-It would be possible to compile all the functions at the end of the script.
961-The drawback is that if a function never gets called, the overhead of
962-compiling it counts anyway. Since startup speed is very important, in most
963-cases it's better to do it later and accept that syntax and type errors are
964-only reported then. In case these errors should be found early, e.g. when
965-testing, the `:defcompile` command will help out.
986+We can also remove clutter, mainly things that were done to make Vim script
987+backwards compatible with good old Vi commands.
988+
989+Examples:
990+- Drop `:call` for calling a function and `:eval` for manipulating data.
991+- Drop using a leading backslash for line continuation, automatically figure
992+ out where an expression ends.
993+
994+However, this does require that some things need to change:
995+- Comments start with # instead of ", to avoid confusing them with strings.
996+- Ex command ranges need to be prefixed with a colon, to avoid confusion with
997+ expressions (single quote can be a string or a mark, "/" can be divide or a
998+ search command, etc.).
999+
1000+Goal is to limit the differences. A good criteria is that when the old syntax
1001+is used you are very likely to get an error message.
9661002
9671003
9681004 TypeScript syntax and semantics ~
@@ -992,16 +1028,23 @@
9921028 ...
9931029 let result = value || 0 # result == 44
9941030
1031+Another reason why TypeScript can be used as an example for Vim9 script is the
1032+mix of static typing (a variable always has a known value type) and dynamic
1033+typing (a variable can have different types, this hanges at runtime). Since
1034+legacy Vim script is dynamically typed and a lot of existing functionality
1035+(esp. builtin functions) depends on that, while static typing allows for much
1036+faster execution, we need to have this mix in Vim9 script.
1037+
9951038 There is no intention to completely match TypeScript syntax and semantics. We
9961039 just want to take those parts that we can use for Vim and we expect Vim users
997-will be happy with. TypeScript is a complex language with its own advantages
998-and disadvantages. To get an idea of the disadvantages read the book:
999-"JavaScript: The Good Parts". Or find the article "TypeScript: the good
1040+will be happy with. TypeScript is a complex language with its own history,
1041+advantages and disadvantages. To get an idea of the disadvantages read the
1042+book: "JavaScript: The Good Parts". Or find the article "TypeScript: the good
10001043 parts" and read the "Things to avoid" section.
10011044
1002-People used to other languages (Java, Python, etc.) will also find things in
1003-TypeScript that they do not like or do not understand. We'll try to avoid
1004-those things.
1045+People familiar with other languages (Java, Python, etc.) will also find
1046+things in TypeScript that they do not like or do not understand. We'll try to
1047+avoid those things.
10051048
10061049 Specific items from TypeScript we avoid:
10071050 - Overloading "+", using it both for addition and string concatenation. This
@@ -1054,24 +1097,56 @@
10541097 Note that you can also use `:import` in legacy Vim script, see above.
10551098
10561099
1057-Classes ~
1100+Compiling functions early ~
1101+
1102+Functions are compiled when called or when `:defcompile` is used. Why not
1103+compile them early, so that syntax and type errors are reported early?
1104+
1105+The functions can't be compiled right away when encountered, because there may
1106+be forward references to functions defined later. Consider defining functions
1107+A, B and C, where A calls B, B calls C, and C calls A again. It's impossible
1108+to reorder the functions to avoid forward references.
1109+
1110+An alternative would be to first scan through the file to locate items and
1111+figure out their type, so that forward references are found, and only then
1112+execute the script and compile the functions. This means the script has to be
1113+parsed twice, which is slower, and some conditions at the script level, such
1114+as checking if a feature is supported, are hard to use. An attempt was made
1115+to see if it works, but it turned out to be impossible to make work nicely.
1116+
1117+It would be possible to compile all the functions at the end of the script.
1118+The drawback is that if a function never gets called, the overhead of
1119+compiling it counts anyway. Since startup speed is very important, in most
1120+cases it's better to do it later and accept that syntax and type errors are
1121+only reported then. In case these errors should be found early, e.g. when
1122+testing, the `:defcompile` command will help out.
1123+
1124+
1125+Why not use an embeded language? ~
10581126
10591127 Vim supports interfaces to Perl, Python, Lua, Tcl and a few others. But
1060-these interfaces have never become widespread. When Vim 9 was designed a
1061-decision was made to phase out these interfaces and concentrate on Vim script,
1062-while encouraging plugin authors to write code in any language and run it as
1063-an external tool, using jobs and channels.
1128+these interfaces have never become widely used, for various reasons. When
1129+Vim9 was designed a decision was made to make these interfaces lower priority
1130+and concentrate on Vim script.
10641131
1065-Still, using an external tool has disadvantages. An alternative is to convert
1132+Still, plugin writers may find other languages more familiar, want to use
1133+existing libraries or see a performance benefit. We encourage plugin authors
1134+to write code in any language and run it as an external tool, using jobs and
1135+channels. We can try to make this easier somehow.
1136+
1137+Using an external tool also has disadvantages. An alternative is to convert
10661138 the tool into Vim script. For that to be possible without too much
10671139 translation, and keeping the code fast at the same time, the constructs of the
10681140 tool need to be supported. Since most languages support classes the lack of
10691141 support for classes in Vim is then a problem.
10701142
1071-Previously Vim supported a kind-of object oriented programming by adding
1072-methods to a dictionary. With some care this could be made to work, but it
1073-does not look like real classes. On top of that, it's very slow, because of
1074-the use of dictionaries.
1143+
1144+Classes ~
1145+
1146+Vim supports a kind-of object oriented programming by adding methods to a
1147+dictionary. With some care this can be made to work, but it does not look
1148+like real classes. On top of that, it's quite slow, because of the use of
1149+dictionaries.
10751150
10761151 The support of classes in Vim9 script is a "minimal common functionality" of
10771152 class support in most languages. It works much like Java, which is the most
diff -r 701d200ab63c -r 75ff30a78189 runtime/indent/erlang.vim
--- a/runtime/indent/erlang.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/indent/erlang.vim Sat Sep 19 19:00:04 2020 +0200
@@ -4,9 +4,9 @@
44 " Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
55 " Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
66 " Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
7-" Last Update: 2013-Jul-21
7+" Last Update: 2020-Jun-11
88 " License: Vim license
9-" URL: https://github.com/hcs42/vim-erlang
9+" URL: https://github.com/vim-erlang/vim-erlang-runtime
1010
1111 " Note About Usage:
1212 " This indentation script works best with the Erlang syntax file created by
@@ -56,7 +56,8 @@
5656 " Line tokenizer library {{{1
5757 " ======================
5858
59-" Indtokens are "indentation tokens".
59+" Indtokens are "indentation tokens". See their exact format in the
60+" documentaiton of the s:GetTokensFromLine function.
6061
6162 " Purpose:
6263 " Calculate the new virtual column after the given segment of a line.
@@ -119,9 +120,10 @@
119120 " Returns:
120121 " indtokens = [indtoken]
121122 " indtoken = [token, vcol, col]
122-" token = string (examples: 'begin', '<variable>', '}')
123-" vcol = integer (the virtual column of the first character of the token)
124-" col = integer
123+" token = string (examples: 'begin', '<quoted_atom>', '}')
124+" vcol = integer (the virtual column of the first character of the token;
125+" counting starts from 0)
126+" col = integer (counting starts from 0)
125127 function! s:GetTokensFromLine(line, string_continuation, atom_continuation,
126128 \tabstop)
127129
@@ -386,9 +388,12 @@
386388 " lnum: integer
387389 " direction: 'up' | 'down'
388390 " Returns:
389-" result: [] -- the result is an empty list if we hit the beginning or end
390-" of the file
391-" | indtoken
391+" result: [[], 0, 0]
392+" -- the result is an empty list if we hit the beginning or end of
393+" the file
394+" | [indtoken, lnum, i]
395+" -- the content, lnum and token index of the next (or previous)
396+" indtoken
392397 function! s:FindIndToken(lnum, dir)
393398 let lnum = a:lnum
394399 while 1
@@ -396,9 +401,12 @@
396401 let [lnum, indtokens] = s:TokenizeLine(lnum, a:dir)
397402 if lnum ==# 0
398403 " We hit the beginning or end of the file
399- return []
404+ return [[], 0, 0]
400405 elseif !empty(indtokens)
401- return indtokens[a:dir ==# 'up' ? -1 : 0]
406+ " We found a non-empty line. If we were moving up, we return the last
407+ " token of this line. Otherwise we return the first token if this line.
408+ let i = (a:dir ==# 'up' ? len(indtokens) - 1 : 0)
409+ return [indtokens[i], lnum, i]
402410 endif
403411 endwhile
404412 endfunction
@@ -417,7 +425,7 @@
417425
418426 " If the current line has a previous token, return that
419427 if a:i > 0
420- return s:all_tokens[a:lnum][a:i - 1]
428+ return [s:all_tokens[a:lnum][a:i - 1], a:lnum, a:i - 1]
421429 else
422430 return s:FindIndToken(a:lnum, 'up')
423431 endif
@@ -437,7 +445,7 @@
437445
438446 " If the current line has a next token, return that
439447 if len(s:all_tokens[a:lnum]) > a:i + 1
440- return s:all_tokens[a:lnum][a:i + 1]
448+ return [s:all_tokens[a:lnum][a:i + 1], a:lnum, a:i + 1]
441449 else
442450 return s:FindIndToken(a:lnum, 'down')
443451 endif
@@ -518,7 +526,9 @@
518526 " ok. % IsLineAtomContinuation = false
519527 function! s:IsLineAtomContinuation(lnum)
520528 if has('syntax_items')
521- return synIDattr(synID(a:lnum, 1, 0), 'name') =~# '^erlangQuotedAtom'
529+ let syn_name = synIDattr(synID(a:lnum, 1, 0), 'name')
530+ return syn_name =~# '^erlangQuotedAtom' ||
531+ \ syn_name =~# '^erlangQuotedRecord'
522532 else
523533 return 0
524534 endif
@@ -535,7 +545,7 @@
535545 " is_standalone: bool
536546 function! s:IsCatchStandalone(lnum, i)
537547 call s:Log(' IsCatchStandalone called: lnum=' . a:lnum . ', i=' . a:i)
538- let prev_indtoken = s:PrevIndToken(a:lnum, a:i)
548+ let [prev_indtoken, _, _] = s:PrevIndToken(a:lnum, a:i)
539549
540550 " If we hit the beginning of the file, it is not a catch in a try block
541551 if prev_indtoken == []
@@ -544,7 +554,7 @@
544554
545555 let prev_token = prev_indtoken[0]
546556
547- if prev_token =~# '[A-Z_@0-9]'
557+ if prev_token =~# '^[A-Z_@0-9]'
548558 let is_standalone = 0
549559 elseif prev_token =~# '[a-z]'
550560 if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl',
@@ -659,11 +669,14 @@
659669 " stack: [token]
660670 " token: string
661671 " stored_vcol: integer
672+" lnum: the line number of the "end of clause" mark (or 0 if we hit the
673+" beginning of the file)
674+" i: the index of the "end of clause" token within its own line
662675 " Returns:
663676 " result: [should_return, indent]
664677 " should_return: bool -- if true, the caller should return `indent` to Vim
665678 " indent -- integer
666-function! s:BeginningOfClauseFound(stack, token, stored_vcol)
679+function! s:BeginningOfClauseFound(stack, token, stored_vcol, lnum, i)
667680 if !empty(a:stack) && a:stack[0] ==# 'when'
668681 call s:Log(' BeginningOfClauseFound: "when" found in stack')
669682 call s:Pop(a:stack)
@@ -681,13 +694,45 @@
681694 return [1, a:stored_vcol + shiftwidth()]
682695 elseif a:stack[0] ==# ';'
683696 call s:Pop(a:stack)
684- if empty(a:stack)
685- call s:Log(' Stack is ["->", ";"], so LTI is in a function head ' .
686- \'-> return')
687- return [0, a:stored_vcol]
688- else
697+
698+ if !empty(a:stack)
689699 return [1, s:UnexpectedToken(a:token, a:stack)]
690700 endif
701+
702+ if a:lnum ==# 0
703+ " Set lnum and i to be NextIndToken-friendly
704+ let lnum = 1
705+ let i = -1
706+ else
707+ let lnum = a:lnum
708+ let i = a:i
709+ endif
710+
711+ " Are we after a "-spec func() ...;" clause?
712+ let [next1_indtoken, next1_lnum, next1_i] = s:NextIndToken(lnum, i)
713+ if !empty(next1_indtoken) && next1_indtoken[0] =~# '-'
714+ let [next2_indtoken, next2_lnum, next2_i] =
715+ \s:NextIndToken(next1_lnum, next1_i)
716+ if !empty(next2_indtoken) && next2_indtoken[0] =~# 'spec'
717+ let [next3_indtoken, next3_lnum, next3_i] =
718+ \s:NextIndToken(next2_lnum, next2_i)
719+ if !empty(next3_indtoken)
720+ let [next4_indtoken, next4_lnum, next4_i] =
721+ \s:NextIndToken(next3_lnum, next3_i)
722+ if !empty(next4_indtoken)
723+ " Yes, we are.
724+ call s:Log(' Stack is ["->", ";"], so LTI is in a "-spec" ' .
725+ \'attribute -> return')
726+ return [1, next4_indtoken[1]]
727+ endif
728+ endif
729+ endif
730+ endif
731+
732+ call s:Log(' Stack is ["->", ";"], so LTI is in a function head ' .
733+ \'-> return')
734+ return [1, a:stored_vcol]
735+
691736 else
692737 return [1, s:UnexpectedToken(a:token, a:stack)]
693738 endif
@@ -714,7 +759,7 @@
714759 return s:SearchPair(
715760 \ a:lnum, a:curr_col,
716761 \ '\C\<\%(case\|try\|begin\|receive\|if\)\>\|' .
717- \ '\<fun\>\%(\s\|\n\|%.*$\)*(',
762+ \ '\<fun\>\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(',
718763 \ '',
719764 \ '\<end\>')
720765 endfunction
@@ -756,7 +801,7 @@
756801 " Hit the start of the file
757802 if lnum ==# 0
758803 let [ret, res] = s:BeginningOfClauseFound(stack, 'beginning_of_file',
759- \stored_vcol)
804+ \stored_vcol, 0, 0)
760805 if ret | return res | endif
761806
762807 return 0
@@ -775,7 +820,8 @@
775820 endif
776821
777822 if token ==# '<end_of_clause>'
778- let [ret, res] = s:BeginningOfClauseFound(stack, token, stored_vcol)
823+ let [ret, res] = s:BeginningOfClauseFound(stack, token, stored_vcol,
824+ \lnum, i)
779825 if ret | return res | endif
780826
781827 if stored_vcol ==# -1
@@ -787,7 +833,7 @@
787833 endif
788834
789835 elseif stack == ['prev_term_plus']
790- if token =~# '[a-zA-Z_@]' ||
836+ if token =~# '[a-zA-Z_@#]' ||
791837 \ token ==# '<string>' || token ==# '<string_start>' ||
792838 \ token ==# '<quoted_atom>' || token ==# '<quoted_atom_start>'
793839 call s:Log(' previous token found: curr_vcol + plus = ' .
@@ -917,9 +963,18 @@
917963 if ret | return res | endif
918964
919965 elseif token ==# 'fun'
920- let next_indtoken = s:NextIndToken(lnum, i)
966+ let [next_indtoken, next_lnum, next_i] = s:NextIndToken(lnum, i)
921967 call s:Log(' Next indtoken = ' . string(next_indtoken))
922968
969+ if !empty(next_indtoken) && next_indtoken[0] =~# '^[A-Z_@]'
970+ " The "fun" is followed by a variable, so we might have a named fun:
971+ " "fun Fun() -> ok end". Thus we take the next token to decide
972+ " whether this is a function definition ("fun()") or just a function
973+ " reference ("fun Mod:Fun").
974+ let [next_indtoken, _, _] = s:NextIndToken(next_lnum, next_i)
975+ call s:Log(' Next indtoken = ' . string(next_indtoken))
976+ endif
977+
923978 if !empty(next_indtoken) && next_indtoken[0] ==# '('
924979 " We have an anonymous function definition
925980 " (e.g. "fun () -> ok end")
@@ -1327,6 +1382,26 @@
13271382 return -1
13281383 endif
13291384
1385+ " If the line starts with the comment, and so is the previous non-blank line
1386+ if currline =~# '^\s*%'
1387+ let lnum = prevnonblank(v:lnum - 1)
1388+ if lnum ==# 0
1389+ call s:Log('First non-empty line of the file -> return 0.')
1390+ return 0
1391+ else
1392+ let ml = matchlist(getline(lnum), '^\(\s*\)%')
1393+ " If the previous line also starts with a comment, then return the same
1394+ " indentation that line has. Otherwise exit from this special "if" and
1395+ " don't care that the current line is a comment.
1396+ if !empty(ml)
1397+ let new_col = s:CalcVCol(ml[1], 0, len(ml[1]) - 1, 0, &tabstop)
1398+ call s:Log('Comment line after another comment line -> ' .
1399+ \'use same indent: ' . new_col)
1400+ return new_col
1401+ endif
1402+ endif
1403+ endif
1404+
13301405 let ml = matchlist(currline,
13311406 \'^\(\s*\)\(\%(end\|of\|catch\|after\)\>\|[)\]}]\|>>\)')
13321407
@@ -1381,6 +1456,24 @@
13811456
13821457 endfunction
13831458
1459+" ErlangShowTokensInLine functions {{{1
1460+" ================================
1461+
1462+" These functions are useful during development.
1463+
1464+function! ErlangShowTokensInLine(line)
1465+ echo "Line: " . a:line
1466+ let indtokens = s:GetTokensFromLine(a:line, 0, 0, &tabstop)
1467+ echo "Tokens:"
1468+ for it in indtokens
1469+ echo it
1470+ endfor
1471+endfunction
1472+
1473+function! ErlangShowTokensInCurrentLine()
1474+ return ErlangShowTokensInLine(getline('.'))
1475+endfunction
1476+
13841477 " Cleanup {{{1
13851478 " =======
13861479
diff -r 701d200ab63c -r 75ff30a78189 runtime/plugin/netrwPlugin.vim
--- a/runtime/plugin/netrwPlugin.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/plugin/netrwPlugin.vim Sat Sep 19 19:00:04 2020 +0200
@@ -20,7 +20,7 @@
2020 if &cp || exists("g:loaded_netrwPlugin")
2121 finish
2222 endif
23-let g:loaded_netrwPlugin = "v168"
23+let g:loaded_netrwPlugin = "v170"
2424 let s:keepcpo = &cpo
2525 set cpo&vim
2626 "DechoRemOn
diff -r 701d200ab63c -r 75ff30a78189 runtime/syntax/erlang.vim
--- a/runtime/syntax/erlang.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/syntax/erlang.vim Sat Sep 19 19:00:04 2020 +0200
@@ -2,7 +2,7 @@
22 " Language: Erlang (http://www.erlang.org)
33 " Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
44 " Contributor: Adam Rutkowski <hq@mtod.org>
5-" Last Update: 2019-Jun-18
5+" Last Update: 2020-May-26
66 " License: Vim license
77 " URL: https://github.com/vim-erlang/vim-erlang-runtime
88
@@ -44,7 +44,7 @@
4444
4545 " Comments
4646 syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
47-syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
47+syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|param\|private\|equiv\|spec\|throws\)' contained
4848 syn match erlangCommentAnnotation /`[^']*'/ contained
4949 syn keyword erlangTodo TODO FIXME XXX contained
5050
@@ -92,7 +92,7 @@
9292
9393 " Constants and Directives
9494 syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
95-syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment
95+syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment
9696 syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
9797 syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
9898 syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
diff -r 701d200ab63c -r 75ff30a78189 runtime/syntax/netrw.vim
--- a/runtime/syntax/netrw.vim Sat Sep 19 18:30:04 2020 +0200
+++ b/runtime/syntax/netrw.vim Sat Sep 19 19:00:04 2020 +0200
@@ -105,7 +105,7 @@
105105
106106 " special syntax highlighting (see :he g:netrw_special_syntax)
107107 hi default link netrwCoreDump WarningMsg
108- hi default link netrwData DiffChange
108+ hi default link netrwData Folded
109109 hi default link netrwHdr netrwPlain
110110 hi default link netrwLex netrwPlain
111111 hi default link netrwLib DiffChange
Show on old repository browser