From 73d8222b31be47d274e2a194e3dde25088c6bb69 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Fri, 14 Feb 2025 17:54:22 +0100 Subject: [PATCH 01/18] runtime(netrw): upstream snapshot of v177 relevant commits: - defaults!: use 'suffixes' for 'g:netrw_sort_sequence' - refactor: remove associated buffer when deliting a file - refactor: s:NetrwLocalRm - refactor: s:NetrwDelete - refactor: s:NetrwLocalRmFile - feat: use vim.notify on neovim - fix: prefer v:lua instead of luaeval for vim.deprecate - chore: remove old batteries closes: #16638 Signed-off-by: Luca Saccarola Signed-off-by: Christian Brabandt --- .../pack/dist/opt/netrw/autoload/netrw.vim | 474 ++++++++---------- .../dist/opt/netrw/autoload/netrw/own.vim | 26 +- .../dist/opt/netrw/autoload/netrwSettings.vim | 2 +- .../dist/opt/netrw/plugin/netrwPlugin.vim | 2 +- 4 files changed, 235 insertions(+), 269 deletions(-) diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim index 243ff8738f..215ab618ff 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -19,7 +19,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v176" +let g:loaded_netrw = "v177" if !has("patch-9.1.1054") && !has('nvim') echoerr 'netrw needs Vim v9.1.1054' @@ -45,109 +45,104 @@ setl cpo&vim " netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number) " (this function can optionally take a list of messages) " Dec 2, 2019 : max errnum currently is 106 -fun! netrw#ErrorMsg(level,msg,errnum) - " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) +function! netrw#ErrorMsg(level, msg, errnum) + if a:level < g:netrw_errorlvl + return + endif - if a:level < g:netrw_errorlvl - " call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g:netrw_errorlvl=".g:netrw_errorlvl) - return - endif - - if a:level == 1 - let level= "**warning** (netrw) " - elseif a:level == 2 - let level= "**error** (netrw) " - else - let level= "**note** (netrw) " - endif - " call Decho("level=".level,'~'.expand("")) - - if g:netrw_use_errorwindow == 2 && exists("*popup_atcursor") - " use popup window - if type(a:msg) == 3 - let msg = [level]+a:msg + if a:level == 1 + let level = "**warning** (netrw) " + elseif a:level == 2 + let level = "**error** (netrw) " else - let msg= level.a:msg + let level = "**note** (netrw) " endif - let s:popuperr_id = popup_atcursor(msg,{}) - let s:popuperr_text= "" - elseif g:netrw_use_errorwindow - " (default) netrw creates a one-line window to show error/warning - " messages (reliably displayed) - " record current window number - let s:winBeforeErr= winnr() - " call Decho("s:winBeforeErr=".s:winBeforeErr,'~'.expand("")) + if g:netrw_use_errorwindow == 2 && exists("*popup_atcursor") + " 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_atcursor(msg, {}) + let s:popuperr_text = "" + elseif has('nvim') + call v:lua.vim.notify(level . a:msg, a:level + 2) + elseif g:netrw_use_errorwindow + " (default) netrw creates a one-line window to show error/warning + " messages (reliably displayed) + + " record current window number + let s:winBeforeErr = winnr() + " call Decho("s:winBeforeErr=".s:winBeforeErr,'~'.expand("")) + + " getting messages out reliably is just plain difficult! + " This attempt splits the current window, creating a one line window. + if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0 + " call Decho("write to NetrwMessage buffer",'~'.expand("")) + exe bufwinnr("NetrwMessage")."wincmd w" + " call Decho("setl ma noro",'~'.expand("")) + setl ma noro + if type(a:msg) == 3 + for msg in a:msg + NetrwKeepj call setline(line("$")+1,level.msg) + endfor + else + NetrwKeepj call setline(line("$")+1,level.a:msg) + endif + NetrwKeepj $ + else + " call Decho("create a NetrwMessage buffer window",'~'.expand("")) + bo 1split + sil! call s:NetrwEnew() + sil! NetrwKeepj call s:NetrwOptionsSafe(1) + setl bt=nofile + NetrwKeepj file NetrwMessage + " call Decho("setl ma noro",'~'.expand("")) + setl ma noro + if type(a:msg) == 3 + for msg in a:msg + NetrwKeepj call setline(line("$")+1,level.msg) + endfor + else + NetrwKeepj call setline(line("$"),level.a:msg) + endif + NetrwKeepj $ + endif + " call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr(),'~'.expand("")) + if &fo !~ '[ta]' + syn clear + syn match netrwMesgNote "^\*\*note\*\*" + syn match netrwMesgWarning "^\*\*warning\*\*" + syn match netrwMesgError "^\*\*error\*\*" + hi link netrwMesgWarning WarningMsg + hi link netrwMesgError Error + endif + " call Decho("setl noma ro bh=wipe",'~'.expand("")) + setl ro nomod noma bh=wipe - " getting messages out reliably is just plain difficult! - " This attempt splits the current window, creating a one line window. - if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0 - " call Decho("write to NetrwMessage buffer",'~'.expand("")) - exe bufwinnr("NetrwMessage")."wincmd w" - " call Decho("setl ma noro",'~'.expand("")) - setl ma noro - if type(a:msg) == 3 - for msg in a:msg - NetrwKeepj call setline(line("$")+1,level.msg) - endfor - else - NetrwKeepj call setline(line("$")+1,level.a:msg) - endif - NetrwKeepj $ else - " call Decho("create a NetrwMessage buffer window",'~'.expand("")) - bo 1split - sil! call s:NetrwEnew() - sil! NetrwKeepj call s:NetrwOptionsSafe(1) - setl bt=nofile - NetrwKeepj file NetrwMessage - " call Decho("setl ma noro",'~'.expand("")) - setl ma noro - if type(a:msg) == 3 - for msg in a:msg - NetrwKeepj call setline(line("$")+1,level.msg) - endfor - else - NetrwKeepj call setline(line("$"),level.a:msg) - endif - NetrwKeepj $ - endif - " call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr(),'~'.expand("")) - if &fo !~ '[ta]' - syn clear - syn match netrwMesgNote "^\*\*note\*\*" - syn match netrwMesgWarning "^\*\*warning\*\*" - syn match netrwMesgError "^\*\*error\*\*" - hi link netrwMesgWarning WarningMsg - hi link netrwMesgError Error - endif - " call Decho("setl noma ro bh=wipe",'~'.expand("")) - setl ro nomod noma bh=wipe + " (optional) netrw will show messages using echomsg. Even if the + " message doesn't appear, at least it'll be recallable via :messages + " redraw! + if a:level == s:WARNING + echohl WarningMsg + elseif a:level == s:ERROR + echohl Error + endif - else - " (optional) netrw will show messages using echomsg. Even if the - " message doesn't appear, at least it'll be recallable via :messages - " redraw! - if a:level == s:WARNING - echohl WarningMsg - elseif a:level == s:ERROR - echohl Error + if type(a:msg) == 3 + for msg in a:msg + unsilent echomsg level.msg + endfor + else + unsilent echomsg level.a:msg + endif + + echohl None endif - - if type(a:msg) == 3 - for msg in a:msg - unsilent echomsg level.msg - endfor - else - unsilent echomsg level.a:msg - endif - - " call Decho("echomsg ***netrw*** ".a:msg,'~'.expand("")) - echohl None - endif - - " call Dret("netrw#ErrorMsg") -endfun +endfunction " --------------------------------------------------------------------- " s:NetrwInit: initializes variables if they haven't been defined {{{2 @@ -523,11 +518,9 @@ call s:NetrwInit("g:netrw_sort_by" , "name") " alternatives: date call s:NetrwInit("g:netrw_sort_options" , "") call s:NetrwInit("g:netrw_sort_direction", "normal") " alternative: reverse (z y x ...) if !exists("g:netrw_sort_sequence") - if has("unix") - let g:netrw_sort_sequence= '[\/]$,\,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$' - else - let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$' - endif + let g:netrw_sort_sequence = !empty(&suffixes) + \ ? printf('[\/]$,*,\%(%s\)[*@]\=$', &suffixes->split(',')->map('escape(v:val, ".*$~")')->join('\|')) + \ : '[\/]$,*' endif call s:NetrwInit("g:netrw_special_syntax" , 0) call s:NetrwInit("g:netrw_ssh_browse_reject", '^total\s\+\d\+$') @@ -4893,7 +4886,7 @@ fun! s:NetrwBrowseUpDir(islocal) endfun " --------------------------------------------------------------------- -" netrw#BrowseX: (implements "x" and "gx") executes a special "viewer" script or program for the {{{2 +" netrw#BrowseX: (implements "x") executes a special "viewer" script or program for the {{{2 " given filename; typically this means given their extension. " 0=local, 1=remote fun! netrw#BrowseX(fname,remote) @@ -4995,17 +4988,6 @@ fun! netrw#BrowseX(fname,remote) let &aw= awkeep endfun -" --------------------------------------------------------------------- -" netrw#BrowseXVis: used by gx in visual mode to select a file for browsing {{{2 -fun! netrw#BrowseXVis() - let dict={} - let dict.a=[getreg('a'), getregtype('a')] - norm! gv"ay - let gxfile= @a - call s:RestoreRegister(dict) - call netrw#BrowseX(gxfile,netrw#CheckIfRemote(gxfile)) -endfun - " --------------------------------------------------------------------- " s:NetrwBufRename: renames a buffer without the side effect of retaining an unlisted buffer having the old name {{{2 " Using the file command on a "[No Name]" buffer does not seem to cause the old "[No Name]" buffer @@ -5316,7 +5298,7 @@ endfun " s:NetrwHome: this function determines a "home" for saving bookmarks and history {{{2 function! s:NetrwHome() if has('nvim') - let home = netrw#own#JoinPath(stdpath('state'), 'netrw') + let home = netrw#own#PathJoin(stdpath('state'), 'netrw') elseif exists("g:netrw_home") let home = expand(g:netrw_home) else @@ -6350,7 +6332,7 @@ fun! s:NetrwMarkFileCopy(islocal,...) endif " copy marked files while within the same directory (ie. allow renaming) - if s:StripTrailingSlash(simplify(s:netrwmftgt)) == s:StripTrailingSlash(simplify(b:netrw_curdir)) + if simplify(s:netrwmftgt) ==# simplify(b:netrw_curdir) if len(s:netrwmarkfilelist_{bufnr('%')}) == 1 " only one marked file " call Decho("case: only one marked file",'~'.expand("")) @@ -10237,131 +10219,124 @@ endfun " --------------------------------------------------------------------- " s:NetrwLocalRm: {{{2 -fun! s:NetrwLocalRm(path) range - if !exists("w:netrw_bannercnt") - let w:netrw_bannercnt= b:netrw_bannercnt - endif +function! s:NetrwLocalRm(path) range + if !exists("w:netrw_bannercnt") + let w:netrw_bannercnt = b:netrw_bannercnt + endif - " preparation for removing multiple files/directories - let ykeep = @@ - let ret = 0 - let all = 0 - let svpos = winsaveview() + " preparation for removing multiple files/directories + let ykeep = @@ + let ret = 0 + let all = 0 + let svpos = winsaveview() - if exists("s:netrwmarkfilelist_{bufnr('%')}") - " remove all marked files - for fname in s:netrwmarkfilelist_{bufnr("%")} - let ok= s:NetrwLocalRmFile(a:path,fname,all) - if ok =~# 'q\%[uit]' || ok == "no" - break - elseif ok =~# '^a\%[ll]$' - let all= 1 - endif - endfor - call s:NetrwUnMarkFile(1) + if exists("s:netrwmarkfilelist_{bufnr('%')}") + " remove all marked files + for fname in s:netrwmarkfilelist_{bufnr("%")} + let ok = s:NetrwLocalRmFile(a:path, fname, all) + if ok =~# '^a\%[ll]$' + let all = 1 + elseif ok =~# "n\%[o]" + break + endif + endfor + call s:NetrwUnMarkFile(1) - else - " remove (multiple) files and directories + else + " remove (multiple) files and directories - let keepsol= &l:sol - setl nosol - let ctr = a:firstline - while ctr <= a:lastline - exe "NetrwKeepj ".ctr + let keepsol = &l:sol + setl nosol + let ctr = a:firstline + while ctr <= a:lastline + exe "NetrwKeepj ".ctr - " sanity checks - if line(".") < w:netrw_bannercnt - let ctr= ctr + 1 - continue - endif - let curword= s:NetrwGetWord() - if curword == "./" || curword == "../" - let ctr= ctr + 1 - continue - endif - let ok= s:NetrwLocalRmFile(a:path,curword,all) - if ok =~# 'q\%[uit]' || ok == "no" - break - elseif ok =~# '^a\%[ll]$' - let all= 1 - endif - let ctr= ctr + 1 - endwhile - let &l:sol= keepsol - endif + " sanity checks + if line(".") < w:netrw_bannercnt + let ctr = ctr + 1 + continue + endif - " refresh the directory - if bufname("%") != "NetrwMessage" - NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) - NetrwKeepj call winrestview(svpos) - endif - let @@= ykeep -endfun + let curword = s:NetrwGetWord() + if curword == "./" || curword == "../" + let ctr = ctr + 1 + continue + endif + + let ok = s:NetrwLocalRmFile(a:path, curword, all) + if ok =~# '^a\%[ll]$' + let all = 1 + elseif ok =~# "n\%[o]" + break + endif + + let ctr = ctr + 1 + endwhile + + let &l:sol = keepsol + endif + + " refresh the directory + if bufname("%") != "NetrwMessage" + NetrwKeepj call s:NetrwRefresh(1, s:NetrwBrowseChgDir(1, './', 0)) + NetrwKeepj call winrestview(svpos) + endif + + let @@= ykeep +endfunction " --------------------------------------------------------------------- " s:NetrwLocalRmFile: remove file fname given the path {{{2 " Give confirmation prompt unless all==1 -fun! s:NetrwLocalRmFile(path,fname,all) - " call Dfunc("s:NetrwLocalRmFile(path<".a:path."> fname<".a:fname."> all=".a:all) +function! s:NetrwLocalRmFile(path, fname, all) + let all = a:all + let ok = "" + let dir = 0 + NetrwKeepj norm! 0 + let rmfile = s:NetrwFile(s:ComposePath(a:path, escape(a:fname, '\\')))->fnamemodify(':.') - let all= a:all - let ok = "" - NetrwKeepj norm! 0 - let rmfile= s:NetrwFile(s:ComposePath(a:path,escape(a:fname, '\\'))) - " call Decho("rmfile<".rmfile.">",'~'.expand("")) + " if not a directory + if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$') + let msg = "Confirm deletion of file <%s> [{y(es)},n(o),a(ll)]: " + else + let msg = "Confirm *recursive* deletion of directory <%s> [{y(es)},n(o),a(ll)]: " + let dir = 1 + endif - if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$') - " attempt to remove file - " call Decho("attempt to remove file<".rmfile.">",'~'.expand("")) + " Ask confirmation if !all - echohl Statement - call inputsave() - let ok= input("Confirm deletion of file <".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") - call inputrestore() - echohl NONE - if ok == "" - let ok="no" - endif - " call Decho("response: ok<".ok.">",'~'.expand("")) - let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') - " call Decho("response: ok<".ok."> (after sub)",'~'.expand("")) - if ok =~# '^a\%[ll]$' - let all= 1 - endif + echohl Statement + call inputsave() + let ok = input(printf(msg, rmfile)) + call inputrestore() + echohl NONE + if ok =~# '^a\%[ll]$' || ok =~# '^y\%[es]$' + let all = 1 + else + let ok = 'no' + endif endif - if all || ok =~# '^y\%[es]$' || ok == "" - let ret= s:NetrwDelete(rmfile) - " call Decho("errcode=".v:shell_error." ret=".ret,'~'.expand("")) + if !dir && (all || empty(ok)) + " This works because delete return 0 if successful + if s:NetrwDelete(rmfile) + call netrw#ErrorMsg(s:ERROR, printf("unable to delete <%s>!", rmfile), 103) + else + " Remove file only if there are no pending changes + execute printf('silent! bwipeout %s', rmfile) + endif + + elseif dir && (all || empty(ok)) + " Remove trailing / + let rmfile = substitute(rmfile, '[\/]$', '', 'e') + if delete(rmfile, "rf") + call netrw#ErrorMsg(s:ERROR, printf("unable to delete directory <%s>!", rmfile), 103) + endif + endif - else - " attempt to remove directory - if !all - echohl Statement - call inputsave() - let ok= input("Confirm *recursive* deletion of directory <".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ") - call inputrestore() - let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') - if ok == "" - let ok="no" - endif - if ok =~# '^a\%[ll]$' - let all= 1 - endif - endif - let rmfile= substitute(rmfile,'[\/]$','','e') - - if all || ok =~# '^y\%[es]$' || ok == "" - if delete(rmfile,"rf") - call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".rmfile.">!",103) - endif - endif - endif - - " call Dret("s:NetrwLocalRmFile ".ok) - return ok -endfun + return ok +endfunction " ===================================================================== " Support Functions: {{{1 @@ -10483,13 +10458,6 @@ fun! netrw#WinPath(path) return path endfun -" --------------------------------------------------------------------- -" s:StripTrailingSlash: removes trailing slashes from a path {{{2 -fun! s:StripTrailingSlash(path) - " remove trailing slash - return substitute(a:path, '[/\\]$', '', 'g') -endfun - " --------------------------------------------------------------------- " s:NetrwBadd: adds marked files to buffer list or vice versa {{{2 " cb : bl2mf=0 add marked files to buffer list @@ -10611,9 +10579,9 @@ fun! s:FileReadable(fname) " call Dfunc("s:FileReadable(fname<".a:fname.">)") if g:netrw_cygwin - let ret= filereadable(s:NetrwFile(substitute(a:fname,g:netrw_cygdrive.'/\(.\)','\1:/',''))) + let ret = filereadable(s:NetrwFile(substitute(a:fname,g:netrw_cygdrive.'/\(.\)','\1:/',''))) else - let ret= filereadable(s:NetrwFile(a:fname)) + let ret = filereadable(s:NetrwFile(a:fname)) endif " call Dret("s:FileReadable ".ret) @@ -10872,31 +10840,24 @@ endfun " Uses Steve Hall's idea to insure that Windows paths stay " acceptable. No effect on Unix paths. " Examples of use: let result= s:NetrwDelete(path) -fun! s:NetrwDelete(path) - " call Dfunc("s:NetrwDelete(path<".a:path.">)") +function! s:NetrwDelete(path) + let path = netrw#WinPath(a:path) - let path = netrw#WinPath(a:path) - if !g:netrw_cygwin && has("win32") - if exists("+shellslash") - let sskeep= &shellslash - setl noshellslash - let result = delete(path) - let &shellslash = sskeep + if !g:netrw_cygwin && has("win32") && exists("+shellslash") + let sskeep = &shellslash + setl noshellslash + let result = delete(path) + let &shellslash = sskeep else - " call Decho("exe let result= ".a:cmd."('".path."')",'~'.expand("")) - let result= delete(path) + let result = delete(path) endif - else - " call Decho("let result= delete(".path.")",'~'.expand("")) - let result= delete(path) - endif - if result < 0 - NetrwKeepj call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71) - endif - " call Dret("s:NetrwDelete ".result) - return result -endfun + if result < 0 + NetrwKeepj call netrw#ErrorMsg(s:WARNING, "delete(".path.") failed!", 71) + endif + + return result +endfunction " --------------------------------------------------------------------- " s:NetrwBufRemover: removes a buffer that: {{{2s @@ -11650,7 +11611,7 @@ fun! s:UserMaps(islocal,funcname) endif endfun -" Deprecated: {{{ +" Deprecated: {{{1 function! netrw#Launch(args) call netrw#own#Deprecate('netrw#Launch', 'v180', {'vim': 'dist#vim9#Launch', 'nvim': 'vim.system'}) @@ -11665,14 +11626,11 @@ function! netrw#Open(file) endfunction " }}} -" ========================== " Settings Restoration: {{{1 " ========================== let &cpo= s:keepcpo unlet s:keepcpo -" =============== -" Modelines: {{{1 -" =============== +" }}} " vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw/own.vim b/runtime/pack/dist/opt/netrw/autoload/netrw/own.vim index 8f05b6a0ad..9fdf85a8f8 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw/own.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw/own.vim @@ -2,12 +2,14 @@ " THIS FUNCTIONS DON'T COMMIT TO ANY BACKWARDS COMPATABILITY. SO CHANGES AND " BREAKAGES IF USED OUTSIDE OF NETRW.VIM ARE EXPECTED. +" General: {{{ + let s:deprecation_msgs = [] function! netrw#own#Deprecate(name, version, alternatives) " If running on neovim use vim.deprecate if has('nvim') let s:alternative = a:alternatives->get('nvim', v:null) - call luaeval('vim.deprecate(unpack(_A)) and nil', [a:name, s:alternative, a:version, "netrw", v:false]) + call v:lua.vim.deprecate(a:name, s:alternative, a:version, "netrw", v:false) return endif @@ -27,8 +29,20 @@ function! netrw#own#Deprecate(name, version, alternatives) call add(s:deprecation_msgs, a:name) endfunction +function! netrw#own#Open(file) abort + if has('nvim') + call luaeval('vim.ui.open(_A[1]) and nil', [a:file]) + else + call dist#vim9#Open(a:file) + endif +endfunction + +" }}} +" Path Utilities: {{{ + let s:slash = &shellslash ? '/' : '\' -function! netrw#own#JoinPath(...) + +function! netrw#own#PathJoin(...) let path = "" for arg in a:000 @@ -42,12 +56,6 @@ function! netrw#own#JoinPath(...) return path endfunction -function! netrw#own#Open(file) abort - if has('nvim') - call luaeval('vim.ui.open(_A[1]) and nil', [a:file]) - else - call dist#vim9#Open(a:file) - endif -endfunction +" }}} " vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim index 2d1787f541..ba143ed808 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim @@ -15,7 +15,7 @@ if &cp || exists("g:loaded_netrwSettings") finish endif -let g:loaded_netrwSettings = "v176" +let g:loaded_netrwSettings = "v177" " NetrwSettings: {{{ diff --git a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim index ec133d0a4b..76a91b44ce 100644 --- a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim +++ b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim @@ -15,7 +15,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v176" +let g:loaded_netrwPlugin = "v177" let s:keepcpo = &cpo set cpo&vim From faf4112cdc60ca126986da15148f78337f126cf7 Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 14 Feb 2025 17:57:52 +0100 Subject: [PATCH 02/18] runtime(doc): document ComplMatchIns highlight for insert-completion closes: #16636 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/insert.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index a5d245f50d..71ba061db3 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 9.1. Last change: 2024 Dec 31 +*insert.txt* For Vim version 9.1. Last change: 2025 Feb 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -657,6 +657,11 @@ CTRL-N (next), and CTRL-P (previous). To get the current completion information, |complete_info()| can be used. Also see the 'infercase' option if you want to adjust the case of the match. +When inserting a selected candidate word from the |popup-menu|, the part of +the candidate word that does not match the query is highlighted using +|hl-ComplMatchIns|. If fuzzy is enabled in 'completopt', highlighting will not +be applied. + *complete_CTRL-E* When completion is active you can use CTRL-E to stop it and go back to the originally typed text. The CTRL-E will not be inserted. From b6c900be9ce49f688d3a03c2767dedb48e4f23ae Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 14 Feb 2025 17:59:31 +0100 Subject: [PATCH 03/18] patch 9.1.1112: Inconsistencies in get_next_or_prev_match() Problem: Inconsistencies in get_next_or_prev_match() (after 9.1.1109). Solution: Change "file" to "entry" or "match" in comments. Use the same order of branches for PAGEUP and PAGEDOWN (zeertzjq). closes: #16633 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/cmdexpand.c | 23 ++++++++++++----------- src/version.c | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/cmdexpand.c b/src/cmdexpand.c index bd9a410ac3..f707b1d586 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -737,21 +737,22 @@ get_next_or_prev_match(int mode, expand_T *xp) int findex = xp->xp_selected; int ht; - // When no files found, return NULL + // When no matches found, return NULL if (xp->xp_numfiles <= 0) return NULL; if (mode == WILD_PREV) { - // Select last file if at start + // Select the last entry if at original text if (findex == -1) findex = xp->xp_numfiles; + // Otherwise select the previous entry --findex; } else if (mode == WILD_NEXT) { - // Select next file - findex = findex + 1; + // Select the next entry + ++findex; } else // WILD_PAGEDOWN or WILD_PAGEUP { @@ -765,7 +766,7 @@ get_next_or_prev_match(int mode, expand_T *xp) if (findex == 0) // at the first entry, don't select any entries findex = -1; - else if (findex == -1) + else if (findex < 0) // no entry is selected. select the last entry findex = xp->xp_numfiles - 1; else @@ -774,12 +775,12 @@ get_next_or_prev_match(int mode, expand_T *xp) } else // mode == WILD_PAGEDOWN { - if (findex < 0) - // no entry is selected, select the first entry - findex = 0; - else if (findex >= xp->xp_numfiles - 1) + if (findex >= xp->xp_numfiles - 1) // at the last entry, don't select any entries findex = -1; + else if (findex < 0) + // no entry is selected, select the first entry + findex = 0; else // go down by the pum height findex = MIN(findex + ht, xp->xp_numfiles - 1); @@ -789,7 +790,7 @@ get_next_or_prev_match(int mode, expand_T *xp) // Handle wrapping around if (findex < 0 || findex >= xp->xp_numfiles) { - // If original string exists, return to it when wrapping around + // If original text exists, return to it when wrapping around if (xp->xp_orig != NULL) findex = -1; else @@ -808,7 +809,7 @@ get_next_or_prev_match(int mode, expand_T *xp) cmd_showtail); xp->xp_selected = findex; - // Return the original string or the selected match + // Return the original text or the selected match return vim_strsave(findex == -1 ? xp->xp_orig : xp->xp_files[findex]); } diff --git a/src/version.c b/src/version.c index cbd973621a..e7efb2142f 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1112, /**/ 1111, /**/ From e67eff2e24f7289c5a40c90253b0b01910ab898d Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 14 Feb 2025 18:01:25 +0100 Subject: [PATCH 04/18] patch 9.1.1113: tests: Test_terminal_builtin_without_gui waits 2 seconds Problem: tests: Test_terminal_builtin_without_gui waits 2 seconds Solution: add --not-a-term to remove the annoying 2s delay in error message when Vim detects that stdio are not from a terminal (Yee Cheng Chin) closes: #16635 Signed-off-by: Yee Cheng Chin Signed-off-by: Christian Brabandt --- src/testdir/test_termcodes.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index db98a70b48..48e5250a0b 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2750,7 +2750,7 @@ func Test_terminal_builtin_without_gui() CheckNotMSWindows " builtin_gui should not be output by :set term=xxx - let output = systemlist("TERM=dumb " .. v:progpath .. " --clean -c ':set t_ti= t_te=' -c 'set term=xxx' -c ':q!'") + let output = systemlist("TERM=dumb " .. v:progpath .. " --not-a-term --clean -c ':set t_ti= t_te=' -c 'set term=xxx' -c ':q!'") redraw! call map(output, {_, val -> trim(val)}) call assert_equal(-1, index(output, 'builtin_gui')) diff --git a/src/version.c b/src/version.c index e7efb2142f..5fe62548ff 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1113, /**/ 1112, /**/ From 3f60114236cff60caf117fd708476fd4ff72252b Mon Sep 17 00:00:00 2001 From: Vladyslav Rehan Date: Sat, 15 Feb 2025 09:59:57 +0100 Subject: [PATCH 05/18] runtime(keymap): Add ukrainian-enhanced keymap The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim using jcuken Windows layout. Original file is made by Ivan Korneliuk and can be found at https://github.com/vansha/ukrainian-enhanced.vim. It is being added here with the permission of the author. There is another ukrainian layout already in Vim, namely the keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one differs in way it maps numeric keys. It uses values usual for Windows users. closes: #16628 Signed-off-by: Vladyslav Rehan Signed-off-by: Ivan Korneliuk Signed-off-by: Christian Brabandt --- .github/MAINTAINERS | 1 + runtime/keymap/ukrainian-enhanced.vim | 87 +++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 runtime/keymap/ukrainian-enhanced.vim diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 9372e3310d..cd16c353a5 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -406,6 +406,7 @@ runtime/keymap/armenian-eastern_utf-8.vim @blinskey runtime/keymap/armenian-western_utf-8.vim @blinskey runtime/keymap/russian-typograph.vim @RestorerZ runtime/keymap/tamil_tscii.vim @yegappan +runtime/keymap/ukrainian-enhanced.vim @Dolfost runtime/lang/menu_en_gb.latin1.vim @mrdubya runtime/lang/menu_ru_ru.cp1251.vim @RestorerZ runtime/lang/menu_ru_ru.koi8-r.vim @RestorerZ diff --git a/runtime/keymap/ukrainian-enhanced.vim b/runtime/keymap/ukrainian-enhanced.vim new file mode 100644 index 0000000000..b71e33527e --- /dev/null +++ b/runtime/keymap/ukrainian-enhanced.vim @@ -0,0 +1,87 @@ +" Vim Keymap file for ukrainian characters MS Windows enhanced variant. +" This file is based on russian-jcukenwin.vim by Artem Chuprina . +" Keymap has been originally created by Ivan Korneliuk . + +" Maintainer: Vladyslav Rehan +" Last Changed: 2025 feb 13 + +scriptencoding utf-8 + +let b:keymap_name = "uk" + +loadkeymap +~ ’ RIGHT SINGLE QUOTATION MARK +` ' APOSTROPHE +F А CYRILLIC CAPITAL LETTER A +< Б CYRILLIC CAPITAL LETTER BE +D В CYRILLIC CAPITAL LETTER VE +U Г CYRILLIC CAPITAL LETTER GHE +| Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN +L Д CYRILLIC CAPITAL LETTER DE +T Е CYRILLIC CAPITAL LETTER IE +: Ж CYRILLIC CAPITAL LETTER ZHE +P З CYRILLIC CAPITAL LETTER ZE +B И CYRILLIC CAPITAL LETTER I +S І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +} Ї CYRILLIC CAPITAL LETTER YI +Q Й CYRILLIC CAPITAL LETTER SHORT I +R К CYRILLIC CAPITAL LETTER KA +K Л CYRILLIC CAPITAL LETTER EL +V М CYRILLIC CAPITAL LETTER EM +Y Н CYRILLIC CAPITAL LETTER EN +J О CYRILLIC CAPITAL LETTER O +G П CYRILLIC CAPITAL LETTER PE +H Р CYRILLIC CAPITAL LETTER ER +C С CYRILLIC CAPITAL LETTER ES +N Т CYRILLIC CAPITAL LETTER TE +E У CYRILLIC CAPITAL LETTER U +A Ф CYRILLIC CAPITAL LETTER EF +{ Х CYRILLIC CAPITAL LETTER HA +W Ц CYRILLIC CAPITAL LETTER TSE +X Ч CYRILLIC CAPITAL LETTER CHE +I Ш CYRILLIC CAPITAL LETTER SHA +O Щ CYRILLIC CAPITAL LETTER SHCHA +M Ь CYRILLIC CAPITAL LETTER SOFT SIGN +\" Є CYRILLIC CAPITAL LETTER UKRAINIAN IE +> Ю CYRILLIC CAPITAL LETTER YU +Z Я CYRILLIC CAPITAL LETTER YA +f а CYRILLIC SMALL LETTER A +, б CYRILLIC SMALL LETTER BE +d в CYRILLIC SMALL LETTER VE +u г CYRILLIC SMALL LETTER GHE +\\ ґ CYRILLIC SMALL LETTER GHE WITH UPTURN +l д CYRILLIC SMALL LETTER DE +t е CYRILLIC SMALL LETTER IE +; ж CYRILLIC SMALL LETTER ZHE +p з CYRILLIC SMALL LETTER ZE +b и CYRILLIC SMALL LETTER I +s і CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +] ї CYRILLIC SMALL LETTER YI +q й CYRILLIC SMALL LETTER SHORT I +r к CYRILLIC SMALL LETTER KA +k л CYRILLIC SMALL LETTER EL +v м CYRILLIC SMALL LETTER EM +y н CYRILLIC SMALL LETTER EN +j о CYRILLIC SMALL LETTER O +g п CYRILLIC SMALL LETTER PE +h р CYRILLIC SMALL LETTER ER +c с CYRILLIC SMALL LETTER ES +n т CYRILLIC SMALL LETTER TE +e у CYRILLIC SMALL LETTER U +a ф CYRILLIC SMALL LETTER EF +[ х CYRILLIC SMALL LETTER HA +w ц CYRILLIC SMALL LETTER TSE +x ч CYRILLIC SMALL LETTER CHE +i ш CYRILLIC SMALL LETTER SHA +o щ CYRILLIC SMALL LETTER SHCHA +m ь CYRILLIC SMALL LETTER SOFT SIGN +' є CYRILLIC SMALL LETTER UKRAINIAN IE +. ю CYRILLIC SMALL LETTER YU +z я CYRILLIC SMALL LETTER YA +@ " QUOTATION MARK +# № NUMERO SIGN +$ ; SEMICOLON +^ : COLON +& ? QUESTION MARK +/ . FULL STOP +? , COMMA From 27822a0441118133d08d6f1946d3a1598b2c15bd Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 16 Feb 2025 09:30:00 +0100 Subject: [PATCH 06/18] patch 9.1.1114: enabling termguicolors automatically confuses users Problem: enabling termguicolors automatically confuses users. Since querying the terminal for the RGB flag happens asynchronously, enabling termguicolors is noticeable by users as the highlighting changes and is therefore unexpected. (after v9.1.1054) Solution: comment out that part for now. We may need another way to enable this in the future. fixes: #16539 fixes: #16568 fixes: #16649 Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 11 +---------- runtime/doc/version9.txt | 2 -- src/term.c | 8 +++++++- src/version.c | 2 ++ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 94fb73995a..1a72e650c8 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*options.txt* For Vim version 9.1. Last change: 2025 Feb 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -8515,15 +8515,6 @@ A jump table for the options with a short description can be found at |Q_op|. When on, uses |highlight-guifg| and |highlight-guibg| attributes in the terminal (thus using 24-bit color). - Will automatically be enabled, if Vim detects that it runs in a - capable terminal (when the terminal supports the RGB terminfo - capability or when the number of colors |t_Co| supported by the - terminal is 0x1000000, e.g. with $TERM=xterm-direct). Due to the async - nature of querying the terminal, enabling this automatically is - noticable. Use > - set notermguicolors -< to explicitly disable. - Requires a ISO-8613-3 compatible terminal. If setting this option does not work (produces a colorless UI) reading |xterm-true-color| might help. diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index fbe9b9865c..de38d08e2e 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -41583,8 +41583,6 @@ Adjusted default values ~ increased to 12pt to accomodate modern high-dpi monitors - the default value of the 'keyprotocol' option has been updated and support for the ghostty terminal emulator (using kitty protocol) has been added -- 'termguicolors' is automatically enabled if the terminal supports the RGB - terminfo capability or supports 0x1000000 colors *changed-9.2* Changed~ diff --git a/src/term.c b/src/term.c index 318b982d75..ea4c22d8b5 100644 --- a/src/term.c +++ b/src/term.c @@ -1661,10 +1661,12 @@ set_color_count(int nr) sprintf((char *)nr_colors, "%d", t_colors); else *nr_colors = NUL; +#if 0 #ifdef FEAT_TERMGUICOLORS // xterm-direct, enable termguicolors, when it wasn't set yet if (t_colors == 0x1000000 && !p_tgc_set) set_option_value((char_u *)"termguicolors", 1L, NULL, 0); +#endif #endif set_string_option_direct((char_u *)"t_Co", -1, nr_colors, OPT_FREE, 0); } @@ -1701,7 +1703,9 @@ static char *(key_names[]) = # ifdef FEAT_TERMRESPONSE // Do those ones first, both may cause a screen redraw. "Co", - "RGB", + // disabled, because it switches termguicolors, but that + // is noticable and confuses users + // "RGB", # endif "ku", "kd", "kr", "kl", "#2", "#4", "%i", "*7", @@ -7197,6 +7201,7 @@ got_code_from_term(char_u *code, int len) #endif may_adjust_color_count(val); } +#if 0 #ifdef FEAT_TERMGUICOLORS // when RGB result comes back, it is supported when the result contains an '=' else if (name[0] == 'R' && name[1] == 'G' && name[2] == 'B' && code[9] == '=') @@ -7213,6 +7218,7 @@ got_code_from_term(char_u *code, int len) set_option_value((char_u *)"termguicolors", 1L, NULL, 0); } } +#endif #endif else { diff --git a/src/version.c b/src/version.c index 5fe62548ff..deff163335 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1114, /**/ 1113, /**/ From c0f0e2380e5954f4a52a131bf6b8499838ad1dae Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 16 Feb 2025 16:06:38 +0100 Subject: [PATCH 07/18] patch 9.1.1115: [security]: use-after-free in str_to_reg() Problem: [security]: use-after-free in str_to_reg() (fizz-is-on-the-way) Solution: when redirecting the :display command, check that one does not output to the register being displayed Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-63p5-mwg2-787v Signed-off-by: Christian Brabandt --- src/register.c | 3 ++- src/testdir/test_registers.vim | 20 ++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/register.c b/src/register.c index 0df05054ca..a9630f8ef5 100644 --- a/src/register.c +++ b/src/register.c @@ -2420,7 +2420,8 @@ ex_display(exarg_T *eap) #ifdef FEAT_EVAL if (name == MB_TOLOWER(redir_reg) - || (redir_reg == '"' && yb == y_previous)) + || (vim_strchr((char_u *)"\"*+", redir_reg) != NULL && + (yb == y_previous || yb == &y_regs[0]))) continue; // do not list register being written to, the // pointer can be freed #endif diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index 1177c2395d..1312702266 100644 --- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -1102,4 +1102,24 @@ func Test_clipboard_regs_not_working2() let $DISPLAY=display endfunc +" This caused use-after-free +func Test_register_redir_display() + " don't touch the clipboard, so only perform this, when the clipboard is not working + if has("clipboard_working") + throw "Skipped: skip touching the clipboard register!" + endif + let @"='' + redir @+> + disp +" + redir END + call assert_equal("\nType Name Content", getreg('+')) + let a = [getreg('1'), getregtype('1')] + let @1='register 1' + redir @+ + disp 1 + redir END + call assert_equal("register 1", getreg('1')) + call setreg(1, a[0], a[1]) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index deff163335..0c85695b90 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1115, /**/ 1114, /**/ From 44831e4beaa8340ee2e3cc51c9c8882784b0d142 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 16 Feb 2025 16:15:50 +0100 Subject: [PATCH 08/18] runtime(doc): Update the 'specifies' keyword documentation, slightly reformat closes: #16648 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- runtime/doc/vim9class.txt | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index 5e5c28e9e3..7ba91e7d92 100644 --- a/runtime/doc/vim9class.txt +++ b/runtime/doc/vim9class.txt @@ -1,4 +1,4 @@ -*vim9class.txt* For Vim version 9.1. Last change: 2025 Feb 11 +*vim9class.txt* For Vim version 9.1. Last change: 2025 Feb 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -52,7 +52,6 @@ An interface is used to specify properties of an object: The class hierarchy allows for single inheritance. Otherwise interfaces are to be used where needed. - Class modeling ~ You can model classes any way you like. Keep in mind what you are building, @@ -122,7 +121,6 @@ using the object name followed by a dot following by the member: > A class name cannot be used as an expression. A class name cannot be used in the left-hand-side of an assignment. - Object variable write access ~ *read-only-variable* Now try to change an object variable directly: > @@ -626,13 +624,15 @@ once. They can appear in any order, although this order is recommended: > extends ClassName implements InterfaceName, OtherInterface specifies SomeInterface -< *E1355* *E1369* +< +The "specifies" feature is currently not implemented. + + *E1355* *E1369* Each variable and method name can be used only once. It is not possible to define a method with the same name and different type of arguments. It is not possible to use a public and protected member variable with the same name. An object variable name used in a super class cannot be reused in a child class. - Object Variable Initialization ~ If the type of a variable is not explicitly specified in a class, then it is @@ -689,13 +689,12 @@ A class can implement one or more interfaces. The "implements" keyword can only appear once *E1350* . Multiple interfaces can be specified, separated by commas. Each interface name can appear only once. *E1351* - A class defining an interface ~ *specifies* A class can declare its interface, the object variables and methods, with a named interface. This avoids the need for separately specifying the interface, which is often done in many languages, especially Java. - +TODO: This is currently not implemented. Items in a class ~ *E1318* *E1325* *E1388* @@ -736,25 +735,25 @@ Some of the builtin functions like |empty()|, |len()| and |string()| can be used with an object. An object can implement a method with the same name as these builtin functions to return an object-specific value. - *E1412* + *E1412* The following builtin methods are supported: - *object-empty()* + *object-empty()* empty() Invoked by the |empty()| function to check whether an object is empty. If this method is missing, then true is returned. This method should not accept any arguments and must return a boolean. - *object-len()* + *object-len()* len() Invoked by the |len()| function to return the length of an object. If this method is missing in the class, then an error is given and zero is returned. This method should not accept any arguments and must return a number. - *object-string()* + *object-string()* string() Invoked by the |string()| function to get a textual representation of an object. Also used by the |:echo| command for an object. If this method is missing in the class, then a built-in default textual representation is used. This method should not accept any arguments and must return a string. - *E1413* + *E1413* A class method cannot be used as a builtin method. Defining an interface ~ @@ -786,7 +785,6 @@ An interface can only be defined in a |Vim9| script file. *E1342* An interface cannot "implement" another interface but it can "extend" another interface. *E1381* - null object ~ When a variable is declared to have the type of an object, but it is not @@ -795,7 +793,6 @@ does not know what class was supposed to be used. Vim then cannot check if a variable name is correct and you will get a "Using a null object" error, even when the variable name is invalid. *E1360* *E1362* - Default constructor ~ *default-constructor* In case you define a class without a new() method, one will be automatically @@ -1118,7 +1115,6 @@ For |Vim9| script using the same method name for all constructors seemed like the right choice, and by calling it new() the relation between the caller and the method being called is obvious. - No overloading of the constructor ~ In Vim script, both legacy and |Vim9| script, there is no overloading of @@ -1139,7 +1135,6 @@ That way multiple constructors with different arguments are possible, while it is very easy to see which constructor is being used. And the type of arguments can be properly checked. - No overloading of methods ~ Same reasoning as for the constructor: It is often not obvious what type @@ -1148,7 +1143,6 @@ actually being called. Better just give the methods a different name, then type checking will make sure it works as you intended. This rules out polymorphism, which we don't really need anyway. - Single inheritance and interfaces ~ Some languages support multiple inheritance. Although that can be useful in @@ -1164,7 +1158,6 @@ it will be checked if that change was also changed. The mechanism to assume a class implements an interface just because the methods happen to match is brittle and leads to obscure problems, let's not do that. - Using "this.variable" everywhere ~ The object variables in various programming languages can often be accessed in @@ -1183,7 +1176,6 @@ variables. Simple and consistent. When looking at the code inside a class it's also directly clear which variable references are object variables and which aren't. - Using class variables ~ Using "static variable" to declare a class variable is very common, nothing @@ -1197,7 +1189,6 @@ the class. This has two problems: The class name can be rather long, taking up quite a bit of space, and when the class is renamed all these places need to be changed too. - Declaring object and class variables ~ The main choice is whether to use "var" as with variable declarations. @@ -1251,7 +1242,6 @@ function declaration syntax for class/object variables and methods. Vim9 also reuses the general function declaration syntax for methods. So, for the sake of consistency, we require "var" in these declarations. - Using "ClassName.new()" to construct an object ~ Many languages use the "new" operator to create an object, which is actually @@ -1315,7 +1305,6 @@ An alternative would have been using the "protected" keyword, just like "public" changes the access in the other direction. Well, that's just to reduce the number of keywords. - No private object variables ~ Some languages provide several ways to control access to object variables. From b5f463ce4f2bf17c91f1f5b04f9de9ee27753cf3 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 16 Feb 2025 16:25:24 +0100 Subject: [PATCH 09/18] patch 9.1.1116: Vim9: super not supported in lambda expressions Problem: Vim9: super not supported in lambda expressions (Aliaksei Budavei) Solution: Support using the super keyword in a closure in an instance method (Yegappan Lakshmanan) fixes: #16586 closes: #16647 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 244 +++++++++++++++++++++----------- src/version.c | 2 + src/vim9compile.c | 22 ++- src/vim9expr.c | 26 +++- 4 files changed, 190 insertions(+), 104 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 7a269fc8f2..0f692ed9cf 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -3059,27 +3059,6 @@ def Test_class_extends() END v9.CheckSourceFailure(lines, 'E1354: Cannot extend SomeVar', 5) - lines =<< trim END - vim9script - class Base - var name: string - def ToString(): string - return this.name - enddef - endclass - - class Child extends Base - var age: number - def ToString(): string - return super.ToString() .. ': ' .. this.age - enddef - endclass - - var o = Child.new('John', 42) - assert_equal('John: 42', o.ToString()) - END - v9.CheckSourceSuccess(lines) - lines =<< trim END vim9script class Child @@ -3094,49 +3073,6 @@ def Test_class_extends() END v9.CheckSourceFailure(lines, 'E1355: Duplicate function: ToString', 9) - lines =<< trim END - vim9script - class Child - var age: number - def ToString(): string - return super .ToString() .. ': ' .. this.age - enddef - endclass - var o = Child.new(42) - echo o.ToString() - END - v9.CheckSourceFailure(lines, 'E1356: "super" must be followed by a dot', 1) - - lines =<< trim END - vim9script - class Base - var name: string - def ToString(): string - return this.name - enddef - endclass - - var age = 42 - def ToString(): string - return super.ToString() .. ': ' .. age - enddef - echo ToString() - END - v9.CheckSourceFailure(lines, 'E1357: Using "super" not in a class method', 1) - - lines =<< trim END - vim9script - class Child - var age: number - def ToString(): string - return super.ToString() .. ': ' .. this.age - enddef - endclass - var o = Child.new(42) - echo o.ToString() - END - v9.CheckSourceFailure(lines, 'E1358: Using "super" not in a child class', 1) - lines =<< trim END vim9script class Base @@ -3244,28 +3180,6 @@ def Test_using_base_class() END v9.CheckSourceSuccess(lines) unlet g:result - - # Using super, Child invokes Base method which has optional arg. #12471 - lines =<< trim END - vim9script - - class Base - var success: bool = false - def Method(arg = 0) - this.success = true - enddef - endclass - - class Child extends Base - def new() - super.Method() - enddef - endclass - - var obj = Child.new() - assert_equal(true, obj.success) - END - v9.CheckSourceSuccess(lines) enddef " Test for using a method from the super class @@ -12409,4 +12323,162 @@ def Test_protected_new_method() v9.CheckSourceSuccess(lines) enddef +" Test for using 'super' in a closure function inside an object method +def Test_super_in_closure() + var lines =<< trim END + vim9script + + class A + const _value: number + + def Fn(): func(any): number + return (_: any) => this._value + enddef + endclass + + class B extends A + def Fn(): func(any): number + return (_: any) => super._value + enddef + endclass + + assert_equal(100, A.new(100).Fn()(null)) + assert_equal(200, B.new(200).Fn()(null)) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for using 'super' to access methods and variables +def Test_super_keyword() + var lines =<< trim END + vim9script + class Base + var name: string + def ToString(): string + return this.name + enddef + endclass + + class Child extends Base + var age: number + def ToString(): string + return super.ToString() .. ': ' .. this.age + enddef + endclass + + var o = Child.new('John', 42) + assert_equal('John: 42', o.ToString()) + END + v9.CheckSourceSuccess(lines) + + lines =<< trim END + vim9script + class Child + var age: number + def ToString(): string + return super .ToString() .. ': ' .. this.age + enddef + endclass + var o = Child.new(42) + echo o.ToString() + END + v9.CheckSourceFailure(lines, 'E1356: "super" must be followed by a dot', 1) + + lines =<< trim END + vim9script + class Base + var name: string + def ToString(): string + return this.name + enddef + endclass + + var age = 42 + def ToString(): string + return super.ToString() .. ': ' .. age + enddef + echo ToString() + END + v9.CheckSourceFailure(lines, 'E1357: Using "super" not in a class method', 1) + + lines =<< trim END + vim9script + class Child + var age: number + def ToString(): string + return super.ToString() .. ': ' .. this.age + enddef + endclass + var o = Child.new(42) + echo o.ToString() + END + v9.CheckSourceFailure(lines, 'E1358: Using "super" not in a child class', 1) + + # Using super, Child invokes Base method which has optional arg. #12471 + lines =<< trim END + vim9script + + class Base + var success: bool = false + def Method(arg = 0) + this.success = true + enddef + endclass + + class Child extends Base + def new() + super.Method() + enddef + endclass + + var obj = Child.new() + assert_equal(true, obj.success) + END + v9.CheckSourceSuccess(lines) + + # Using 'super' to access an object variable in the parent + lines =<< trim END + vim9script + + class A + var foo: string = 'xxx' + endclass + + class B extends A + def GetString(): string + return super.foo + enddef + endclass + + var b: B = B.new() + echo b.GetString() + END + v9.CheckSourceSuccess(lines) + + # Using super to access an overriden method in the parent class + lines =<< trim END + vim9script + + class A + def Foo(): string + return 'A.Foo' + enddef + endclass + + class B extends A + def Foo(): string + return 'B.Foo' + enddef + + def Bar(): string + return $'{super.Foo()} {this.Foo()}' + enddef + endclass + + var b = B.new() + assert_equal('A.Foo B.Foo', b.Bar()) + END + v9.CheckSourceSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 0c85695b90..19968a66d0 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1116, /**/ 1115, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 42a30b1926..3d8921ad85 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -843,27 +843,21 @@ find_imported(char_u *name, size_t len, int load) imported_T * find_imported_from_extends(cctx_T *cctx, char_u *name, size_t len, int load) { - imported_T *ret = NULL; - class_T *cl_extends; - if (cctx == NULL || cctx->ctx_ufunc == NULL || cctx->ctx_ufunc->uf_class == NULL) return NULL; - cl_extends = cctx->ctx_ufunc->uf_class->class_extends; - - if (cl_extends == NULL || cl_extends->class_class_function_count_child <= 0) + class_T *cl_extends = cctx->ctx_ufunc->uf_class->class_extends; + if (cl_extends == NULL + || cl_extends->class_class_function_count_child <= 0) return NULL; - else - { - sctx_T current_sctx_save = current_sctx; - current_sctx = cl_extends->class_class_functions[0]->uf_script_ctx; - ret = find_imported(name, len, load); - current_sctx = current_sctx_save; + sctx_T current_sctx_save = current_sctx; + current_sctx = cl_extends->class_class_functions[0]->uf_script_ctx; + imported_T *ret = find_imported(name, len, load); + current_sctx = current_sctx_save; - return ret; - } + return ret; } /* diff --git a/src/vim9expr.c b/src/vim9expr.c index fe2be410ba..67722d1140 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -291,7 +291,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } class_T *cl = type->tt_class; - int is_super = type->tt_flags & TTFLAG_SUPER; + int is_super = ((type->tt_flags & TTFLAG_SUPER) == TTFLAG_SUPER); if (type == &t_super) { if (cctx->ctx_ufunc == NULL || cctx->ctx_ufunc->uf_class == NULL) @@ -693,6 +693,26 @@ generate_funcref(cctx_T *cctx, char_u *name, int has_g_prefix) return generate_PUSHFUNC(cctx, ufunc->uf_name, ufunc->uf_func_type, TRUE); } +/* + * Returns TRUE if compiling a class method. + */ + static int +compiling_a_class_method(cctx_T *cctx) +{ + // For an object method, the FC_OBJECT flag will be set. + // For a constructor method, the FC_NEW flag will be set. + // Excluding these methods, the others are class methods. + // When compiling a closure function inside an object method, + // cctx->ctx_outer->ctx_func will point to the object method. + return cctx->ctx_ufunc != NULL + && (cctx->ctx_ufunc->uf_flags & (FC_OBJECT|FC_NEW)) == 0 + && (cctx->ctx_outer == NULL + || cctx->ctx_outer->ctx_ufunc == NULL + || cctx->ctx_outer->ctx_ufunc->uf_class == NULL + || (cctx->ctx_outer->ctx_ufunc->uf_flags + & (FC_OBJECT|FC_NEW)) == 0); +} + /* * Compile a variable name into a load instruction. * "end" points to just after the name. @@ -807,9 +827,7 @@ compile_load( if (name == NULL) return FAIL; - if (STRCMP(name, "super") == 0 - && cctx->ctx_ufunc != NULL - && (cctx->ctx_ufunc->uf_flags & (FC_OBJECT|FC_NEW)) == 0) + if (STRCMP(name, "super") == 0 && compiling_a_class_method(cctx)) { // super.SomeFunc() in a class function: push &t_super type, this // is recognized in compile_subscript(). From 5887cce1d71bd249468f955f99e8e75904acea22 Mon Sep 17 00:00:00 2001 From: Hirohito Higashi Date: Sun, 16 Feb 2025 16:34:30 +0100 Subject: [PATCH 10/18] patch 9.1.1117: there are a few minor style issues Problem: there are a few minor style issues Solution: fix the issues (Hirohito Higashi) closes: #16646 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- src/version.c | 2 ++ src/vim9class.c | 2 +- src/vim9expr.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/version.c b/src/version.c index 19968a66d0..22047afd8d 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1117, /**/ 1116, /**/ diff --git a/src/vim9class.c b/src/vim9class.c index 82205365c6..b5e3a13be7 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -2489,7 +2489,7 @@ early_ret: if (success && is_enum && num_enum_values == 0) // Empty enum statement. Add an empty "values" class variable - enum_add_values_member(cl, &classmembers, 0, &type_list); + success = enum_add_values_member(cl, &classmembers, 0, &type_list); /* * Check a few things diff --git a/src/vim9expr.c b/src/vim9expr.c index 67722d1140..76ce9c50b3 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -902,7 +902,7 @@ compile_load( || (imp = find_imported(name, 0, FALSE)) != NULL || (imp = find_imported_from_extends(cctx, name, 0, FALSE)) != NULL) - res = compile_load_scriptvar(cctx, name, *arg, &end, imp); + res = compile_load_scriptvar(cctx, name, *arg, &end, imp); // When evaluating an expression and the name starts with an // uppercase letter it can be a user defined function. From 68ba6c2c6c165796225f321597341a464fd72b63 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 16 Feb 2025 16:40:12 +0100 Subject: [PATCH 11/18] runtime(vim): Update base-syntax, improve performance Contain the vimNotation syntax group, matching this at top level is unnecessary and very slow. The removed vimString and vimNumber definitions are broken and/or never match. They have long been replaced by newer definitions. closes: #16645 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/generator/vim.vim.base | 45 ++- .../testdir/dumps/vim_key_notation_00.dump | 34 +- .../testdir/dumps/vim_key_notation_01.dump | 40 +-- .../testdir/dumps/vim_key_notation_02.dump | 40 +-- .../testdir/dumps/vim_key_notation_03.dump | 40 +-- .../testdir/dumps/vim_key_notation_04.dump | 40 +-- .../testdir/dumps/vim_key_notation_05.dump | 40 +-- .../testdir/dumps/vim_key_notation_06.dump | 40 +-- .../testdir/dumps/vim_key_notation_07.dump | 40 +-- .../testdir/dumps/vim_key_notation_08.dump | 40 +-- .../testdir/dumps/vim_key_notation_09.dump | 18 +- .../syntax/testdir/input/vim_key_notation.vim | 322 +++++++++--------- runtime/syntax/vim.vim | 45 ++- 13 files changed, 390 insertions(+), 394 deletions(-) diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index d2ddd1c90c..009b2083b9 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Feb 13 +" Last Change: 2025 Feb 16 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -199,7 +199,6 @@ syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimC syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -360,7 +359,7 @@ syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgrou syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncScope,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncScope,vimFuncSID,Tag -syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar @@ -630,7 +629,10 @@ syn match vimCommentError contained +".*+ syn match vimEnvvar "\$\I\i*" syn match vimEnvvar "\${\I\i*}" -" In-String Specials: {{{2 +" Strings {{{2 +" ======= + +" In-String Specials: " Try to catch strings, if nothing else matches (therefore it must precede the others!) " vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside []) syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1 @@ -643,8 +645,6 @@ syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPat syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim -syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont -syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ @@ -685,9 +685,6 @@ syn match vimSubstFlags contained "[&cegiIlnpr#]\+" syn match vimSubstDelim contained "\\" syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4 -" 'String': {{{2 -syn match vimString "[^(,]'[^']\{-}\zs'" - " Marks, Registers, Addresses, Filters: {{{2 syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 @@ -875,22 +872,22 @@ syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate " Angle-Bracket Notation: (tnx to Michael Geddes) {{{2 " ====================== syn case ignore -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}x\=\%(f\d\{1,2}\|[^ \t:]\|space\|bar\|bslash\|nl\|newline\|lf\|linefeed\|cr\|retu\%[rn]\|enter\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|csi\|right\|paste\%(start\|end\)\|left\|help\|undo\|k\=insert\|ins\|mouse\|[kz]\=home\|[kz]\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\%(page\)\=\%(\|down\|up\|k\d\>\)\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}x\=\%(f\d\{1,2}\|[^ \t:]\|space\|bar\|bslash\|nl\|newline\|lf\|linefeed\|cr\|retu\%[rn]\|enter\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|csi\|right\|paste\%(start\|end\)\|left\|help\|undo\|k\=insert\|ins\|mouse\|[kz]\=home\|[kz]\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\%(page\)\=\%(\|down\|up\|k\d\>\)\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket -syn match vimNotation '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket -syn match vimNotation '\%#=1\%(\\\|\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket -syn match vimNotation "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket +syn match vimNotation contained '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket +syn match vimNotation contained '\%#=1\%(\\\|\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket +syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket syn match vimBracket contained "[\\<>]" syn case match @@ -916,7 +913,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vimBufnrWarn /\\|\\|\\|\" skipwhite nextgroup=@vimExprList,vimNotation +syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation " Match: {{{2 " ===== diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_00.dump b/runtime/syntax/testdir/dumps/vim_key_notation_00.dump index ed58e2fdec..ea37115957 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_00.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_00.dump @@ -1,20 +1,20 @@ >"+0#0000e05#ffffff0| |K|e|y| |n|o|t|a|t|i|o|n| +0#0000000&@60 @75 -|<+0#e000e06&|S|p|a|c|e|>| +0#0000000&@67 -|<+0#e000e06&|T|a|b|>| +0#0000000&@69 -|<+0#e000e06&|T|a|b|>| +0#0000000&@69 -|<+0#e000e06&|N|L|>| +0#0000000&@70 -|<+0#e000e06&|N|e|w|L|i|n|e|>| +0#0000000&@65 -|<+0#e000e06&|L|i|n|e|F|e@1|d|>| +0#0000000&@64 -|<+0#e000e06&|L|F|>| +0#0000000&@70 -|<+0#e000e06&|C|R|>| +0#0000000&@70 -|<+0#e000e06&|R|e|t|u|r|n|>| +0#0000000&@66 -|<+0#e000e06&|E|n|t|e|r|>| +0#0000000&@67 -|<+0#e000e06&|B|S|>| +0#0000000&@70 -|<+0#e000e06&|B|a|c|k|S|p|a|c|e|>| +0#0000000&@63 -|<+0#e000e06&|E|s|c|>| +0#0000000&@69 -|<+0#e000e06&|C|S|I|>| +0#0000000&@69 -|<+0#e000e06&|x|C|S|I|>| +0#0000000&@68 -|<+0#e000e06&|B|a|r|>| +0#0000000&@69 -|<+0#e000e06&|B|s|l|a|s|h|>| +0#0000000&@66 +|m+0#af5f00255&|a|p| +0#0000000&|f|o@1| @67 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|p|a|c|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|T|a|b|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|T|a|b|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|N|L|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|N|e|w|L|i|n|e|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|i|n|e|F|e@1|d|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|F|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|C|R|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|R|e|t|u|r|n|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|E|n|t|e|r|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|S|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|a|c|k|S|p|a|c|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|E|s|c|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|C|S|I|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|C|S|I|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|a|r|>| +0#0000000&@61 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_01.dump b/runtime/syntax/testdir/dumps/vim_key_notation_01.dump index 0cbf0ee0fb..b14d575da9 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_01.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_01.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|B|a|c|k|S|p|a|c|e|>| +0#0000000&@63 -|<+0#e000e06&|E|s|c|>| +0#0000000&@69 -|<+0#e000e06&|C|S|I|>| +0#0000000&@69 -|<+0#e000e06&|x|C|S|I|>| +0#0000000&@68 -|<+0#e000e06&|B|a|r|>| +0#0000000&@69 -><+0#e000e06&|B|s|l|a|s|h|>| +0#0000000&@66 -|<+0#e000e06&|D|e|l|>| +0#0000000&@69 -|<+0#e000e06&|D|e|l|e|t|e|>| +0#0000000&@66 -|<+0#e000e06&|k|D|e|l|>| +0#0000000&@68 -|<+0#e000e06&|U|p|>| +0#0000000&@70 -|<+0#e000e06&|D|o|w|n|>| +0#0000000&@68 -|<+0#e000e06&|L|e|f|t|>| +0#0000000&@68 -|<+0#e000e06&|R|i|g|h|t|>| +0#0000000&@67 -|<+0#e000e06&|x|U|p|>| +0#0000000&@69 -|<+0#e000e06&|x|D|o|w|n|>| +0#0000000&@67 -|<+0#e000e06&|x|L|e|f|t|>| +0#0000000&@67 -|<+0#e000e06&|x|R|i|g|h|t|>| +0#0000000&@66 -|<+0#e000e06&|P|a|s|t|e|S|t|a|r|t|>| +0#0000000&@62 -|<+0#e000e06&|P|a|s|t|e|E|n|d|>| +0#0000000&@64 -@57|1|9|,|1| @10|9|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|S|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|a|c|k|S|p|a|c|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|E|s|c|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|C|S|I|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|C|S|I|>| +0#0000000&@60 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|a|r|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|B|s|l|a|s|h|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|D|e|l|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|D|e|l|e|t|e|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|D|e|l|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|U|p|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|D|o|w|n|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|R|i|g|h|t|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|U|p|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|D|o|w|n|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|L|e|f|t|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|R|i|g|h|t|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|a|s|t|e|S|t|a|r|t|>| +0#0000000&@54 +@57|1|9|,|7| @10|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_02.dump b/runtime/syntax/testdir/dumps/vim_key_notation_02.dump index 01fca78c45..5826a4eccb 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_02.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_02.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|P|a|s|t|e|E|n|d|>| +0#0000000&@64 -|<+0#e000e06&|F|1|>| +0#0000000&@70 -|<+0#e000e06&|F|2|>| +0#0000000&@70 -|<+0#e000e06&|F|3|>| +0#0000000&@70 -|<+0#e000e06&|F|4|>| +0#0000000&@70 -><+0#e000e06&|F|5|>| +0#0000000&@70 -|<+0#e000e06&|F|6|>| +0#0000000&@70 -|<+0#e000e06&|F|7|>| +0#0000000&@70 -|<+0#e000e06&|F|8|>| +0#0000000&@70 -|<+0#e000e06&|F|9|>| +0#0000000&@70 -|<+0#e000e06&|F|1|0|>| +0#0000000&@69 -|<+0#e000e06&|F|1@1|>| +0#0000000&@69 -|<+0#e000e06&|F|1|2|>| +0#0000000&@69 -|<+0#e000e06&|F|1|3|>| +0#0000000&@69 -|<+0#e000e06&|F|1|4|>| +0#0000000&@69 -|<+0#e000e06&|F|1|5|>| +0#0000000&@69 -|<+0#e000e06&|F|1|6|>| +0#0000000&@69 -|<+0#e000e06&|F|1|7|>| +0#0000000&@69 -|<+0#e000e06&|F|1|8|>| +0#0000000&@69 -@57|3|7|,|1| @9|2|1|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|a|s|t|e|S|t|a|r|t|>| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|a|s|t|e|E|n|d|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|>| +0#0000000&@62 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|4|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|5|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|6|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|7|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|8|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|9|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|0|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1@1|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|2|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|3|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|4|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|5|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|6|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|7|>| +0#0000000&@61 +@57|3|7|,|7| @9|2|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_03.dump b/runtime/syntax/testdir/dumps/vim_key_notation_03.dump index dfdf8902fa..ccb9f026d8 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_03.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_03.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|F|1|8|>| +0#0000000&@69 -|<+0#e000e06&|F|1|9|>| +0#0000000&@69 -|<+0#e000e06&|F|2|0|>| +0#0000000&@69 -|<+0#e000e06&|F|2|1|>| +0#0000000&@69 -|<+0#e000e06&|F|2@1|>| +0#0000000&@69 -><+0#e000e06&|F|2|3|>| +0#0000000&@69 -|<+0#e000e06&|F|2|4|>| +0#0000000&@69 -|<+0#e000e06&|F|2|5|>| +0#0000000&@69 -|<+0#e000e06&|F|2|6|>| +0#0000000&@69 -|<+0#e000e06&|F|2|7|>| +0#0000000&@69 -|<+0#e000e06&|F|2|8|>| +0#0000000&@69 -|<+0#e000e06&|F|2|9|>| +0#0000000&@69 -|<+0#e000e06&|F|3|0|>| +0#0000000&@69 -|<+0#e000e06&|F|3|1|>| +0#0000000&@69 -|<+0#e000e06&|F|3|2|>| +0#0000000&@69 -|<+0#e000e06&|F|3@1|>| +0#0000000&@69 -|<+0#e000e06&|F|3|4|>| +0#0000000&@69 -|<+0#e000e06&|F|3|5|>| +0#0000000&@69 -|<+0#e000e06&|F|3|6|>| +0#0000000&@69 -@57|5@1|,|1| @9|3|4|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|7|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|8|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|1|9|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|0|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|1|>| +0#0000000&@61 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2@1|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|3|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|4|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|5|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|6|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|7|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|8|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|2|9|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|0|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|1|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|2|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3@1|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|4|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|5|>| +0#0000000&@61 +@57|5@1|,|7| @9|3@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_04.dump b/runtime/syntax/testdir/dumps/vim_key_notation_04.dump index 8820c26806..d346187521 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_04.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_04.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|F|3|6|>| +0#0000000&@69 -|<+0#e000e06&|F|3|7|>| +0#0000000&@69 -|<+0#e000e06&|x|F|1|>| +0#0000000&@69 -|<+0#e000e06&|x|F|2|>| +0#0000000&@69 -|<+0#e000e06&|x|F|3|>| +0#0000000&@69 -><+0#e000e06&|x|F|4|>| +0#0000000&@69 -|<+0#e000e06&|H|e|l|p|>| +0#0000000&@68 -|<+0#e000e06&|U|n|d|o|>| +0#0000000&@68 -|<+0#e000e06&|I|n|s|e|r|t|>| +0#0000000&@66 -|<+0#e000e06&|I|n|s|>| +0#0000000&@69 -|<+0#e000e06&|k|I|n|s|e|r|t|>| +0#0000000&@65 -|<+0#e000e06&|H|o|m|e|>| +0#0000000&@68 -|<+0#e000e06&|k|H|o|m|e|>| +0#0000000&@67 -|<+0#e000e06&|x|H|o|m|e|>| +0#0000000&@67 -|<+0#e000e06&|z|H|o|m|e|>| +0#0000000&@67 -|<+0#e000e06&|E|n|d|>| +0#0000000&@69 -|<+0#e000e06&|k|E|n|d|>| +0#0000000&@68 -|<+0#e000e06&|x|E|n|d|>| +0#0000000&@68 -|<+0#e000e06&|z|E|n|d|>| +0#0000000&@68 -@57|7|3|,|1| @9|4|6|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|5|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|6|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|3|7|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|F|1|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|F|2|>| +0#0000000&@61 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|F|3|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|F|4|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|H|e|l|p|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|U|n|d|o|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|I|n|s|e|r|t|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|I|n|s|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|I|n|s|e|r|t|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|H|o|m|e|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|H|o|m|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|H|o|m|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|z|H|o|m|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|E|n|d|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|E|n|d|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|E|n|d|>| +0#0000000&@60 +@57|7|3|,|7| @9|4|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_05.dump b/runtime/syntax/testdir/dumps/vim_key_notation_05.dump index 939bf89ba8..2962483d0a 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_05.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_05.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|z|E|n|d|>| +0#0000000&@68 -|<+0#e000e06&|P|a|g|e|U|p|>| +0#0000000&@66 -|<+0#e000e06&|P|a|g|e|D|o|w|n|>| +0#0000000&@64 -|<+0#e000e06&|k|P|a|g|e|U|p|>| +0#0000000&@65 -|<+0#e000e06&|k|P|a|g|e|D|o|w|n|>| +0#0000000&@63 -><+0#e000e06&|k|P|l|u|s|>| +0#0000000&@67 -|<+0#e000e06&|k|M|i|n|u|s|>| +0#0000000&@66 -|<+0#e000e06&|k|D|i|v|i|d|e|>| +0#0000000&@65 -|<+0#e000e06&|k|M|u|l|t|i|p|l|y|>| +0#0000000&@63 -|<+0#e000e06&|k|E|n|t|e|r|>| +0#0000000&@66 -|<+0#e000e06&|k|P|o|i|n|t|>| +0#0000000&@66 -|<+0#e000e06&|k|0|>| +0#0000000&@70 -|<+0#e000e06&|k|1|>| +0#0000000&@70 -|<+0#e000e06&|k|2|>| +0#0000000&@70 -|<+0#e000e06&|k|3|>| +0#0000000&@70 -|<+0#e000e06&|k|4|>| +0#0000000&@70 -|<+0#e000e06&|k|5|>| +0#0000000&@70 -|<+0#e000e06&|k|6|>| +0#0000000&@70 -|<+0#e000e06&|k|7|>| +0#0000000&@70 -@57|9|1|,|1| @9|5|9|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|x|E|n|d|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|z|E|n|d|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|a|g|e|U|p|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|a|g|e|D|o|w|n|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|P|a|g|e|U|p|>| +0#0000000&@57 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|P|a|g|e|D|o|w|n|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|P|l|u|s|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|M|i|n|u|s|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|D|i|v|i|d|e|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|M|u|l|t|i|p|l|y|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|E|n|t|e|r|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|P|o|i|n|t|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|0|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|1|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|2|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|3|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|4|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|5|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|6|>| +0#0000000&@62 +@57|9|1|,|7| @9|5|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_06.dump b/runtime/syntax/testdir/dumps/vim_key_notation_06.dump index e82c7f3ebb..66a80f213e 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_06.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_06.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|k|7|>| +0#0000000&@70 -|<+0#e000e06&|k|8|>| +0#0000000&@70 -|<+0#e000e06&|k|9|>| +0#0000000&@70 -|<+0#e000e06&|l|t|>| +0#0000000&@70 -|<+0#e000e06&|M|o|u|s|e|>| +0#0000000&@67 -><+0#e000e06&|N|e|t|M|o|u|s|e|>| +0#0000000&@64 -|<+0#e000e06&|D|e|c|M|o|u|s|e|>| +0#0000000&@64 -|<+0#e000e06&|J|s|b|M|o|u|s|e|>| +0#0000000&@64 -|<+0#e000e06&|P|t|e|r|m|M|o|u|s|e|>| +0#0000000&@62 -|<+0#e000e06&|U|r|x|v|t|M|o|u|s|e|>| +0#0000000&@62 -|<+0#e000e06&|S|g|r|M|o|u|s|e|>| +0#0000000&@64 -|<+0#e000e06&|S|g|r|M|o|u|s|e|R|e|l|e|a|s|e|>| +0#0000000&@57 -|<+0#e000e06&|L|e|f|t|M|o|u|s|e|>| +0#0000000&@63 -|<+0#e000e06&|L|e|f|t|M|o|u|s|e|N|M|>| +0#0000000&@61 -|<+0#e000e06&|L|e|f|t|D|r|a|g|>| +0#0000000&@64 -|<+0#e000e06&|L|e|f|t|R|e|l|e|a|s|e|>| +0#0000000&@61 -|<+0#e000e06&|L|e|f|t|R|e|l|e|a|s|e|N|M|>| +0#0000000&@59 -|<+0#e000e06&|M|o|u|s|e|M|o|v|e|>| +0#0000000&@63 -|<+0#e000e06&|M|i|d@1|l|e|M|o|u|s|e|>| +0#0000000&@61 -@57|1|0|9|,|1| @8|7|1|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|6|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|7|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|8|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|k|9|>| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|l|t|>| +0#0000000&@62 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|o|u|s|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|N|e|t|M|o|u|s|e|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|D|e|c|M|o|u|s|e|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|J|s|b|M|o|u|s|e|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|t|e|r|m|M|o|u|s|e|>| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|U|r|x|v|t|M|o|u|s|e|>| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|g|r|M|o|u|s|e|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|g|r|M|o|u|s|e|R|e|l|e|a|s|e|>| +0#0000000&@49 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|M|o|u|s|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|M|o|u|s|e|N|M|>| +0#0000000&@53 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|D|r|a|g|>| +0#0000000&@56 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|R|e|l|e|a|s|e|>| +0#0000000&@53 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|L|e|f|t|R|e|l|e|a|s|e|N|M|>| +0#0000000&@51 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|o|u|s|e|M|o|v|e|>| +0#0000000&@55 +@57|1|0|9|,|7| @8|7|0|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_07.dump b/runtime/syntax/testdir/dumps/vim_key_notation_07.dump index 3e21774e1e..a05017e018 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_07.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_07.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|M|i|d@1|l|e|M|o|u|s|e|>| +0#0000000&@61 -|<+0#e000e06&|M|i|d@1|l|e|D|r|a|g|>| +0#0000000&@62 -|<+0#e000e06&|M|i|d@1|l|e|R|e|l|e|a|s|e|>| +0#0000000&@59 -|<+0#e000e06&|R|i|g|h|t|M|o|u|s|e|>| +0#0000000&@62 -|<+0#e000e06&|R|i|g|h|t|D|r|a|g|>| +0#0000000&@63 -><+0#e000e06&|R|i|g|h|t|R|e|l|e|a|s|e|>| +0#0000000&@60 -|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|U|p|>| +0#0000000&@59 -|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|D|o|w|n|>| +0#0000000&@57 -|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|R|i|g|h|t|>| +0#0000000&@56 -|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|L|e|f|t|>| +0#0000000&@57 -|<+0#e000e06&|M|o|u|s|e|D|o|w|n|>| +0#0000000&@63 -|<+0#e000e06&|M|o|u|s|e|U|p|>| +0#0000000&@65 -|<+0#e000e06&|X|1|M|o|u|s|e|>| +0#0000000&@65 -|<+0#e000e06&|X|1|D|r|a|g|>| +0#0000000&@66 -|<+0#e000e06&|X|1|R|e|l|e|a|s|e|>| +0#0000000&@63 -|<+0#e000e06&|X|2|M|o|u|s|e|>| +0#0000000&@65 -|<+0#e000e06&|X|2|D|r|a|g|>| +0#0000000&@66 -|<+0#e000e06&|X|2|R|e|l|e|a|s|e|>| +0#0000000&@63 -|<+0#e000e06&|D|r|o|p|>| +0#0000000&@68 -@57|1|2|7|,|1| @8|8|4|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|o|u|s|e|M|o|v|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|i|d@1|l|e|M|o|u|s|e|>| +0#0000000&@53 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|i|d@1|l|e|D|r|a|g|>| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|i|d@1|l|e|R|e|l|e|a|s|e|>| +0#0000000&@51 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|R|i|g|h|t|M|o|u|s|e|>| +0#0000000&@54 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|R|i|g|h|t|D|r|a|g|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|R|i|g|h|t|R|e|l|e|a|s|e|>| +0#0000000&@52 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|U|p|>| +0#0000000&@51 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|D|o|w|n|>| +0#0000000&@49 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|R|i|g|h|t|>| +0#0000000&@48 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|c|r|o|l@1|W|h|e@1|l|L|e|f|t|>| +0#0000000&@49 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|o|u|s|e|D|o|w|n|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|M|o|u|s|e|U|p|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|1|M|o|u|s|e|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|1|D|r|a|g|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|1|R|e|l|e|a|s|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|2|M|o|u|s|e|>| +0#0000000&@57 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|2|D|r|a|g|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|2|R|e|l|e|a|s|e|>| +0#0000000&@55 +@57|1|2|7|,|7| @8|8|2|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_08.dump b/runtime/syntax/testdir/dumps/vim_key_notation_08.dump index 7337575273..37db049f7d 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_08.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_08.dump @@ -1,20 +1,20 @@ -|<+0#e000e06#ffffff0|D|r|o|p|>| +0#0000000&@68 -|<+0#e000e06&|N|u|l|>| +0#0000000&@69 -|<+0#e000e06&|S|N|R|>| +0#0000000&@69 -|<+0#e000e06&|P|l|u|g|>| +0#0000000&@68 -|<+0#e000e06&|C|u|r|s|o|r|H|o|l|d|>| +0#0000000&@62 -><+0#e000e06&|I|g|n|o|r|e|>| +0#0000000&@66 -|<+0#e000e06&|C|m|d|>| +0#0000000&@69 -|<+0#e000e06&|S|c|r|i|p|t|C|m|d|>| +0#0000000&@63 -|<+0#e000e06&|F|o|c|u|s|G|a|i|n|e|d|>| +0#0000000&@61 -|<+0#e000e06&|F|o|c|u|s|L|o|s|t|>| +0#0000000&@63 -@75 -|<+0#e000e06&|c|w|o|r|d|>| +0#0000000&@67 -|<+0#e000e06&|c|W|O|R|D|>| +0#0000000&@67 -|<+0#e000e06&|c|e|x|p|r|>| +0#0000000&@67 -|<+0#e000e06&|c|f|i|l|e|>| +0#0000000&@67 -|<+0#e000e06&|a|f|i|l|e|>| +0#0000000&@67 -|<+0#e000e06&|a|b|u|f|>| +0#0000000&@68 -|<+0#e000e06&|a|m|a|t|c|h|>| +0#0000000&@66 -|<+0#e000e06&|s|f|i|l|e|>| +0#0000000&@67 -@57|1|4|5|,|1| @8|9|6|%| +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|X|2|R|e|l|e|a|s|e|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|D|r|o|p|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|N|u|l|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|N|R|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|P|l|u|g|>| +0#0000000&@60 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|C|u|r|s|o|r|H|o|l|d|>| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|I|g|n|o|r|e|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|C|m|d|>| +0#0000000&@61 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|S|c|r|i|p|t|C|m|d|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|o|c|u|s|G|a|i|n|e|d|>| +0#0000000&@53 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|F|o|c|u|s|L|o|s|t|>| +0#0000000&@55 +@6|\+0#e000e06&| +0#0000000&@67 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|c|w|o|r|d|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|c|W|O|R|D|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|c|e|x|p|r|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|c|f|i|l|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|a|f|i|l|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|a|b|u|f|>| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|a|m|a|t|c|h|>| +0#0000000&@58 +@57|1|4|5|,|7| @8|9|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_key_notation_09.dump b/runtime/syntax/testdir/dumps/vim_key_notation_09.dump index d7fc77deb1..d9adc7b3fa 100644 --- a/runtime/syntax/testdir/dumps/vim_key_notation_09.dump +++ b/runtime/syntax/testdir/dumps/vim_key_notation_09.dump @@ -1,9 +1,11 @@ -|<+0#e000e06#ffffff0|s|f|i|l|e|>| +0#0000000&@67 -|<+0#e000e06&|s|t|a|c|k|>| +0#0000000&@67 -|<+0#e000e06&|s|c|r|i|p|t|>| +0#0000000&@66 -|<+0#e000e06&|s|l|n|u|m|>| +0#0000000&@67 -|<+0#e000e06&|s|f|l|n|u|m|>| +0#0000000&@66 -><+0#e000e06&|c|l|i|e|n|t|>| +0#0000000&@66 +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|<+0#e000e06&|a|m|a|t|c|h|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|s|f|i|l|e|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|s|t|a|c|k|>| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|s|c|r|i|p|t|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|s|l|n|u|m|>| +0#0000000&@59 +@6>\+0#e000e06&| +0#0000000&|<+0#e000e06&|s|f|l|n|u|m|>| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|<+0#e000e06&|c|l|i|e|n|t|>| +0#0000000&@58 +@75 |~+0#4040ff13&| @73 |~| @73 |~| @73 @@ -15,6 +17,4 @@ |~| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|6|3|,|1| @8|B|o|t| +| +0#0000000&@56|1|6|3|,|7| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_key_notation.vim b/runtime/syntax/testdir/input/vim_key_notation.vim index 8bc128a4d3..8572499293 100644 --- a/runtime/syntax/testdir/input/vim_key_notation.vim +++ b/runtime/syntax/testdir/input/vim_key_notation.vim @@ -1,163 +1,165 @@ " Key notation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +map foo + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \