From c4573eb12dba6a062af28ee0b8938d1521934ce4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 31 Jan 2022 15:40:56 +0000 Subject: Update runtime files --- runtime/autoload/ccomplete.vim | 63 +++++++++++++++++++----------------------- runtime/autoload/dist/ft.vim | 6 ++-- runtime/doc/indent.txt | 11 +++++++- runtime/doc/tags | 6 +--- runtime/doc/todo.txt | 11 +++----- runtime/doc/vim9.txt | 11 ++++---- runtime/filetype.vim | 4 +-- runtime/indent/html.vim | 15 ++++++++-- runtime/indent/testdir/html.in | 13 ++++++++- runtime/indent/testdir/html.ok | 13 ++++++++- runtime/syntax/vim.vim | 14 +++++----- 11 files changed, 98 insertions(+), 69 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index d8675faf6..3bddba7a9 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -4,13 +4,13 @@ vim9script noclear # Language: C # Maintainer: Bram Moolenaar # Rewritten in Vim9 script by github user lacygoill -# Last Change: 2021 Dec 27 +# Last Change: 2022 Jan 31 var prepended: string var grepCache: dict>> # This function is used for the 'omnifunc' option. -def ccomplete#Complete(findstart: bool, abase: string): any # {{{1 +export def Complete(findstart: bool, abase: string): any # {{{1 if findstart # Locate the start of the item, including ".", "->" and "[...]". var line: string = getline('.') @@ -202,7 +202,7 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1 || !v['static'] || bufnr('%') == bufnr(v['filename'])) - res = extendnew(res, tags->map((_, v: dict) => Tag2item(v))) + res = res->extend(tags->map((_, v: dict) => Tag2item(v))) endif if len(res) == 0 @@ -216,9 +216,9 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1 for i: number in len(diclist)->range() # New ctags has the "typeref" field. Patched version has "typename". if diclist[i]->has_key('typename') - res = extendnew(res, diclist[i]['typename']->StructMembers(items[1 :], true)) + res = res->extend(diclist[i]['typename']->StructMembers(items[1 :], true)) elseif diclist[i]->has_key('typeref') - res = extendnew(res, diclist[i]['typeref']->StructMembers(items[1 :], true)) + res = res->extend(diclist[i]['typeref']->StructMembers(items[1 :], true)) endif # For a variable use the command, which must be a search pattern that @@ -227,7 +227,7 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1 var line: string = diclist[i]['cmd'] if line[: 1] == '/^' var col: number = line->charidx(match(line, '\<' .. items[0] .. '\>')) - res = extendnew(res, line[2 : col - 1]->Nextitem(items[1 :], 0, true)) + res = res->extend(line[2 : col - 1]->Nextitem(items[1 :], 0, true)) endif endif endfor @@ -256,11 +256,10 @@ def ccomplete#Complete(findstart: bool, abase: string): any # {{{1 enddef def GetAddition( # {{{1 - line: string, - match: string, - memarg: list>, - bracket: bool -): string + line: string, + match: string, + memarg: list>, + bracket: bool): string # Guess if the item is an array. if bracket && match(line, match .. '\s*\[') > 0 return '[' @@ -403,10 +402,9 @@ def Tagline2item(val: dict, brackets: string): dict # {{{1 enddef def Tagcmd2extra( # {{{1 - cmd: string, - name: string, - fname: string -): string + cmd: string, + name: string, + fname: string): string # Turn a command from a tag line to something that is useful in the menu var x: string if cmd =~ '^/^' @@ -427,11 +425,10 @@ def Tagcmd2extra( # {{{1 enddef def Nextitem( # {{{1 - lead: string, - items: list, - depth: number, - all: bool -): list> + lead: string, + items: list, + depth: number, + all: bool): list> # 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. @@ -473,11 +470,11 @@ def Nextitem( # {{{1 # New ctags has the "typeref" field. Patched version has "typename". if item->has_key('typeref') - res = extendnew(res, item['typeref']->StructMembers(items, all)) + res = res->extend(item['typeref']->StructMembers(items, all)) continue endif if item->has_key('typename') - res = extendnew(res, item['typename']->StructMembers(items, all)) + res = res->extend(item['typename']->StructMembers(items, all)) continue endif @@ -511,11 +508,11 @@ def Nextitem( # {{{1 endif endfor if name != '' - res = extendnew(res, StructMembers(cmdtokens[0] .. ':' .. name, items, all)) + res = res->extend(StructMembers(cmdtokens[0] .. ':' .. name, items, all)) endif elseif depth < 10 # Could be "typedef other_T some_T". - res = extendnew(res, cmdtokens[0]->Nextitem(items, depth + 1, all)) + res = res->extend(cmdtokens[0]->Nextitem(items, depth + 1, all)) endif endif endif @@ -529,10 +526,9 @@ def Nextitem( # {{{1 enddef def StructMembers( # {{{1 - atypename: string, - items: list, - all: bool -): list> + atypename: string, + items: list, + all: bool): list> # Search for members of structure "typename" in tags files. # Return a list with resulting matches. @@ -641,10 +637,9 @@ def StructMembers( # {{{1 enddef def SearchMembers( # {{{1 - matches: list>, - items: list, - all: bool -): list> + matches: list>, + items: list, + all: bool): list> # For matching members, find matches for following items. # When "all" is true find all, otherwise just return 1 if there is any member. @@ -674,7 +669,7 @@ def SearchMembers( # {{{1 endif if typename != '' - res = extendnew(res, StructMembers(typename, items, all)) + res = res->extend(StructMembers(typename, items, all)) else # Use the search command (the declaration itself). var sb: number = line->match('\t\zs/^') @@ -683,7 +678,7 @@ def SearchMembers( # {{{1 var e: number = line ->charidx(match(line, '\<' .. matches[i]['match'] .. '\>', sb)) if e > 0 - res = extendnew(res, line[s : e - 1]->Nextitem(items, 0, all)) + res = res->extend(line[s : e - 1]->Nextitem(items, 0, all)) endif endif endif diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index f6ef9be89..f513a2ac8 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar -" Last Change: 2022 Jan 28 +" Last Change: 2022 Jan 31 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -67,7 +67,7 @@ func dist#ft#FTasmsyntax() endif endfunc -func dist#ft#FTbas() +func dist#ft#FTbas(alt = '') if exists("g:filetype_bas") exe "setf " . g:filetype_bas return @@ -88,6 +88,8 @@ func dist#ft#FTbas() setf qb64 elseif match(lines, '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)') > -1 setf vb + elseif a:alt != '' + exe 'setf ' .. a:alt else setf basic endif diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index d82f7423a..6e8f35b2d 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 8.2. Last change: 2019 Dec 07 +*indent.txt* For Vim version 8.2. Last change: 2022 Jan 31 VIM REFERENCE MANUAL by Bram Moolenaar @@ -778,6 +778,15 @@ You can set the indent for the first line after +
+text +
% END_INDENT diff --git a/runtime/indent/testdir/html.ok b/runtime/indent/testdir/html.ok index c0dfc9dc7..938e965d8 100644 --- a/runtime/indent/testdir/html.ok +++ b/runtime/indent/testdir/html.ok @@ -1,4 +1,4 @@ -" vim: set ft=html sw=4 : +" vim: set ft=html sw=4 ts=8 : " START_INDENT @@ -41,6 +41,11 @@ div#d2 { color: green; } dt text +
+ text +
@@ -50,6 +55,7 @@ div#d2 { color: green; } % START_INDENT % INDENT_EXE let g:html_indent_style1 = "inc" % INDENT_EXE let g:html_indent_script1 = "zero" +% INDENT_EXE let g:html_indent_attribute = 1 % INDENT_EXE call HtmlIndent_CheckUserSettings() @@ -61,6 +67,11 @@ div#d2 { color: green; } var v1 = "v1"; var v2 = "v2"; +
+ text +
% END_INDENT diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index abdce6aea..022439cf3 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 8.2 script " Maintainer: Charles E. Campbell -" Last Change: January 11, 2022 -" Version: 8.2-24 +" Last Change: January 30, 2022 +" Version: 8.2-26 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -78,11 +78,11 @@ syn match vimHLGroup contained "Conceal" syn case match " Function Names {{{2 -syn keyword vimFuncName contained abs argc assert_equal assert_match atan browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filter floor foldlevel function getchangelist getcmdline getcursorcharpos getftime getmarklist getreg gettagstack getwinvar has_key histget hlset input inputsecret isinf job_info join keys line2byte listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winnr win_splitmove -syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath extend finddir fmod foldtext garbagecollect getchar getcmdpos getcwd getftype getmatches getreginfo gettext glob haslocaldir histnr hostname inputdialog insert islocked job_setoptions js_decode len lispindent listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_drop_files test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winrestcmd winwidth -syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extendnew findfile fnameescape foldtextresult get getcharmod getcmdtype getenv getimstatus getmousepos getregtype getwininfo glob2regpat hasmapto hlexists iconv inputlist interrupt isnan job_start js_encode libcall list2blob localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_gui_mouse_event test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline winrestview wordcount -syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdwintype getfontname getjumplist getpid gettabinfo getwinpos globpath histadd hlget indent inputrestore invert items job_status json_decode libcallnr list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight win_move_separator winsaveview writefile -syn keyword vimFuncName contained append asin assert_false assert_report balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcompletion getfperm getline getpos gettabvar getwinposx has histdel hlID index inputsave isdirectory job_getchannel job_stop json_encode line listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor +syn keyword vimFuncName contained abs argc assert_equal assert_match atan browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filter floor foldlevel function getchangelist getcmdline getcursorcharpos getftime getmarklist getreg gettagstack getwinvar has_key histget hlset input inputsecret isdirectory job_getchannel job_stop json_encode line listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winnr win_splitmove +syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath extend finddir fmod foldtext garbagecollect getchar getcmdpos getcwd getftype getmatches getreginfo gettext glob haslocaldir histnr hostname inputdialog insert isinf job_info join keys line2byte listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winrestcmd winwidth +syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extendnew findfile fnameescape foldtextresult get getcharmod getcmdtype getenv getimstatus getmousepos getregtype getwininfo glob2regpat hasmapto hlexists iconv inputlist internal_get_nv_cmdchar islocked job_setoptions js_decode len lispindent listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_event test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline winrestview wordcount +syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdwintype getfontname getjumplist getpid gettabinfo getwinpos globpath histadd hlget indent inputrestore interrupt isnan job_start js_encode libcall list2blob localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight win_move_separator winsaveview writefile +syn keyword vimFuncName contained append asin assert_false assert_report balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcompletion getfperm getline getpos gettabvar getwinposx has histdel hlID index inputsave invert items job_status json_decode libcallnr list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filewritable float2nr foldclosedend funcref getbufvar getcharstr getcurpos getfsize getloclist getqflist gettabwinvar getwinposy "--- syntax here and above generated by mkvimvim --- -- cgit v1.2.1