Browse Source

Merge pull request #14424 from janlazo/vim-8.1.1726

vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
pull/14492/head
Jan Edmund Lazo 4 days ago
committed by GitHub
parent
commit
4ad30f775e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 38
      runtime/autoload/ccomplete.vim
  3. 17
      runtime/autoload/clojurecomplete.vim
  4. 2
      runtime/autoload/decada.vim
  5. 6
      runtime/autoload/dist/ft.vim
  6. 5
      runtime/autoload/htmlcomplete.vim
  7. 4
      runtime/autoload/man.vim
  8. 126
      runtime/autoload/netrw.vim
  9. 6
      runtime/autoload/netrwFileHandlers.vim
  10. 7
      runtime/autoload/python3complete.vim
  11. 7
      runtime/autoload/pythoncomplete.vim
  12. 59
      runtime/autoload/rubycomplete.vim
  13. 153
      runtime/autoload/syntaxcomplete.vim
  14. 112
      runtime/autoload/tohtml.vim
  15. 29
      runtime/autoload/zip.vim
  16. 2
      runtime/colors/README.txt
  17. 20
      runtime/compiler/checkstyle.vim
  18. 26
      runtime/compiler/cm3.vim
  19. 26
      runtime/compiler/dart.vim
  20. 28
      runtime/compiler/dart2js.vim
  21. 28
      runtime/compiler/dart2native.vim
  22. 23
      runtime/compiler/dartanalyser.vim
  23. 28
      runtime/compiler/dartdevc.vim
  24. 26
      runtime/compiler/dartdoc.vim
  25. 25
      runtime/compiler/dartfmt.vim
  26. 16
      runtime/compiler/eslint.vim
  27. 27
      runtime/compiler/fbc.vim
  28. 34
      runtime/compiler/gawk.vim
  29. 25
      runtime/compiler/gjs.vim
  30. 15
      runtime/compiler/javac.vim
  31. 30
      runtime/compiler/jest.vim
  32. 24
      runtime/compiler/jjs.vim
  33. 25
      runtime/compiler/jshint.vim
  34. 25
      runtime/compiler/jsonlint.vim
  35. 6
      runtime/compiler/ocaml.vim
  36. 84
      runtime/compiler/powershell.vim
  37. 30
      runtime/compiler/rhino.vim
  38. 23
      runtime/compiler/rubocop.vim
  39. 25
      runtime/compiler/shellcheck.vim
  40. 28
      runtime/compiler/sml.vim
  41. 16
      runtime/compiler/standard.vim
  42. 26
      runtime/compiler/stylelint.vim
  43. 17
      runtime/compiler/tidy.vim
  44. 28
      runtime/compiler/typedoc.vim
  45. 4
      runtime/doc/arabic.txt
  46. 25
      runtime/doc/autocmd.txt
  47. 63
      runtime/doc/change.txt
  48. 38
      runtime/doc/cmdline.txt
  49. 3
      runtime/doc/diff.txt
  50. 2
      runtime/doc/digraph.txt
  51. 115
      runtime/doc/editing.txt
  52. 1063
      runtime/doc/eval.txt
  53. 19
      runtime/doc/filetype.txt
  54. 64
      runtime/doc/ft_ps1.txt
  55. 126
      runtime/doc/ft_raku.txt
  56. 12
      runtime/doc/ft_sql.txt
  57. 52
      runtime/doc/gui.txt
  58. 7
      runtime/doc/help.txt
  59. 45
      runtime/doc/helphelp.txt
  60. 13
      runtime/doc/if_perl.txt
  61. 151
      runtime/doc/if_pyth.txt
  62. 10
      runtime/doc/if_ruby.txt
  63. 58
      runtime/doc/indent.txt
  64. 46
      runtime/doc/index.txt
  65. 31
      runtime/doc/insert.txt
  66. 8
      runtime/doc/intro.txt
  67. 2
      runtime/doc/makehtml.awk
  68. 144
      runtime/doc/map.txt
  69. 22
      runtime/doc/mbyte.txt
  70. 14
      runtime/doc/message.txt
  71. 2
      runtime/doc/mlang.txt
  72. 75
      runtime/doc/motion.txt
  73. 229
      runtime/doc/options.txt
  74. 104
      runtime/doc/pattern.txt
  75. 78
      runtime/doc/pi_netrw.txt
  76. 13
      runtime/doc/pi_zip.txt
  77. 23
      runtime/doc/print.txt
  78. 52
      runtime/doc/quickfix.txt
  79. 10
      runtime/doc/quickref.txt
  80. 11
      runtime/doc/recover.txt
  81. 38
      runtime/doc/repeat.txt
  82. 2
      runtime/doc/rileft.txt
  83. 387
      runtime/doc/sign.txt
  84. 4
      runtime/doc/spell.txt
  85. 26
      runtime/doc/starting.txt
  86. 283
      runtime/doc/syntax.txt
  87. 2
      runtime/doc/tabpage.txt
  88. 36
      runtime/doc/tagsrch.txt
  89. 9
      runtime/doc/term.txt
  90. 169
      runtime/doc/testing.txt
  91. 24
      runtime/doc/tips.txt
  92. 2
      runtime/doc/uganda.txt
  93. 12
      runtime/doc/undo.txt
  94. 6
      runtime/doc/usr_01.txt
  95. 110
      runtime/doc/usr_02.txt
  96. 82
      runtime/doc/usr_03.txt
  97. 75
      runtime/doc/usr_04.txt
  98. 4
      runtime/doc/usr_05.txt
  99. 4
      runtime/doc/usr_07.txt
  100. 2
      runtime/doc/usr_08.txt

1
.gitignore

@ -30,6 +30,7 @@ compile_commands.json
# Generated by scripts/vim-patch.sh
/.vim-src
*.rej
# Generated by old (Vim) tests.
/src/nvim/testdir/del

38
runtime/autoload/ccomplete.vim

@ -1,13 +1,13 @@
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2018 Aug 20
" Last Change: 2020 Nov 14
let s:cpo_save = &cpo
set cpo&vim
" This function is used for the 'omnifunc' option.
function! ccomplete#Complete(findstart, base)
func ccomplete#Complete(findstart, base)
if a:findstart
" Locate the start of the item, including ".", "->" and "[...]".
let line = getline('.')
@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base)
return map(res, 's:Tagline2item(v:val, brackets)')
endfunc
function! s:GetAddition(line, match, memarg, bracket)
func s:GetAddition(line, match, memarg, bracket)
" Guess if the item is an array.
if a:bracket && match(a:line, a:match . '\s*\[') > 0
return '['
@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket)
endif
endif
return ''
endfunction
endfunc
" Turn the tag info "val" into an item for completion.
" "val" is is an item in the list returned by taglist().
" If it is a variable we may add "." or "->". Don't do it for other types,
" such as a typedef, by not including the info that s:GetAddition() uses.
function! s:Tag2item(val)
func s:Tag2item(val)
let res = {'match': a:val['name']}
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
@ -289,10 +289,10 @@ function! s:Tag2item(val)
endif
return res
endfunction
endfunc
" Use all the items in dictionary for the "info" entry.
function! s:Dict2info(dict)
func s:Dict2info(dict)
let info = ''
for k in sort(keys(a:dict))
let info .= k . repeat(' ', 10 - len(k))
@ -307,7 +307,7 @@ function! s:Dict2info(dict)
endfunc
" Parse a tag line and return a dictionary with items like taglist()
function! s:ParseTagline(line)
func s:ParseTagline(line)
let l = split(a:line, "\t")
let d = {}
if len(l) >= 3
@ -334,12 +334,12 @@ function! s:ParseTagline(line)
endif
return d
endfunction
endfunc
" Turn a match item "val" into an item for completion.
" "val['match']" is the matching item.
" "val['tagline']" is the tagline in which the last part was found.
function! s:Tagline2item(val, brackets)
func s:Tagline2item(val, brackets)
let line = a:val['tagline']
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
let res = {'word': a:val['match'] . a:brackets . add }
@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets)
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
endif
return res
endfunction
endfunc
" Turn a command from a tag line to something that is useful in the menu
function! s:Tagcmd2extra(cmd, name, fname)
func s:Tagcmd2extra(cmd, name, fname)
if a:cmd =~ '^/^'
" The command is a search command, useful to see what it is.
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname)
let x = a:cmd . ' - ' . a:fname
endif
return x
endfunction
endfunc
" Find composing type in "lead" and match items[0] with it.
" Repeat this recursively for items[1], if it's there.
" When resolving typedefs "depth" is used to avoid infinite recursion.
" Return the list of matches.
function! s:Nextitem(lead, items, depth, all)
func s:Nextitem(lead, items, depth, all)
" Use the text up to the variable name and split it in tokens.
let tokens = split(a:lead, '\s\+\|\<')
@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all)
endfor
return res
endfunction
endfunc
" Search for members of structure "typename" in tags files.
@ -493,7 +493,7 @@ endfunction
" Each match is a dictionary with "match" and "tagline" entries.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:StructMembers(typename, items, all)
func s:StructMembers(typename, items, all)
" Todo: What about local structures?
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
if fnames == ''
@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all)
" Failed to find anything.
return []
endfunction
endfunc
" For matching members, find matches for following items.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:SearchMembers(matches, items, all)
func s:SearchMembers(matches, items, all)
let res = []
for i in range(len(a:matches))
let typename = ''
@ -635,3 +635,5 @@ endfunc
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: noet sw=2 sts=2

17
runtime/autoload/clojurecomplete.vim
File diff suppressed because it is too large
View File

2
runtime/autoload/decada.vim

@ -25,7 +25,7 @@ function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extenstion.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (wich denotes a specification)
" 3: remove a trailing '_' (which denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1

6
runtime/autoload/dist/ft.vim

@ -1,7 +1,7 @@
" Vim functions for file type detection
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Mar 08
" Last Change: 2020 Aug 17
" These functions are moved here from runtime/filetype.vim to make startup
" faster.
@ -298,7 +298,7 @@ endfunc
func dist#ft#FTmms()
let n = 1
while n < 10
while n < 20
let line = getline(n)
if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
setf mmix
@ -325,7 +325,7 @@ endfunc
func dist#ft#FTmm()
let n = 1
while n < 10
while n < 20
let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
setf objcpp

5
runtime/autoload/htmlcomplete.vim

@ -1,7 +1,7 @@
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2014 Jun 20
" Last Change: 2019 Sep 27
" Distinguish between HTML versions.
" To use with other HTML versions add another "elseif" condition to match
@ -245,7 +245,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
" If context contains white space it is attribute.
" It can be also value of attribute.
" We have to get first word to offer proper completions
if context == ''
if context =~ '^\s*$'
" empty or whitespace line
let tag = ''
else
let tag = split(context)[0]

4
runtime/autoload/man.vim

@ -252,11 +252,11 @@ function! s:verify_exists(sect, name) abort
if !empty($MANSECT)
try
let MANSECT = $MANSECT
unset $MANSECT
call setenv('MANSECT', v:null)
return s:get_path('', a:name)
catch /^command error (/
finally
let $MANSECT = MANSECT
call setenv('MANSECT', MANSECT)
endtry
endif

126
runtime/autoload/netrw.vim

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
" Date: Jan 07, 2020
" Version: 168
" Date: Sep 18, 2020
" Version: 170
" 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 = "v168"
let g:loaded_netrw = "v170"
if !exists("s:NOTE")
let s:NOTE = 0
let s:WARNING = 1
@ -86,7 +86,16 @@ fun! netrw#ErrorMsg(level,msg,errnum)
endif
" call Decho("level=".level,'~'.expand("<slnum>"))
if g:netrw_use_errorwindow
if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486")))
" use popup window
if type(a:msg) == 3
let msg = [level]+a:msg
else
let msg= level.a:msg
endif
let s:popuperr_id = popup_beval(msg,{})
let s:popuperr_text= ""
elseif g:netrw_use_errorwindow
" (default) netrw creates a one-line window to show error/warning
" messages (reliably displayed)
@ -203,7 +212,11 @@ let g:netrw_localrmdiropt = ""
" ---------------------------------------------------------------------
" Default values for netrw's global protocol variables {{{2
call s:NetrwInit("g:netrw_use_errorwindow",1)
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")
call s:NetrwInit("g:netrw_use_errorwindow",2)
else
call s:NetrwInit("g:netrw_use_errorwindow",1)
endif
if !exists("g:netrw_dav_cmd")
if executable("cadaver")
@ -559,6 +572,7 @@ call s:NetrwInit("s:netrw_posn",'{}')
if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
" call Decho("installed beval events",'~'.expand("<slnum>"))
let &l:bexpr = "netrw#BalloonHelp()"
" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr())
au FileType netrw setl beval
au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif
au VimEnter * let s:initbeval= &beval
@ -591,7 +605,18 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
if &ft != "netrw"
return ""
endif
if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {}
" popup error window is still showing
" s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg()
if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text
" text under mouse hasn't changed; only close window when it changes
call popup_close(s:popuperr_id)
unlet s:popuperr_text
else
let s:popuperr_text= v:beval_text
endif
let mesg= ""
elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval)
let mesg= ""
elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing"
let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file"
@ -1212,6 +1237,10 @@ fun! netrw#Lexplore(count,rightside,...)
setlocal winfixwidth
let g:netrw_altv = keep_altv
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.
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"))
if exists("t:netrw_lexposn")
@ -1864,7 +1893,7 @@ fun! s:NetrwRestoreSetting(keepvar,setting)
if type(a:setting) == 0
exe "let ".a:setting."= ".keepvarval
elseif type(a:setting) == 1
exe "let ".a:setting."= '".keepvarval."'"
exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'"
else
call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105)
endif
@ -3596,6 +3625,8 @@ fun! s:NetrwBookHistSave()
let savefile= s:NetrwHome()."/.netrwhist"
" call Decho("savefile<".savefile.">",'~'.expand("<slnum>"))
1split
" setting up a new buffer which will become .netrwhist
call s:NetrwEnew()
" call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("<slnum>"))
if g:netrw_use_noswf
@ -4678,7 +4709,7 @@ endfun
" "new directory name" is actually a file,
" NetrwBrowseChgDir() edits the file.
fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
" call 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 : "").">")
" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>"))
let ykeep= @@
@ -4707,13 +4738,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let newdir = a:newdir
let dolockout = 0
let dorestore = 1
" call Decho("win#".winnr(),'~'.expand("<slnum>"))
" call Decho("dirname<".dirname.">",'~'.expand("<slnum>"))
" call Decho("newdir<".newdir.">",'~'.expand("<slnum>"))
" ignore <cr>s when done in the banner
" call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("<slnum>"))
if g:netrw_banner
" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>"))
if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
if getline(".") =~# 'Quick Help'
" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
@ -4750,7 +4782,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" ------------------------------
" NetrwBrowseChgDir: edit a file {{{3
" ------------------------------
" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>"))
" save position for benefit of Rexplore
let s:rexposn_{bufnr("%")}= winsaveview()
@ -4785,7 +4817,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
NetrwKeepj call s:NetrwOptionsRestore("s:")
let curdir= b:netrw_curdir
if !exists("s:didsplit")
" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("<slnum>"))
" " 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>"))
if type(g:netrw_browse_split) == 3
" open file in server
" Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
@ -4793,22 +4825,27 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
call s:NetrwServerEdit(a:islocal,dirname)
" call Dret("s:NetrwBrowseChgDir")
return
elseif g:netrw_browse_split == 1
" horizontally splitting the window first
" call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("<slnum>"))
keepalt new
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
if !&ea
keepalt wincmd _
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 2
" vertically splitting the window first
" call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("<slnum>"))
keepalt rightb vert new
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
if !&ea
keepalt wincmd |
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 3
" open file in new tab
" call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("<slnum>"))
@ -4817,6 +4854,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let b:netrw_curdir= getcwd()
endif
call s:SetRexDir(a:islocal,curdir)
elseif g:netrw_browse_split == 4
" act like "P" (ie. open previous window)
" call Decho("edit-a-file: use previous window for edit",'~'.expand("<slnum>"))
@ -4826,13 +4864,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
return
endif
call s:SetRexDir(a:islocal,curdir)
else
" handling a file, didn't split, so remove menu
" call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("<slnum>"))
call s:NetrwMenu(0)
" optional change to window
if g:netrw_chgwin >= 1
" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("<slnum>"))
" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("<slnum>"))
if winnr("$")+1 == g:netrw_chgwin
" if g:netrw_chgwin is set to one more than the last window, then
" vertically split the last window to make that window available.
@ -4845,19 +4884,26 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
call s:SetRexDir(a:islocal,curdir)
endif
endif
" 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
if !&mod
" if e the new file would fail due to &mod, then don't change any of the flags
let dolockout= 1
endif
if a:islocal
" call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("<slnum>"))
" some like c-^ to return to the last edited file
" others like c-^ to return to the netrw buffer
" 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)
exe "NetrwKeepj keepalt e ".fnameescape(dirname)
else
exe "NetrwKeepj e! ".fnameescape(dirname)
exe "NetrwKeepj e ".fnameescape(dirname)
endif
" call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
call s:NetrwCursor()
@ -4868,7 +4914,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
else
" call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("<slnum>"))
endif
let dolockout= 1
" handle g:Netrw_funcref -- call external-to-netrw functions
" This code will handle g:Netrw_funcref as an individual function reference
@ -5332,16 +5377,6 @@ fun! netrw#BrowseX(fname,remote)
endif
let ret= v:shell_error
elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir)
let ret= v:shell_error
elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril")
" call Decho("(netrw#BrowseX) unix and atril",'~'.expand("<slnum>"))
if a:fname =~ '^https\=://'
@ -5356,9 +5391,19 @@ fun! netrw#BrowseX(fname,remote)
endif
let ret= v:shell_error
elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>"))
call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir)
let ret= v:shell_error
elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid")
" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&')
let ret= v:shell_error
elseif has("unix") && executable("xdg-open")
" call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("<slnum>"))
call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir)
call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&')
let ret= v:shell_error
elseif has("macunix") && executable("open")
@ -6053,10 +6098,10 @@ fun! s:NetrwListHide()
" Duplicate characters don't matter.
" Remove all such characters from the '/~@#...890' string.
" Use the first character left as a separator character.
" call Decho("find a character not in the hide string to use as a separator")
" call Decho("find a character not in the hide string to use as a separator",'~'.expand("<slnum>"))
let listhide= g:netrw_list_hide
let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
" call Decho("sep=".sep," (sep not in hide string)'~'.expand("<slnum>"))
" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("<slnum>"))
while listhide != ""
if listhide =~ ','
@ -6066,7 +6111,7 @@ fun! s:NetrwListHide()
let hide = listhide
let listhide = ""
endif
" call Decho("..extracted from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>"))
if g:netrw_sort_by =~ '^[ts]'
if hide =~ '^\^'
" call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("<slnum>"))
@ -6078,7 +6123,7 @@ fun! s:NetrwListHide()
endif
" Prune the list by hiding any files which match
" call Decho("..prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">")
" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">")
if g:netrw_hide == 1
" call Decho("..hiding<".hide.">",'~'.expand("<slnum>"))
exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
@ -9161,6 +9206,7 @@ endfun
" (full path directory with trailing slash returned)
fun! s:NetrwTreeDir(islocal)
" 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)
" call Decho("Determine tree directory given current cursor position")
" call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("<slnum>"))
" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
" call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("<slnum>"))
@ -9266,7 +9312,6 @@ fun! s:NetrwTreeDisplay(dir,depth)
call setline(line("$")+1,a:depth.shortdir.'/')
endif
" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("<slnum>"))
" append a / to dir if its missing one
let dir= a:dir
@ -9280,7 +9325,7 @@ fun! s:NetrwTreeDisplay(dir,depth)
let listhide= split(g:netrw_list_hide,',')
" call Decho("listhide=".string(listhide))
for pat in listhide
call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"')
call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"')
endfor
elseif g:netrw_hide == 2
@ -9418,6 +9463,7 @@ fun! s:NetrwTreeListing(dirname)
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
" display from treetop on down
" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">")
NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
" call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("<slnum>"))
@ -9678,7 +9724,7 @@ fun! s:PerformListing(islocal)
" Hiding... -or- Showing... {{{3
if g:netrw_banner
" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>"))
if g:netrw_list_hide != "" && g:netrw_hide
if g:netrw_hide == 1
NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide
@ -9731,7 +9777,7 @@ fun! s:PerformListing(islocal)
" call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
" call Decho("manipulate directory listing (hide)",'~'.expand("<slnum>"))
" call Decho("manipulate directory listing (support hide)",'~'.expand("<slnum>"))
" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>"))
if g:netrw_hide && g:netrw_list_hide != ""
NetrwKeepj call s:NetrwListHide()
@ -11744,7 +11790,7 @@ endfun
" ---------------------------------------------------------------------
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
fun! s:NetrwEnew(...)
" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
" call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
" grab a function-local-variable copy of buffer variables
@ -11811,6 +11857,9 @@ fun! s:NetrwEnew(...)
endif
endif
endif
if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on")
let &l:bexpr = "netrw#BalloonHelp()"
endif
" call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$"))
endfun
@ -11870,6 +11919,7 @@ endfun
" -1=failed
fun! s:NetrwLcd(newdir)
" call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)")
" call Decho("changing local directory",'~'.expand("<slnum>"))
let err472= 0
try
@ -11905,6 +11955,8 @@ fun! s:NetrwLcd(newdir)
return -1
endif
" call Decho("getcwd <".getcwd().">")
" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
" call Dret("s:NetrwLcd 0")
return 0
endfun

6
runtime/autoload/netrwFileHandlers.vim

@ -1,8 +1,8 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell
" Date: May 03, 2013
" Version: 11b ASTRO-ONLY
" Date: Sep 18, 2020
" Version: 11
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@ -20,7 +20,7 @@
if exists("g:loaded_netrwFileHandlers") || &cp
finish
endif
let g:loaded_netrwFileHandlers= "v11b"
let g:loaded_netrwFileHandlers= "v11"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"

7
runtime/autoload/python3complete.vim

@ -1,7 +1,8 @@
"python3complete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Maintainer: <vacancy>
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
" Last Updated: 2020 Oct 9
"
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
"
@ -83,7 +84,7 @@ function! python3complete#Complete(findstart, base)
break
endif
endwhile
execute "py3 vimpy3complete('" . cword . "', '" . a:base . "')"
execute "py3 vimpy3complete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')"
return g:python3complete_completions
endif
endfunction

7
runtime/autoload/pythoncomplete.vim

@ -1,7 +1,8 @@
"pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Maintainer: <vacancy>
" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.9
" Last Updated: 18 Jun 2009
" Last Updated: 2020 Oct 9
"
" Changes
" TODO:
@ -81,7 +82,7 @@ function! pythoncomplete#Complete(findstart, base)
break
endif
endwhile
execute "python vimcomplete('" . cword . "', '" . a:base . "')"
execute "python vimcomplete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')"
return g:pythoncomplete_completions
endif
endfunction

59
runtime/autoload/rubycomplete.vim

@ -3,7 +3,7 @@
" Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jan 06
" Last Change: 2019 Feb 25
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@ -53,6 +53,23 @@ if !exists("g:rubycomplete_include_objectspace")
endif
" }}} configuration failsafe initialization
" {{{ regex patterns
" Regex that defines the start-match for the 'end' keyword.
let s:end_start_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
" Regex that defines the end-match for the 'end' keyword.
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
" }}} regex patterns
" {{{ vim-side support functions
let s:rubycomplete_debug = 0
@ -103,7 +120,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
endif
let curpos = getpos(".")
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' )
let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' )
call cursor(lastpos[1], lastpos[2])
if lnum > enum
@ -128,19 +145,28 @@ function! s:IsPosInClassDef(pos)
return ret
endfunction
function! s:IsInComment(pos)
let stack = synstack(a:pos[0], a:pos[1])
if !empty(stack)
return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)'
else
return 0
endif
endfunction
function! s:GetRubyVarType(v)
let stopline = 1
let vtp = ''
let pos = getpos('.')
let curpos = getpos('.')
let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$'
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
call setpos('.',pos)
call setpos('.',curpos)
let str = getline(lnum)
let vtp = substitute(str,sstr,'\1','')
return vtp
endif
call setpos('.',pos)
call setpos('.',curpos)
let ctors = '\(now\|new\|open\|get_instance'
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
let ctors = ctors.'\|find\|create'
@ -150,9 +176,13 @@ function! s:GetRubyVarType(v)
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0
let str = matchstr(getline(lnum),fstr,lcol)
let pos = searchpos(sstr,'bW')
while pos != [0,0] && s:IsInComment(pos)
let pos = searchpos(sstr,'bW')
endwhile
if pos != [0,0]
let [lnum, col] = pos
let str = matchstr(getline(lnum),fstr,col)
let str = substitute(str,'^=\s*','','')
call setpos('.',pos)
@ -174,7 +204,7 @@ function! s:GetRubyVarType(v)
end
return ''
endif
call setpos('.',pos)
call setpos('.',curpos)
return ''
endfunction
@ -671,11 +701,10 @@ class VimRubyCompletion
methods.delete_if { |c| c.match( /'/ ) }
end
when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods
dprint "const or cls"
receiver = $1
methods = Object.constants
methods.grep(/^#{receiver}/).collect{|e| "::" + e}
methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/)
when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
receiver = $1
@ -684,13 +713,13 @@ class VimRubyCompletion
load_buffer_class( receiver )
load_buffer_module( receiver )
begin
classes = eval("#{receiver}.constants")
#methods = eval("#{receiver}.methods")
constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/)
methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/)
rescue Exception
dprint "exception: %s" % $!
constants = []
methods = []
end
methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
when /^(:[^:.]+)\.([^.]*)$/ # Symbol
dprint "symbol"

153
runtime/autoload/syntaxcomplete.vim

@ -1,12 +1,20 @@
" Vim completion script
" Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
" Version: 13.0
" Last Change: 2019 Aug 08
" Version: 15.0
" Last Change: 2021 Apr 27
" Usage: For detailed help, ":help ft-syntax-omni"
" History
"
" Version 15.0
" - SyntaxComplete ignored all buffer specific overrides, always used global
" https://github.com/vim/vim/issues/8153
"
" Version 14.0
" - Fixed issue with single quotes and is_keyword
" https://github.com/vim/vim/issues/7463
"
" Version 13.0
" - Extended the option omni_syntax_group_include_{filetype}
" to accept a comma separated list of regex's rather than
@ -38,7 +46,7 @@
" let g:omni_syntax_use_single_byte = 1
" - This by default will only allow single byte ASCII
" characters to be added and an additional check to ensure
" the charater is printable (see documentation for isprint).
" the character is printable (see documentation for isprint).
"
" Version 9.0
" - Add the check for cpo.
@ -86,7 +94,7 @@ endif
if exists('g:loaded_syntax_completion')
finish
endif
let g:loaded_syntax_completion = 130
let g:loaded_syntax_completion = 150
" Turn on support for line continuations when creating the script
let s:cpo_save = &cpo
@ -141,14 +149,10 @@ let s:prepended = ''
" This function is used for the 'omnifunc' option.
function! syntaxcomplete#Complete(findstart, base)
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_ignorecase')
if exists('g:omni_syntax_ignorecase')
let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
else
let b:omni_syntax_ignorecase = &ignorecase
endif
" Allow user to override ignorecase per buffer
let l:omni_syntax_ignorecase = g:omni_syntax_ignorecase
if exists('b:omni_syntax_ignorecase')
let l:omni_syntax_ignorecase = b:omni_syntax_ignorecase
endif
if a:findstart
@ -179,7 +183,7 @@ function! syntaxcomplete#Complete(findstart, base)
endif
" let base = s:prepended . a:base
let base = s:prepended
let base = substitute(s:prepended, "'", "''", 'g')
let filetype = substitute(&filetype, '\.', '_', 'g')
let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
@ -195,13 +199,13 @@ function! syntaxcomplete#Complete(findstart, base)
if base != ''
" let compstr = join(compl_list, ' ')
" let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let expr = (l:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
" let compstr = substitute(compstr, expr, '', 'g')
" let compl_list = split(compstr, '\s\+')
" Filter the list based on the first few characters the user
" entered
let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let expr = 'v:val '.(l:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let compl_list = filter(deepcopy(compl_list), expr)
endif
@ -222,6 +226,26 @@ function! syntaxcomplete#OmniSyntaxList(...)
endif
endfunc
function! syntaxcomplete#OmniSyntaxClearCache()
let s:cache_name = []
let s:cache_list = []
endfunction
" To retrieve all syntax items regardless of syntax group:
" echo OmniSyntaxList( [] )
"
" To retrieve only the syntax items for the sqlOperator syntax group:
" echo OmniSyntaxList( ['sqlOperator'] )
"
" To retrieve all syntax items for both the sqlOperator and sqlType groups:
" echo OmniSyntaxList( ['sqlOperator', 'sqlType'] )
"
" A regular expression can also be used:
" echo OmniSyntaxList( ['sql\w\+'] )
"
" From within a plugin, you would typically assign the output to a List: >
" let myKeywords = []
" let myKeywords = OmniSyntaxList( ['sqlKeyword'] )
function! OmniSyntaxList(...)
let list_parms = []
if a:0 > 0
@ -239,37 +263,25 @@ function! OmniSyntaxList(...)
" let use_dictionary = a:1
" endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_use_iskeyword')
if exists('g:omni_syntax_use_iskeyword')
let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
else
let b:omni_syntax_use_iskeyword = 1
endif
endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_minimum_length')
if exists('g:omni_syntax_minimum_length')
let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
else
let b:omni_syntax_minimum_length = 0
endif
endif
let saveL = @l
let filetype = substitute(&filetype, '\.', '_', 'g')
if empty(list_parms)
" Allow user to override per buffer
if exists('g:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = g:omni_syntax_group_include_{filetype}
endif
if exists('b:omni_syntax_group_include_'.filetype)
let l:omni_syntax_group_include_{filetype} = b:omni_syntax_group_include_{filetype}
endif
" Default the include group to include the requested syntax group
let syntax_group_include_{filetype} = ''
" Check if there are any overrides specified for this filetype
if exists('g:omni_syntax_group_include_'.filetype)
if exists('l:omni_syntax_group_include_'.filetype)
let syntax_group_include_{filetype} =
\ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g')
let list_parms = split(g:omni_syntax_group_include_{filetype}, ',')
\ substitute( l:omni_syntax_group_include_{filetype},'\s\+','','g')
let list_parms = split(l:omni_syntax_group_include_{filetype}, ',')
if syntax_group_include_{filetype} =~ '\w'
let syntax_group_include_{filetype} =
\ substitute( syntax_group_include_{filetype},
@ -324,11 +336,20 @@ function! OmniSyntaxList(...)
else
" Default the exclude group to nothing
let syntax_group_exclude_{filetype} = ''
" Check if there are any overrides specified for this filetype
" Allow user to override per buffer
if exists('g:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = g:omni_syntax_group_exclude_{filetype}
endif
if exists('b:omni_syntax_group_exclude_'.filetype)
let l:omni_syntax_group_exclude_{filetype} = b:omni_syntax_group_exclude_{filetype}
endif
" Check if there are any overrides specified for this filetype
if exists('l:omni_syntax_group_exclude_'.filetype)
let syntax_group_exclude_{filetype} =
\ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g')
let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',')
\ substitute( l:omni_syntax_group_exclude_{filetype},'\s\+','','g')
let list_exclude_groups = split(l:omni_syntax_group_exclude_{filetype}, ',')
if syntax_group_exclude_{filetype} =~ '\w'
let syntax_group_exclude_{filetype} =
\ substitute( syntax_group_exclude_{filetype},
@ -524,6 +545,30 @@ endfunction
function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" Allow user to override iskeyword per buffer
let l:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
if exists('b:omni_syntax_use_iskeyword')
let l:omni_syntax_use_iskeyword = b:omni_syntax_use_iskeyword
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_iskeyword_numeric = g:omni_syntax_use_iskeyword_numeric
if exists('b:omni_syntax_use_iskeyword_numeric')
let l:omni_syntax_use_iskeyword_numeric = b:omni_syntax_use_iskeyword_numeric
endif
" Allow user to override iskeyword_numeric per buffer
let l:omni_syntax_use_single_byte = g:omni_syntax_use_single_byte
if exists('b:omni_syntax_use_single_byte')
let l:omni_syntax_use_single_byte = b:omni_syntax_use_single_byte
endif
" Allow user to override minimum_length per buffer
let l:omni_syntax_minimum_length = g:omni_syntax_minimum_length
if exists('b:omni_syntax_minimum_length')
let l:omni_syntax_minimum_length = b:omni_syntax_minimum_length
endif
let syn_list = ""
" From the full syntax listing, strip out the portion for the
@ -642,14 +687,23 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
\ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)'
\ , "", 'g'
\ )
if b:omni_syntax_use_iskeyword == 0
if l:omni_syntax_use_iskeyword == 0
" There are a number of items which have non-word characters in
" them, *'T_F1'*. vim.vim is one such file.
" This will replace non-word characters with spaces.
" setlocal filetype=forth
" let g:omni_syntax_use_iskeyword = 1
" let g:omni_syntax_use_iskeyword_numeric = 1
" You will see entries like
" #>>
" (.local)
" These were found doing a grep in vim82\syntax
" grep iskeyword *
" forth.vim:setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
else
if g:omni_syntax_use_iskeyword_numeric == 1
if l:omni_syntax_use_iskeyword_numeric == 1
" iskeyword can contain value like this
" 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
" Numeric values convert to their ASCII equivalent using the
@ -669,7 +723,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
" cycle through each character within the range
let [b:start, b:end] = split(item, '-')
for range_item in range( b:start, b:end )
if range_item <= 127 || g:omni_syntax_use_single_byte == 0
if range_item <= 127 || l:omni_syntax_use_single_byte == 0
if nr2char(range_item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(range_item)
endif
@ -677,13 +731,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endfor
elseif item =~ '^\d\+$'
" Only numeric, translate to a character
if item < 127 || g:omni_syntax_use_single_byte == 0
if item < 127 || l:omni_syntax_use_single_byte == 0
if nr2char(item) =~ '\p'
let accepted_chars = accepted_chars . nr2char(item)
endif
endif
else
if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0
if char2nr(item) < 127 || l:omni_syntax_use_single_byte == 0
if item =~ '\p'
let accepted_chars = accepted_chars . item
endif
@ -719,9 +773,9 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
endif
endif
if b:omni_syntax_minimum_length > 0
if l:omni_syntax_minimum_length > 0
" If the user specified a minimum length, enforce it
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.l:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
endif
else
let syn_list = ''
@ -751,5 +805,6 @@ function! OmniSyntaxShowChars(spec)
endfor
return join(map(result, 'nr2char(v:val)'), ', ')
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save

112
runtime/autoload/tohtml.vim

@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2018 Nov 11
" Last Change: 2019 Aug 16
"
" Additional contributors:
"
@ -364,6 +364,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
let body_line = ''
let html = []
let s:html5 = 0
if s:settings.use_xhtml
call add(html, xml_line)
endif
@ -371,8 +372,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">')
elseif s:settings.use_css && !s:settings.no_pre
call add(html, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">")
call add(html, "<!DOCTYPE html>")
call add(html, '<html>')
let s:html5 = 1
else
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
@ -383,7 +385,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" include encoding as close to the top as possible, but only if not already
" contained in XML information
if s:settings.encoding != "" && !s:settings.use_xhtml
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
if s:html5
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
else
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
endif
endif
call add(html, '<title>diff</title>')
@ -392,6 +398,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, '<meta name="settings" content="'.
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
\ ',prevent_copy='.s:settings.prevent_copy.
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
\ '"'.tag_close)
call add(html, '<meta name="colorscheme" content="'.
\ (exists('g:colors_name')
@ -400,16 +407,8 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call add(html, '</head>')
let body_line_num = len(html)
if !empty(s:settings.prevent_copy)
call add(html, "<body onload='FixCharWidth();".(s:settings.line_ids ? " JumpToLine();" : "")."'>")
call add(html, "<!-- hidden divs used by javascript to get the width of a char -->")
call add(html, "<div id='oneCharWidth'>0</div>")
call add(html, "<div id='oneInputWidth'><input size='1' value='0'".tag_close."</div>")
call add(html, "<div id='oneEmWidth' style='width: 1em;'></div>")
else
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
endif
call add(html, "<table border='1' width='100%' id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, '<tr>')
for buf in a:win_list
@ -443,7 +442,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" Grab the style information. Some of this will be duplicated so only insert
" it if it's not already there. {{{
1
let style_start = search('^<style type="text/css">')
let style_start = search('^<style\( type="text/css"\)\?>')
1
let style_end = search('^</style>')
if style_start > 0 && style_end > 0
@ -481,7 +480,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" TODO: restore using grabbed lines if undolevel is 1?
normal! 2u
if s:settings.use_css
call add(html, '<td valign="top"><div>')
call add(html, '<td><div>')
elseif s:settings.use_xhtml
call add(html, '<td nowrap="nowrap" valign="top"><div>')
else
@ -515,7 +514,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e")
let i += 1
endwhile
let s:ei_sav = &eventignore
set eventignore+=FileType
exe "topleft new " . name
let &eventignore=s:ei_sav
unlet s:ei_sav
setlocal modifiable
" just in case some user autocmd creates content in the new buffer, make sure
@ -544,7 +549,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" add required javascript in reverse order so we can just call append again
" and again without adjusting {{{
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy)
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
" insert script closing tag if needed
if s:uses_script
@ -555,31 +560,6 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ ])
endif
" insert script which corrects the size of small input elements in
" prevent_copy mode. See 2html.vim for details on why this is needed and how
" it works.
if !empty(s:settings.prevent_copy)
call append(style_start, [
\ '',
\ '/* simulate a "ch" unit by asking the browser how big a zero character is */',
\ 'function FixCharWidth() {',
\ ' /* get the hidden element which gives the width of a single character */',
\ ' var goodWidth = document.getElementById("oneCharWidth").clientWidth;',
\ ' /* get all input elements, we''ll filter on class later */',
\ ' var inputTags = document.getElementsByTagName("input");',
\ ' var ratio = 5;',
\ ' var inputWidth = document.getElementById("oneInputWidth").clientWidth;',
\ ' var emWidth = document.getElementById("oneEmWidth").clientWidth;',
\ ' if (inputWidth > goodWidth) {',
\ ' while (ratio < 100*goodWidth/emWidth && ratio < 100) {',
\ ' ratio += 5;',
\ ' }',
\ ' document.getElementById("vimCodeElement'.s:settings.id_suffix.'").className = "em"+ratio;',
\ ' }',
\ '}'
\ ])
endif
" insert javascript to get IDs from line numbers, and to open a fold before
" jumping to any lines contained therein
if s:settings.line_ids
@ -659,10 +639,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
endif
if s:uses_script
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
" insert script tag if needed
call append(style_start, [
\ "<script type='text/javascript'>",
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
@ -673,11 +652,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" is pretty useless for really long lines. {{{
if s:settings.use_css
call append(style_start,
\ ['<style type="text/css">']+
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
\ style+
\ [ s:settings.use_xhtml ? '' : '<!--',
\ 'table { table-layout: fixed; }',
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
\ 'table, td, th { border: 1px solid; }',
\ 'td { vertical-align: top; }',
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
\ 'td div { overflow: auto; }',
\ s:settings.use_xhtml ? '' : '-->',
@ -720,21 +701,22 @@ func! tohtml#GetUserSettings() "{{{