mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
+2
-2
@@ -8,9 +8,9 @@ freebsd_task:
|
||||
- name: FreeBSD 13.1
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
- name: FreeBSD 12.3
|
||||
- name: FreeBSD 12.4
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-3
|
||||
image_family: freebsd-12-4
|
||||
timeout_in: 20m
|
||||
install_script:
|
||||
- pkg update -f
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Format of this file: https://lgtm.com/help/lgtm/lgtm.yml-configuration-file
|
||||
path_classifiers:
|
||||
documentation:
|
||||
- runtime/tutor/tutor*
|
||||
@@ -15,7 +15,6 @@ SRC_ALL = \
|
||||
.github/dependabot.yml \
|
||||
.gitignore \
|
||||
.hgignore \
|
||||
.lgtm.yml \
|
||||
.appveyor.yml \
|
||||
.codecov.yml \
|
||||
ci/appveyor.bat \
|
||||
@@ -784,6 +783,7 @@ RT_SCRIPTS = \
|
||||
runtime/autoload/README.txt \
|
||||
runtime/autoload/dist/*.vim \
|
||||
runtime/autoload/xml/*.vim \
|
||||
runtime/autoload/zig/*.vim \
|
||||
runtime/colors/*.vim \
|
||||
runtime/colors/README.txt \
|
||||
runtime/colors/lists/*.vim \
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ vim9script
|
||||
# Vim functions for file type detection
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Apr 13
|
||||
# Last Change: 2022 Nov 24
|
||||
|
||||
# These functions are moved here from runtime/filetype.vim to make startup
|
||||
# faster.
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ vim9script
|
||||
# Invoked from "scripts.vim" in 'runtimepath'
|
||||
#
|
||||
# Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
# Last Change: 2022 Feb 13
|
||||
# Last Change: 2022 Nov 24
|
||||
|
||||
export def DetectFiletype()
|
||||
var line1 = getline(1)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
" Vim compiler file
|
||||
" Compiler: dotnet build (.NET CLI)
|
||||
" Maintainer: Nick Jensen <nickspoon@gmail.com>
|
||||
" Last Change: 2022-12-06
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/nickspoons/vim-cs
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "dotnet"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if get(g:, "dotnet_errors_only", v:false)
|
||||
CompilerSet makeprg=dotnet\ build\ -nologo
|
||||
\\ -consoleloggerparameters:NoSummary
|
||||
\\ -consoleloggerparameters:ErrorsOnly
|
||||
else
|
||||
CompilerSet makeprg=dotnet\ build\ -nologo\ -consoleloggerparameters:NoSummary
|
||||
endif
|
||||
|
||||
if get(g:, "dotnet_show_project_file", v:true)
|
||||
CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m,
|
||||
\%W%f(%l\\,%c):\ %tarning\ %m,
|
||||
\%-G%.%#
|
||||
else
|
||||
CompilerSet errorformat=%E%f(%l\\,%c):\ %trror\ %m\ [%.%#],
|
||||
\%W%f(%l\\,%c):\ %tarning\ %m\ [%.%#],
|
||||
\%-G%.%#
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -0,0 +1,28 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "zig"
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" a subcommand must be provided for the this compiler (test, build-exe, etc)
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ \$*\ \%:S
|
||||
else
|
||||
CompilerSet makeprg=zig\ \$*\ \"%\"
|
||||
endif
|
||||
|
||||
" TODO: improve errorformat as needed.
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
@@ -0,0 +1,29 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig build)
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_build'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists('g:zig_build_makeprg_params')
|
||||
execute 'CompilerSet makeprg=zig\ build\ '.escape(g:zig_build_makeprg_params, ' \|"').'\ $*'
|
||||
else
|
||||
CompilerSet makeprg=zig\ build\ $*
|
||||
endif
|
||||
|
||||
" TODO: anything to add to errorformat for zig build specifically?
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
@@ -0,0 +1,27 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig build-exe)
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_build_exe'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ build-exe\ \%:S\ \$*
|
||||
else
|
||||
CompilerSet makeprg=zig\ build-exe\ \"%\"\ \$*
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
@@ -0,0 +1,27 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig test)
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_test'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ test\ \%:S\ \$*
|
||||
else
|
||||
CompilerSet makeprg=zig\ test\ \"%\"\ \$*
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
+13
-1
@@ -1,4 +1,4 @@
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2022 Nov 21
|
||||
*builtin.txt* For Vim version 9.0. Last change: 2022 Dec 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -610,6 +610,7 @@ submatch({nr} [, {list}]) String or List
|
||||
specific match in ":s" or substitute()
|
||||
substitute({expr}, {pat}, {sub}, {flags})
|
||||
String all {pat} in {expr} replaced with {sub}
|
||||
swapfilelist() List swap files found in 'directory'
|
||||
swapinfo({fname}) Dict information about swap file {fname}
|
||||
swapname({buf}) String swap file of buffer {buf}
|
||||
synID({lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
|
||||
@@ -9338,6 +9339,17 @@ substitute({string}, {pat}, {sub}, {flags}) *substitute()*
|
||||
Can also be used as a |method|: >
|
||||
GetString()->substitute(pat, sub, flags)
|
||||
|
||||
swapfilelist() *swapfilelist()*
|
||||
Returns a list of swap file names, like what "vim -r" shows.
|
||||
See the |-r| command argument. The 'directory' option is used
|
||||
for the directories to inspect. If you only want to get a
|
||||
list of swap files in the current directory then temporarily
|
||||
set 'directory' to a dot: >
|
||||
let save_dir = &directory
|
||||
let &directory = '.'
|
||||
let swapfiles = swapfilelist()
|
||||
let &directory = save_dir
|
||||
|
||||
swapinfo({fname}) *swapinfo()*
|
||||
The result is a dictionary, which holds information about the
|
||||
swapfile {fname}. The available fields are:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 9.0. Last change: 2022 Jun 23
|
||||
*channel.txt* For Vim version 9.0. Last change: 2022 Dec 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 9.0. Last change: 2022 Nov 22
|
||||
*eval.txt* For Vim version 9.0. Last change: 2022 Dec 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -633,6 +633,10 @@ This removes all entries from "dict" with a value not matching 'x'.
|
||||
This can also be used to remove all entries: >
|
||||
call filter(dict, 0)
|
||||
|
||||
In some situations it is not allowed to remove or add entries to a Dictionary.
|
||||
Especially when iterating over all the entries. You will get *E1313* or
|
||||
another error in that case.
|
||||
|
||||
|
||||
Dictionary function ~
|
||||
*Dictionary-function* *self* *E725* *E862*
|
||||
@@ -646,7 +650,8 @@ special way with a dictionary. Example: >
|
||||
|
||||
This is like a method in object oriented programming. The entry in the
|
||||
Dictionary is a |Funcref|. The local variable "self" refers to the dictionary
|
||||
the function was invoked from.
|
||||
the function was invoked from. When using |Vim9| script you can use classes
|
||||
and objects, see `:class`.
|
||||
|
||||
It is also possible to add a function without the "dict" attribute as a
|
||||
Funcref to a Dictionary, but the "self" variable is not available then.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 9.0. Last change: 2022 Oct 01
|
||||
*fold.txt* For Vim version 9.0. Last change: 2022 Nov 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -598,6 +598,11 @@ line is folded, it cannot be displayed there.
|
||||
Many movement commands handle a sequence of folded lines like an empty line.
|
||||
For example, the "w" command stops once in the first column.
|
||||
|
||||
When starting a search in a closed fold it will not find a match in the
|
||||
current fold. It's like a forward search always starts from the end of the
|
||||
closed fold, while a backwards search starts from the start of the closed
|
||||
fold.
|
||||
|
||||
When in Insert mode, the cursor line is never folded. That allows you to see
|
||||
what you type!
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 9.0. Last change: 2022 May 13
|
||||
*help.txt* For Vim version 9.0. Last change: 2022 Dec 03
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -153,6 +153,7 @@ Special issues ~
|
||||
|terminal.txt| Terminal window support
|
||||
|popup.txt| popup window support
|
||||
|vim9.txt| using Vim9 script
|
||||
|vim9class.txt| using Vim9 script classes
|
||||
|
||||
Programming language support ~
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 9.0. Last change: 2022 Nov 23
|
||||
*map.txt* For Vim version 9.0. Last change: 2022 Dec 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1695,7 +1695,7 @@ Possible attributes are:
|
||||
number.
|
||||
-count=N A count (default N) which is specified either in the line
|
||||
number position, or as an initial argument (like |:Next|).
|
||||
-count acts like -count=0
|
||||
-count Acts like -count=0
|
||||
|
||||
Note that -range=N and -count=N are mutually exclusive - only one should be
|
||||
specified.
|
||||
@@ -1713,7 +1713,7 @@ Possible values are (second column is the short name used in listing):
|
||||
-addr=windows win Range for windows
|
||||
-addr=tabs tab Range for tab pages
|
||||
-addr=quickfix qf Range for quickfix entries
|
||||
-addr=other ? other kind of range; can use ".", "$" and "%"
|
||||
-addr=other ? Other kind of range; can use ".", "$" and "%"
|
||||
as with "lines" (this is the default for
|
||||
-count)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 9.0. Last change: 2022 Nov 23
|
||||
*options.txt* For Vim version 9.0. Last change: 2022 Nov 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_unix.txt* For Vim version 9.0. Last change: 2005 Mar 29
|
||||
*os_unix.txt* For Vim version 9.0. Last change: 2022 Nov 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_vms.txt* For Vim version 9.0. Last change: 2022 Sep 30
|
||||
*os_vms.txt* For Vim version 9.0. Last change: 2022 Nov 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 9.0. Last change: 2022 Jun 14
|
||||
*starting.txt* For Vim version 9.0. Last change: 2022 Nov 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2022 Nov 15
|
||||
*syntax.txt* For Vim version 9.0. Last change: 2022 Nov 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3621,6 +3621,14 @@ highlighting is to put the following line in your |vimrc|: >
|
||||
<
|
||||
|
||||
|
||||
WDL *wdl.vim* *wdl-syntax*
|
||||
|
||||
The Workflow Description Language is a way to specify data processing workflows
|
||||
with a human-readable and writeable syntax. This is used a lot in
|
||||
bioinformatics. More info on the spec can be found here:
|
||||
https://github.com/openwdl/wdl
|
||||
|
||||
|
||||
XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax*
|
||||
|
||||
The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both
|
||||
|
||||
+30
-9
@@ -1079,6 +1079,7 @@ $quote eval.txt /*$quote*
|
||||
't_RC' term.txt /*'t_RC'*
|
||||
't_RF' term.txt /*'t_RF'*
|
||||
't_RI' term.txt /*'t_RI'*
|
||||
't_RK' term.txt /*'t_RK'*
|
||||
't_RS' term.txt /*'t_RS'*
|
||||
't_RT' term.txt /*'t_RT'*
|
||||
't_RV' term.txt /*'t_RV'*
|
||||
@@ -2187,7 +2188,7 @@ $quote eval.txt /*$quote*
|
||||
:abclear map.txt /*:abclear*
|
||||
:abo windows.txt /*:abo*
|
||||
:aboveleft windows.txt /*:aboveleft*
|
||||
:abstract vim9.txt /*:abstract*
|
||||
:abstract vim9class.txt /*:abstract*
|
||||
:addd quickfix.txt /*:addd*
|
||||
:al windows.txt /*:al*
|
||||
:all windows.txt /*:all*
|
||||
@@ -2347,7 +2348,7 @@ $quote eval.txt /*$quote*
|
||||
:chistory quickfix.txt /*:chistory*
|
||||
:cl quickfix.txt /*:cl*
|
||||
:cla quickfix.txt /*:cla*
|
||||
:class vim9.txt /*:class*
|
||||
:class vim9class.txt /*:class*
|
||||
:clast quickfix.txt /*:clast*
|
||||
:cle motion.txt /*:cle*
|
||||
:clearjumps motion.txt /*:clearjumps*
|
||||
@@ -2524,15 +2525,15 @@ $quote eval.txt /*$quote*
|
||||
:emenu gui.txt /*:emenu*
|
||||
:en eval.txt /*:en*
|
||||
:end eval.txt /*:end*
|
||||
:endclass vim9.txt /*:endclass*
|
||||
:endclass vim9class.txt /*:endclass*
|
||||
:enddef vim9.txt /*:enddef*
|
||||
:endenum vim9.txt /*:endenum*
|
||||
:endenum vim9class.txt /*:endenum*
|
||||
:endf userfunc.txt /*:endf*
|
||||
:endfo eval.txt /*:endfo*
|
||||
:endfor eval.txt /*:endfor*
|
||||
:endfunction userfunc.txt /*:endfunction*
|
||||
:endif eval.txt /*:endif*
|
||||
:endinterface vim9.txt /*:endinterface*
|
||||
:endinterface vim9class.txt /*:endinterface*
|
||||
:endt eval.txt /*:endt*
|
||||
:endtry eval.txt /*:endtry*
|
||||
:endw eval.txt /*:endw*
|
||||
@@ -2541,7 +2542,7 @@ $quote eval.txt /*$quote*
|
||||
:ene! editing.txt /*:ene!*
|
||||
:enew editing.txt /*:enew*
|
||||
:enew! editing.txt /*:enew!*
|
||||
:enum vim9.txt /*:enum*
|
||||
:enum vim9class.txt /*:enum*
|
||||
:eval eval.txt /*:eval*
|
||||
:ex editing.txt /*:ex*
|
||||
:exe eval.txt /*:exe*
|
||||
@@ -2671,7 +2672,7 @@ $quote eval.txt /*$quote*
|
||||
:inoreme gui.txt /*:inoreme*
|
||||
:inoremenu gui.txt /*:inoremenu*
|
||||
:insert insert.txt /*:insert*
|
||||
:interface vim9.txt /*:interface*
|
||||
:interface vim9class.txt /*:interface*
|
||||
:intro starting.txt /*:intro*
|
||||
:is tagsrch.txt /*:is*
|
||||
:isearch tagsrch.txt /*:isearch*
|
||||
@@ -3312,7 +3313,7 @@ $quote eval.txt /*$quote*
|
||||
:startgreplace insert.txt /*:startgreplace*
|
||||
:startinsert insert.txt /*:startinsert*
|
||||
:startreplace insert.txt /*:startreplace*
|
||||
:static vim9.txt /*:static*
|
||||
:static vim9class.txt /*:static*
|
||||
:stj tagsrch.txt /*:stj*
|
||||
:stjump tagsrch.txt /*:stjump*
|
||||
:stop starting.txt /*:stop*
|
||||
@@ -3490,7 +3491,7 @@ $quote eval.txt /*$quote*
|
||||
:tunma map.txt /*:tunma*
|
||||
:tunmap map.txt /*:tunmap*
|
||||
:tunmenu gui.txt /*:tunmenu*
|
||||
:type vim9.txt /*:type*
|
||||
:type vim9class.txt /*:type*
|
||||
:u undo.txt /*:u*
|
||||
:un undo.txt /*:un*
|
||||
:una map.txt /*:una*
|
||||
@@ -4419,6 +4420,8 @@ E131 userfunc.txt /*E131*
|
||||
E1310 gui.txt /*E1310*
|
||||
E1311 map.txt /*E1311*
|
||||
E1312 windows.txt /*E1312*
|
||||
E1313 eval.txt /*E1313*
|
||||
E1314 vim9class.txt /*E1314*
|
||||
E132 userfunc.txt /*E132*
|
||||
E133 userfunc.txt /*E133*
|
||||
E134 change.txt /*E134*
|
||||
@@ -5674,7 +5677,14 @@ VMS os_vms.txt /*VMS*
|
||||
Vi intro.txt /*Vi*
|
||||
View starting.txt /*View*
|
||||
Vim9 vim9.txt /*Vim9*
|
||||
Vim9-abstract-class vim9class.txt /*Vim9-abstract-class*
|
||||
Vim9-class vim9class.txt /*Vim9-class*
|
||||
Vim9-class-overview vim9class.txt /*Vim9-class-overview*
|
||||
Vim9-enum vim9class.txt /*Vim9-enum*
|
||||
Vim9-script vim9.txt /*Vim9-script*
|
||||
Vim9-simple-class vim9class.txt /*Vim9-simple-class*
|
||||
Vim9-type vim9class.txt /*Vim9-type*
|
||||
Vim9-using-interface vim9class.txt /*Vim9-using-interface*
|
||||
VimEnter autocmd.txt /*VimEnter*
|
||||
VimLeave autocmd.txt /*VimLeave*
|
||||
VimLeavePre autocmd.txt /*VimLeavePre*
|
||||
@@ -6346,6 +6356,8 @@ cino-w indent.txt /*cino-w*
|
||||
cino-{ indent.txt /*cino-{*
|
||||
cino-} indent.txt /*cino-}*
|
||||
cinoptions-values indent.txt /*cinoptions-values*
|
||||
class-member vim9class.txt /*class-member*
|
||||
class-method vim9class.txt /*class-method*
|
||||
clear-undo undo.txt /*clear-undo*
|
||||
clearmatches() builtin.txt /*clearmatches()*
|
||||
client-server remote.txt /*client-server*
|
||||
@@ -6922,6 +6934,7 @@ expression-syntax eval.txt /*expression-syntax*
|
||||
exrc starting.txt /*exrc*
|
||||
extend() builtin.txt /*extend()*
|
||||
extendnew() builtin.txt /*extendnew()*
|
||||
extends vim9class.txt /*extends*
|
||||
extension-removal cmdline.txt /*extension-removal*
|
||||
extensions-improvements todo.txt /*extensions-improvements*
|
||||
external-editor gui_mac.txt /*external-editor*
|
||||
@@ -7064,6 +7077,7 @@ form.vim syntax.txt /*form.vim*
|
||||
format-bullet-list tips.txt /*format-bullet-list*
|
||||
format-comments change.txt /*format-comments*
|
||||
format-formatexpr change.txt /*format-formatexpr*
|
||||
formatOtherKeys map.txt /*formatOtherKeys*
|
||||
formatting change.txt /*formatting*
|
||||
forth.vim syntax.txt /*forth.vim*
|
||||
fortran.vim syntax.txt /*fortran.vim*
|
||||
@@ -8101,6 +8115,7 @@ if_sniff.txt if_sniff.txt /*if_sniff.txt*
|
||||
if_tcl.txt if_tcl.txt /*if_tcl.txt*
|
||||
ignore-errors eval.txt /*ignore-errors*
|
||||
ignore-timestamp editing.txt /*ignore-timestamp*
|
||||
implements vim9class.txt /*implements*
|
||||
import-autoload vim9.txt /*import-autoload*
|
||||
import-legacy vim9.txt /*import-legacy*
|
||||
import-map vim9.txt /*import-map*
|
||||
@@ -9747,6 +9762,7 @@ spec_chglog_format pi_spec.txt /*spec_chglog_format*
|
||||
spec_chglog_prepend pi_spec.txt /*spec_chglog_prepend*
|
||||
spec_chglog_release_info pi_spec.txt /*spec_chglog_release_info*
|
||||
special-buffers windows.txt /*special-buffers*
|
||||
specifies vim9class.txt /*specifies*
|
||||
speed-up tips.txt /*speed-up*
|
||||
spell spell.txt /*spell*
|
||||
spell-ACCENT spell.txt /*spell-ACCENT*
|
||||
@@ -9961,6 +9977,7 @@ swap-file recover.txt /*swap-file*
|
||||
swapchoice-variable eval.txt /*swapchoice-variable*
|
||||
swapcommand-variable eval.txt /*swapcommand-variable*
|
||||
swapfile-changed version4.txt /*swapfile-changed*
|
||||
swapfilelist() builtin.txt /*swapfilelist()*
|
||||
swapinfo() builtin.txt /*swapinfo()*
|
||||
swapname() builtin.txt /*swapname()*
|
||||
swapname-variable eval.txt /*swapname-variable*
|
||||
@@ -10071,6 +10088,7 @@ t_RB term.txt /*t_RB*
|
||||
t_RC term.txt /*t_RC*
|
||||
t_RF term.txt /*t_RF*
|
||||
t_RI term.txt /*t_RI*
|
||||
t_RK term.txt /*t_RK*
|
||||
t_RS term.txt /*t_RS*
|
||||
t_RT term.txt /*t_RT*
|
||||
t_RV term.txt /*t_RV*
|
||||
@@ -10936,6 +10954,7 @@ vim9-unpack-ignore vim9.txt /*vim9-unpack-ignore*
|
||||
vim9-user-command vim9.txt /*vim9-user-command*
|
||||
vim9-variable-arguments vim9.txt /*vim9-variable-arguments*
|
||||
vim9.txt vim9.txt /*vim9.txt*
|
||||
vim9class.txt vim9class.txt /*vim9class.txt*
|
||||
vim9script vim9.txt /*vim9script*
|
||||
vim: options.txt /*vim:*
|
||||
vim_announce intro.txt /*vim_announce*
|
||||
@@ -11028,6 +11047,8 @@ w:quickfix_title quickfix.txt /*w:quickfix_title*
|
||||
w:var eval.txt /*w:var*
|
||||
waittime channel.txt /*waittime*
|
||||
warningmsg-variable eval.txt /*warningmsg-variable*
|
||||
wdl-syntax syntax.txt /*wdl-syntax*
|
||||
wdl.vim syntax.txt /*wdl.vim*
|
||||
white-space pattern.txt /*white-space*
|
||||
whitespace pattern.txt /*whitespace*
|
||||
wildcard editing.txt /*wildcard*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 9.0. Last change: 2022 Oct 21
|
||||
*term.txt* For Vim version 9.0. Last change: 2022 Dec 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*testing.txt* For Vim version 9.0. Last change: 2022 May 16
|
||||
*testing.txt* For Vim version 9.0. Last change: 2022 Nov 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -135,9 +135,9 @@ test_gui_event({event}, {args})
|
||||
Inject either a mouse button click, or a mouse move, event.
|
||||
The supported items in {args} are:
|
||||
button: mouse button. The supported values are:
|
||||
0 right mouse button
|
||||
0 left mouse button
|
||||
1 middle mouse button
|
||||
2 left mouse button
|
||||
2 right mouse button
|
||||
3 mouse button release
|
||||
4 scroll wheel down
|
||||
5 scroll wheel up
|
||||
|
||||
+39
-61
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 9.0. Last change: 2022 Nov 23
|
||||
*todo.txt* For Vim version 9.0. Last change: 2022 Dec 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,26 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Keyboard protocol (also see below):
|
||||
- Use the kitty_protocol_state value, similar to seenModifyOtherKeys
|
||||
- When kitty_protocol_state is set then reset seenModifyOtherKeys.
|
||||
Do not set seenModifyOtherKeys for kitty-protocol sequences in
|
||||
handle_key_with_modifier().
|
||||
|
||||
virtual text issues:
|
||||
- #11520 `below` cannot be placed below empty lines
|
||||
James Alvarado looks into it
|
||||
- virtual text `below` highlighted incorrectly when `cursorline` enabled
|
||||
(Issue #11588)
|
||||
|
||||
'smoothscroll':
|
||||
- CTRL-E and gj in long line with 'scrolloff' 5 not working well yet.
|
||||
- computing 'scrolloff' position row use w_skipcol
|
||||
- Check this list: https://github.com/vim/vim/pulls?q=is%3Apr+is%3Aopen+smoothscroll+author%3Aychin
|
||||
- Long line spanning multiple pages: After a few CTRL-E then gj causes a
|
||||
scroll. (Ernie Rael, 18 Nov) Also pressing space or "l"
|
||||
|
||||
|
||||
Upcoming larger works:
|
||||
- Make spell checking work with recent .dic/.aff files, e.g. French. #4916
|
||||
Make Vim understand the format somehow? Search for "spell" below.
|
||||
@@ -67,32 +47,16 @@ Upcoming larger works:
|
||||
- Other mechanism than group and cluster to nest syntax items, to be used
|
||||
for grammars.
|
||||
- Possibly keeping the parsed syntax tree and incremental updates.
|
||||
- tree-sitter doesn't handle incorrect syntax (while typing) properly.
|
||||
- Make clear how it relates to LSP.
|
||||
- example plugin: https://github.com/uga-rosa/dps-vsctm.vim
|
||||
- Better support for detecting terminal emulator behavior (esp. special key
|
||||
handling) and taking away the need for users to tweak their config.
|
||||
> In the table of names pointing to the list of entries, with an additional
|
||||
one. So that "xterm-kitty" can first load "xterm" and then add "kitty"
|
||||
entries.
|
||||
> Add an "expectKittyEsc" flag (Esc is always sent as a sequence, not one
|
||||
character) and always wait after an Esc for more to come, don't leave
|
||||
Insert mode.
|
||||
-> Request code for Esc after outputting t_KI, use "k!" value.
|
||||
Use response to set "expectKittyEsc".
|
||||
-> Add ESC[>1uESC[?u to t_KI, parse flag response.
|
||||
-> May also send t_RV and delay starting a shell command until the
|
||||
response has been seen, to make sure the other responses don't get read
|
||||
by a shell command.
|
||||
> Can we use the req_more_codes_from_term() mechanism with more terminals?
|
||||
Should we repeat it after executing a shell command?
|
||||
Can also add this to the 'keyprotocol' option: "mok2+tcap"
|
||||
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
- Use Vim9 for more runtime files.
|
||||
- implement :class and :interface: See |vim9-classes| #11544
|
||||
- implement :type
|
||||
- implement :enum
|
||||
- implement :class and :interface: See |vim9-classes| #11544
|
||||
- Use Vim9 for more runtime files.
|
||||
- Inline call to map() and filter(), better type checking.
|
||||
- When evaluating constants for script variables, some functions could work:
|
||||
has(featureName), len(someString)
|
||||
@@ -222,9 +186,6 @@ Add BufDeletePost. #11041
|
||||
|
||||
Add winid arg to col() and charcol() #11466 (request #11461)
|
||||
|
||||
Make the default for 'ttyfast' on, checking $TERM names doesn't make much
|
||||
sense right now, most terminals are fast. #11549
|
||||
|
||||
Can we make 'noendofline' and 'endoffile' visible? Should show by default,
|
||||
since it's an unusual situation.
|
||||
- Show 'noendofline' when it would be used for writing ('fileformat' "dos")
|
||||
@@ -241,6 +202,11 @@ entered. (#11151)
|
||||
Add 'keywordprg' to various ftplugin files:
|
||||
https://github.com/vim/vim/pull/5566
|
||||
|
||||
PR #11579 to add visualtext(), return Visually selected text.
|
||||
|
||||
Issue #10512: Dynamic loading broken with Perl 5.36
|
||||
Damien has a patch (2022 Dec 4)
|
||||
|
||||
Add some kind of ":whathappend" command and functions to make visible what the
|
||||
last few typed keys and executed commands are. To be used when the user
|
||||
wonders what went wrong.
|
||||
@@ -257,15 +223,27 @@ Is there a way to make 'autowriteall' make a clean exit when the xterm is
|
||||
closed? (Dennis Nazic says files are preserved, okt 28). Perhaps handle TERM
|
||||
like HUP?
|
||||
|
||||
Improvement in terminal configuration mess: Request the terminfo entry from
|
||||
the terminal itself. The $TERM value then is only relevant for whether this
|
||||
feature is supported or not. Replaces the xterm mechanism to request each
|
||||
entry separately. #6609
|
||||
Multiplexers (screen, tmux) can request it to the underlying terminal, and
|
||||
pass it on with modifications.
|
||||
How to get all the text quickly (also over ssh)? Can we use a side channel?
|
||||
|
||||
Horizontal mouse scroll only works when compiled with GUI? #11374
|
||||
Better terminal emulator support:
|
||||
> Somehow request the terminfo entry from the terminal itself. The $TERM
|
||||
value then is only relevant for whether this feature is supported or not.
|
||||
Replaces the xterm mechanism to request each entry separately. #6609
|
||||
Multiplexers (screen, tmux) can request it to the underlying terminal, and
|
||||
pass it on with modifications.
|
||||
How to get all the text quickly (also over ssh)? Can we use a side channel?
|
||||
> When xterm supports sending an Escape sequence for the Esc key, should
|
||||
have a way to request this state. That could be an XTGETTCAP entry, e.g.
|
||||
"k!". Add "esc_sends_sequence" flag.
|
||||
If we know this state, then do not pretend going out of Insert mode in
|
||||
vgetorpeek(), where kitty_protocol_state is checked.
|
||||
> If a response ends up in a shell command, one way to avoid this is by
|
||||
sending t_RV last and delay starting a shell command until the response
|
||||
has been seen.
|
||||
> Can we use the req_more_codes_from_term() mechanism with more terminals?
|
||||
Should we repeat it after executing a shell command?
|
||||
Can also add this to the 'keyprotocol' option: "mok2+tcap"
|
||||
> In the table of terminal names pointing to the list of termcap entries,
|
||||
add an optional additional one. So that "xterm-kitty" can first load
|
||||
"xterm" and then add "kitty" entries.
|
||||
|
||||
Using "A" and "o" in manually created fold (in empty buffer) does not behave
|
||||
consistenly (James McCoy, #10698)
|
||||
@@ -276,8 +254,6 @@ overwritten. Could use ":echowin" and call redraw_cmd() in get_user_input().
|
||||
|
||||
Syntax include problem: #11277. Related to Patch 8.2.2761
|
||||
|
||||
Add str2blob() and blob2str() ? #4049
|
||||
|
||||
To avoid flicker: add an option that when a screen clear is requested, instead
|
||||
of clearing it draws everything and uses "clear to end of line" for every line.
|
||||
Resetting 't_ut' already causes this?
|
||||
@@ -299,6 +275,15 @@ Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
|
||||
initialization to figure out the default value from 'shell'. Add a test for
|
||||
this.
|
||||
|
||||
Support translations for plugins: #11637
|
||||
- Need a tool like xgettext for Vim script, generates a .pot file.
|
||||
Need the equivalent of _() and N_(), perhaps TR() and TRN().
|
||||
- Instructions for how to create .po files and translate.
|
||||
- Script or Makefile to generate .mo files.
|
||||
- Instructions and perhaps a script to install the .mo files in the right
|
||||
place.
|
||||
- Add variant of gettext() that takes a package name.
|
||||
|
||||
With concealed text mouse click doesn't put the cursor in the right position.
|
||||
(Herb Sitz) Fix by Christian Brabandt, 2011 Jun 16. Doesn't work properly,
|
||||
need to make the change in where RET_WIN_BUF_CHARTABSIZE() is called.
|
||||
@@ -2668,13 +2653,6 @@ Awaiting updated patches:
|
||||
- Add possibility to highlight specific columns (for Fortran). Or put a
|
||||
line in between columns (e.g., for 'textwidth').
|
||||
Patch to add 'hlcolumn' from Vit Stradal, 2004 May 20.
|
||||
8 Add functions:
|
||||
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
|
||||
Update 2004 Sep 10
|
||||
Another patch from Edward L. Fox (2005 Nov 24)
|
||||
Search in 'runtimepath'?
|
||||
More docs needed about how to use this.
|
||||
How to get the messages into the .po files?
|
||||
confirm() add "flags" argument, with 'v' for vertical
|
||||
layout and 'c' for console dialog. (Haegg)
|
||||
Flemming Madsen has a patch for the 'c' flag
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 9.0. Last change: 2022 Nov 22
|
||||
*usr_41.txt* For Vim version 9.0. Last change: 2022 Dec 05
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -1031,6 +1031,7 @@ Buffers, windows and the argument list:
|
||||
getwininfo() get a list with window information
|
||||
getchangelist() get a list of change list entries
|
||||
getjumplist() get a list of jump list entries
|
||||
swapfilelist() list of existing swap files in 'directory'
|
||||
swapinfo() information about a swap file
|
||||
swapname() get the swap file path of a buffer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 9.0. Last change: 2022 Nov 14
|
||||
*vim9.txt* For Vim version 9.0. Last change: 2022 Dec 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -336,6 +336,9 @@ Defining a class ~
|
||||
A class is defined between `:class` and `:endclass`. The whole class is
|
||||
defined in one script file. It is not possible to add to a class later.
|
||||
|
||||
A class can only be defined in a |Vim9| script file. *E1315*
|
||||
A class cannot be defined inside a function.
|
||||
|
||||
It is possible to define more than one class in a script file. Although it
|
||||
usually is better to export only one main class. It can be useful to define
|
||||
types, enums and helper classes though.
|
||||
@@ -369,9 +372,9 @@ A class can extend one other class.
|
||||
*implements*
|
||||
A class can implement one or more interfaces.
|
||||
*specifies*
|
||||
A class can declare it's interface, the object members and methods, with a
|
||||
A class can declare its interface, the object members and methods, with a
|
||||
named interface. This avoids the need for separately specifying the
|
||||
interface, which is often done an many languages, especially Java.
|
||||
interface, which is often done in many languages, especially Java.
|
||||
|
||||
|
||||
Defining an interface ~
|
||||
@@ -634,7 +637,7 @@ directly writing you get an error, which makes you wonder if you actually want
|
||||
to allow that. This helps writing code with fewer mistakes.
|
||||
|
||||
|
||||
Making object membes private with an underscore ~
|
||||
Making object members private with an underscore ~
|
||||
|
||||
When an object member is private, it can only be read and changed inside the
|
||||
class (and in sub-classes), then it cannot be used outside of the class.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*visual.txt* For Vim version 9.0. Last change: 2022 Jun 18
|
||||
*visual.txt* For Vim version 9.0. Last change: 2022 Dec 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -152,6 +152,11 @@ gN Like |gn| but searches backward, like with `N`.
|
||||
environment variable or the -display argument). Only
|
||||
when 'mouse' option contains 'n' or 'a'.
|
||||
|
||||
<LeftMouseNM> Internal mouse code, used for clicking on the status
|
||||
<LeftReleaseNM> line to focus a window. NM stands for non-mappable.
|
||||
You cannot use these, but they might show up in some
|
||||
places.
|
||||
|
||||
If Visual mode is not active and the "v", "V" or CTRL-V is preceded with a
|
||||
count, the size of the previously highlighted area is used for a start. You
|
||||
can then move the end of the highlighted area and give an operator. The type
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 9.0. Last change: 2022 Nov 22
|
||||
*windows.txt* For Vim version 9.0. Last change: 2022 Nov 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -639,6 +639,8 @@ autocommand event can be used.
|
||||
If you want to get notified of text in windows scrolling vertically or
|
||||
horizontally, the |WinScrolled| autocommand event can be used. This will also
|
||||
trigger in window size changes.
|
||||
Exception: the events will not be triggered when the text scrolls for
|
||||
'incsearch'.
|
||||
*WinResized-event*
|
||||
The |WinResized| event is triggered after updating the display, several
|
||||
windows may have changed size then. A list of the IDs of windows that changed
|
||||
@@ -655,9 +657,9 @@ The information provided by |WinScrolled| is a dictionary for each window that
|
||||
has changes, using the window ID as the key, and a total count of the changes
|
||||
with the key "all". Example value for |v:event| (|Vim9| syntax):
|
||||
{
|
||||
all: {width: 0, height: 2, leftcol: 0, topline: 1, skipcol: 0},
|
||||
1003: {width: 0, height: -1, leftcol: 0, topline: 0, skipcol: 0},
|
||||
1006: {width: 0, height: 1, leftcol: 0, topline: 1, skipcol: 0},
|
||||
all: {width: 0, height: 2, leftcol: 0, skipcol: 0, topline: 1, topfill: 0},
|
||||
1003: {width: 0, height: -1, leftcol: 0, skipcol: 0, topline: 0, topfill: 0},
|
||||
1006: {width: 0, height: 1, leftcol: 0, skipcol: 0, topline: 1, topfill: 0},
|
||||
}
|
||||
|
||||
Note that the "all" entry has the absolute values of the individual windows
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Nov 23
|
||||
" Last Change: 2022 Dec 05
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -1855,8 +1855,9 @@ au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFile
|
||||
" (patterns ending in a start further below)
|
||||
au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH()
|
||||
|
||||
" Zig
|
||||
" Zig and Zir (Zig Intermediate Representation)
|
||||
au BufNewFile,BufRead *.zig setf zig
|
||||
au BufNewFile,BufRead *.zir setf zir
|
||||
|
||||
" Z-Shell script (patterns ending in a star further below)
|
||||
au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: C#
|
||||
" Maintainer: Nick Jensen <nickspoon@gmail.com>
|
||||
" Former Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2021-12-07
|
||||
" Last Change: 2022-11-16
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/nickspoons/vim-cs
|
||||
|
||||
@@ -25,8 +25,9 @@ let b:undo_ftplugin = 'setl com< fo<'
|
||||
|
||||
if exists('loaded_matchit') && !exists('b:match_words')
|
||||
" #if/#endif support included by default
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,'
|
||||
let b:undo_ftplugin .= ' | unlet! b:match_words'
|
||||
let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
|
||||
endif
|
||||
|
||||
if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Sep 20
|
||||
" Last Change: 2022 Nov 27
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -99,7 +99,7 @@ if exists("loaded_matchit")
|
||||
" func name
|
||||
" require a parenthesis following, then there can be an "endfunc".
|
||||
let b:match_words =
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' .
|
||||
\ '{:},' .
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Zig
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_orig = &cpo
|
||||
set cpo&vim
|
||||
|
||||
compiler zig_build
|
||||
|
||||
" Match Zig builtin fns
|
||||
setlocal iskeyword+=@-@
|
||||
|
||||
" Recomended code style, no tabs and 4-space indentation
|
||||
setlocal expandtab
|
||||
setlocal tabstop=8
|
||||
setlocal softtabstop=4
|
||||
setlocal shiftwidth=4
|
||||
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal suffixesadd=.zig,.zir
|
||||
|
||||
if has('comments')
|
||||
setlocal comments=:///,://!,://,:\\\\
|
||||
setlocal commentstring=//\ %s
|
||||
endif
|
||||
|
||||
if has('find_in_path')
|
||||
let &l:includeexpr='substitute(v:fname, "^([^.])$", "\1.zig", "")'
|
||||
let &l:include='\v(\@import>|\@cInclude>|^\s*\#\s*include)'
|
||||
endif
|
||||
|
||||
let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
|
||||
|
||||
if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig')
|
||||
silent let s:env = system('zig env')
|
||||
if v:shell_error == 0
|
||||
let g:zig_std_dir = json_decode(s:env)['std_dir']
|
||||
endif
|
||||
unlet! s:env
|
||||
endif
|
||||
|
||||
if exists('g:zig_std_dir')
|
||||
let &l:path = &l:path . ',' . g:zig_std_dir
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin =
|
||||
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
||||
|
||||
augroup vim-zig
|
||||
autocmd! * <buffer>
|
||||
autocmd BufWritePre <buffer> if get(g:, 'zig_fmt_autosave', 1) | call zig#fmt#Format() | endif
|
||||
augroup END
|
||||
|
||||
let b:undo_ftplugin .= '|au! vim-zig * <buffer>'
|
||||
|
||||
let &cpo = s:cpo_orig
|
||||
unlet s:cpo_orig
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
@@ -0,0 +1,80 @@
|
||||
" Vim filetype indent file
|
||||
" Language: Zig
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
if (!has("cindent") || !has("eval"))
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal cindent
|
||||
|
||||
" L0 -> 0 indent for jump labels (i.e. case statement in c).
|
||||
" j1 -> indenting for "javascript object declarations"
|
||||
" J1 -> see j1
|
||||
" w1 -> starting a new line with `(` at the same indent as `(`
|
||||
" m1 -> if `)` starts a line, match its indent with the first char of its
|
||||
" matching `(` line
|
||||
" (s -> use one indent, when starting a new line after a trailing `(`
|
||||
setlocal cinoptions=L0,m1,(s,j1,J1,l1
|
||||
|
||||
" cinkeys: controls what keys trigger indent formatting
|
||||
" 0{ -> {
|
||||
" 0} -> }
|
||||
" 0) -> )
|
||||
" 0] -> ]
|
||||
" !^F -> make CTRL-F (^F) reindent the current line when typed
|
||||
" o -> when <CR> or `o` is used
|
||||
" O -> when the `O` command is used
|
||||
setlocal cinkeys=0{,0},0),0],!^F,o,O
|
||||
|
||||
setlocal indentexpr=GetZigIndent(v:lnum)
|
||||
|
||||
let b:undo_indent = "setlocal cindent< cinkeys< cinoptions< indentexpr<"
|
||||
|
||||
function! GetZigIndent(lnum)
|
||||
let curretLineNum = a:lnum
|
||||
let currentLine = getline(a:lnum)
|
||||
|
||||
" cindent doesn't handle multi-line strings properly, so force no indent
|
||||
if currentLine =~ '^\s*\\\\.*'
|
||||
return -1
|
||||
endif
|
||||
|
||||
let prevLineNum = prevnonblank(a:lnum-1)
|
||||
let prevLine = getline(prevLineNum)
|
||||
|
||||
" for lines that look like
|
||||
" },
|
||||
" };
|
||||
" try treating them the same as a }
|
||||
if prevLine =~ '\v^\s*},$'
|
||||
if currentLine =~ '\v^\s*};$' || currentLine =~ '\v^\s*}$'
|
||||
return indent(prevLineNum) - 4
|
||||
endif
|
||||
return indent(prevLineNum-1) - 4
|
||||
endif
|
||||
if currentLine =~ '\v^\s*},$'
|
||||
return indent(prevLineNum) - 4
|
||||
endif
|
||||
if currentLine =~ '\v^\s*};$'
|
||||
return indent(prevLineNum) - 4
|
||||
endif
|
||||
|
||||
|
||||
" cindent doesn't handle this case correctly:
|
||||
" switch (1): {
|
||||
" 1 => true,
|
||||
" ~
|
||||
" ^---- indents to here
|
||||
if prevLine =~ '.*=>.*,$' && currentLine !~ '.*}$'
|
||||
return indent(prevLineNum)
|
||||
endif
|
||||
|
||||
return cindent(a:lnum)
|
||||
endfunction
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
" You can also use this as a start for your own set of menus.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Mar 02
|
||||
" Last Change: 2022 Nov 27
|
||||
|
||||
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
|
||||
" in all modes and avoid side effects from mappings defined by the user.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Nov 28
|
||||
" Last Change: 2022 Dec 01
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
|
||||
+13
-6
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Nick Jensen <nickspoon@gmail.com>
|
||||
" Former Maintainers: Anduin Withers <awithers@anduin.com>
|
||||
" Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2022-03-01
|
||||
" Last Change: 2022-11-16
|
||||
" Filenames: *.cs
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/nickspoons/vim-cs
|
||||
@@ -25,6 +25,9 @@ syn keyword csType bool byte char decimal double float int long object sbyte sho
|
||||
syn keyword csType nint nuint " contextual
|
||||
|
||||
syn keyword csStorage enum interface namespace struct
|
||||
syn match csStorage "\<record\ze\_s\+@\=\h\w*\_s*[<(:{;]"
|
||||
syn match csStorage "\%(\<\%(partial\|new\|public\|protected\|internal\|private\|abstract\|sealed\|static\|unsafe\|readonly\)\)\@9<=\_s\+record\>"
|
||||
syn match csStorage "\<record\ze\_s\+\%(class\|struct\)"
|
||||
syn match csStorage "\<delegate\>"
|
||||
syn keyword csRepeat break continue do for foreach goto return while
|
||||
syn keyword csConditional else if switch
|
||||
@@ -44,6 +47,9 @@ syn keyword csManagedModifier managed unmanaged contained
|
||||
" Modifiers
|
||||
syn match csUsingModifier "\<global\ze\_s\+using\>"
|
||||
syn keyword csAccessModifier internal private protected public
|
||||
syn keyword csModifier operator nextgroup=csCheckedModifier skipwhite skipempty
|
||||
syn keyword csCheckedModifier checked contained
|
||||
|
||||
" TODO: in new out
|
||||
syn keyword csModifier abstract const event override readonly sealed static virtual volatile
|
||||
syn match csModifier "\<\%(extern\|fixed\|unsafe\)\>"
|
||||
@@ -76,7 +82,7 @@ syn match csAccess "\<this\>"
|
||||
" Extension method parameter modifier
|
||||
syn match csModifier "\<this\ze\_s\+@\=\h"
|
||||
|
||||
syn keyword csUnspecifiedStatement as in is nameof operator out params ref sizeof stackalloc using
|
||||
syn keyword csUnspecifiedStatement as in is nameof out params ref sizeof stackalloc using
|
||||
syn keyword csUnsupportedStatement value
|
||||
syn keyword csUnspecifiedKeyword explicit implicit
|
||||
|
||||
@@ -183,7 +189,7 @@ syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier disp
|
||||
syn match csUnicodeNumber +\\U00\x\{6}+ contained contains=csUnicodeSpecifier display
|
||||
syn match csUnicodeSpecifier +\\[uUx]+ contained display
|
||||
|
||||
syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn region csString matchgroup=csQuote start=+"+ end=+"\%(u8\)\=+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError,csUnicodeNumber display
|
||||
syn match csCharacter "'\\''" contains=csSpecialChar display
|
||||
syn match csCharacter "'[^\\]'" display
|
||||
@@ -200,7 +206,7 @@ syn match csReal "\<\d\+\%(_\+\d\+\)*[fdm]\>" display
|
||||
syn case match
|
||||
syn cluster csNumber contains=csInteger,csReal
|
||||
|
||||
syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"\%(u8\)\=+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
|
||||
syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBraced,csBracketed,csInterpolationAlign,csInterpolationFormat
|
||||
syn match csEscapedInterpolation "{{" transparent contains=NONE display
|
||||
@@ -210,10 +216,10 @@ syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFor
|
||||
syn match csInterpolationAlignDel +,+ contained display
|
||||
syn match csInterpolationFormatDel +:+ contained display
|
||||
|
||||
syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"+ skip=+""+ extend contains=csVerbatimQuote,@Spell
|
||||
syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"\%(u8\)\=+ skip=+""+ extend contains=csVerbatimQuote,@Spell
|
||||
syn match csVerbatimQuote +""+ contained
|
||||
|
||||
syn region csInterVerbString matchgroup=csQuote start=+$@"+ start=+@$"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell
|
||||
syn region csInterVerbString matchgroup=csQuote start=+$@"+ start=+@$"+ end=+"\%(u8\)\=+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell
|
||||
|
||||
syn cluster csString contains=csString,csInterpolatedString,csVerbatimString,csInterVerbString
|
||||
|
||||
@@ -256,6 +262,7 @@ hi def link csException Exception
|
||||
hi def link csModifier StorageClass
|
||||
hi def link csAccessModifier csModifier
|
||||
hi def link csAsyncModifier csModifier
|
||||
hi def link csCheckedModifier csModifier
|
||||
hi def link csManagedModifier csModifier
|
||||
hi def link csUsingModifier csModifier
|
||||
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
" Vim syntax file
|
||||
" Language: Nix
|
||||
" Maintainer: James Fleming <james@electronic-quill.net>
|
||||
" Original Author: Daiderd Jordan <daiderd@gmail.com>
|
||||
" Acknowledgement: Based on vim-nix maintained by Daiderd Jordan <daiderd@gmail.com>
|
||||
" https://github.com/LnL7/vim-nix
|
||||
" License: MIT
|
||||
" Last Change: 2022 Dec 06
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword nixBoolean true false
|
||||
syn keyword nixNull null
|
||||
syn keyword nixRecKeyword rec
|
||||
|
||||
syn keyword nixOperator or
|
||||
syn match nixOperator '!=\|!'
|
||||
syn match nixOperator '<=\?'
|
||||
syn match nixOperator '>=\?'
|
||||
syn match nixOperator '&&'
|
||||
syn match nixOperator '//\='
|
||||
syn match nixOperator '=='
|
||||
syn match nixOperator '?'
|
||||
syn match nixOperator '||'
|
||||
syn match nixOperator '++\='
|
||||
syn match nixOperator '-'
|
||||
syn match nixOperator '\*'
|
||||
syn match nixOperator '->'
|
||||
|
||||
syn match nixParen '[()]'
|
||||
syn match nixInteger '\d\+'
|
||||
|
||||
syn keyword nixTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||
syn match nixComment '#.*' contains=nixTodo,@Spell
|
||||
syn region nixComment start=+/\*+ end=+\*/+ contains=nixTodo,@Spell
|
||||
|
||||
syn region nixInterpolation matchgroup=nixInterpolationDelimiter start="\${" end="}" contained contains=@nixExpr,nixInterpolationParam
|
||||
|
||||
syn match nixSimpleStringSpecial /\\\%([nrt"\\$]\|$\)/ contained
|
||||
syn match nixStringSpecial /''['$]/ contained
|
||||
syn match nixStringSpecial /\$\$/ contained
|
||||
syn match nixStringSpecial /''\\[nrt]/ contained
|
||||
|
||||
syn match nixSimpleStringSpecial /\$\$/ contained
|
||||
|
||||
syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained
|
||||
syn match nixInvalidStringEscape /''\\[^nrt]/ contained
|
||||
|
||||
syn region nixSimpleString matchgroup=nixStringDelimiter start=+"+ skip=+\\"+ end=+"+ contains=nixInterpolation,nixSimpleStringSpecial,nixInvalidSimpleStringEscape
|
||||
syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$\\]+ end=+''+ contains=nixInterpolation,nixStringSpecial,nixInvalidStringEscape
|
||||
|
||||
syn match nixFunctionCall "[a-zA-Z_][a-zA-Z0-9_'-]*"
|
||||
|
||||
syn match nixPath "[a-zA-Z0-9._+-]*\%(/[a-zA-Z0-9._+-]\+\)\+"
|
||||
syn match nixHomePath "\~\%(/[a-zA-Z0-9._+-]\+\)\+"
|
||||
syn match nixSearchPath "[a-zA-Z0-9._+-]\+\%(\/[a-zA-Z0-9._+-]\+\)*" contained
|
||||
syn match nixPathDelimiter "[<>]" contained
|
||||
syn match nixSearchPathRef "<[a-zA-Z0-9._+-]\+\%(\/[a-zA-Z0-9._+-]\+\)*>" contains=nixSearchPath,nixPathDelimiter
|
||||
syn match nixURI "[a-zA-Z][a-zA-Z0-9.+-]*:[a-zA-Z0-9%/?:@&=$,_.!~*'+-]\+"
|
||||
|
||||
syn match nixAttributeDot "\." contained
|
||||
syn match nixAttribute "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%([^a-zA-Z0-9_'.-]\|$\)" contained
|
||||
syn region nixAttributeAssignment start="=" end="\ze;" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition start=/\ze[a-zA-Z_"$]/ end=";" contained contains=nixComment,nixAttribute,nixInterpolation,nixSimpleString,nixAttributeDot,nixAttributeAssignment
|
||||
|
||||
syn region nixInheritAttributeScope start="(" end="\ze)" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition matchgroup=nixInherit start="\<inherit\>" end=";" contained contains=nixComment,nixInheritAttributeScope,nixAttribute
|
||||
|
||||
syn region nixAttributeSet start="{" end="}" contains=nixComment,nixAttributeDefinition
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixArgumentDefinitionWithDefault matchgroup=nixArgumentDefinition start="[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*?\@=" matchgroup=NONE end="[,}]\@=" transparent contained contains=@nixExpr
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgumentDefinition "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[,}]\@=" contained
|
||||
syn match nixArgumentEllipsis "\.\.\." contained
|
||||
syn match nixArgumentSeparator "," contained
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgOperator '@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:'he=s+1 contained contains=nixAttribute
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgOperator '[a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@'hs=e-1 contains=nixAttribute nextgroup=nixFunctionArgument
|
||||
|
||||
" This is a bit more complicated, because function arguments can be passed in a
|
||||
" very similar form on how attribute sets are defined and two regions with the
|
||||
" same start patterns will shadow each other. Instead of a region we could use a
|
||||
" match on {\_.\{-\}}, which unfortunately doesn't take nesting into account.
|
||||
"
|
||||
" So what we do instead is that we look forward until we are sure that it's a
|
||||
" function argument. Unfortunately, we need to catch comments and both vertical
|
||||
" and horizontal white space, which the following regex should hopefully do:
|
||||
"
|
||||
" "\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*"
|
||||
"
|
||||
" It is also used throught the whole file and is marked with 'v's as well.
|
||||
"
|
||||
" Fortunately the matching rules for function arguments are much simpler than
|
||||
" for real attribute sets, because we can stop when we hit the first ellipsis or
|
||||
" default value operator, but we also need to paste the "whitespace & comments
|
||||
" eating" regex all over the place (marked with 'v's):
|
||||
"
|
||||
" Region match 1: { foo ? ... } or { foo, ... } or { ... } (ellipsis)
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv {----- identifier -----}vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*\%([a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[,?}]\|\.\.\.\)" end="}" contains=nixComment,nixArgumentDefinitionWithDefault,nixArgumentDefinition,nixArgumentEllipsis,nixArgumentSeparator nextgroup=nixArgOperator
|
||||
|
||||
" Now it gets more tricky, because we need to look forward for the colon, but
|
||||
" there could be something like "{}@foo:", even though it's highly unlikely.
|
||||
"
|
||||
" Region match 2: {}
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv@vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv{----- identifier -----} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*}\%(\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\)\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:" end="}" contains=nixComment nextgroup=nixArgOperator
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixSimpleFunctionArgument "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:\([\n ]\)\@="
|
||||
|
||||
syn region nixList matchgroup=nixListBracket start="\[" end="\]" contains=@nixExpr
|
||||
|
||||
syn region nixLetExpr matchgroup=nixLetExprKeyword start="\<let\>" end="\<in\>" contains=nixComment,nixAttributeDefinition
|
||||
|
||||
syn keyword nixIfExprKeyword then contained
|
||||
syn region nixIfExpr matchgroup=nixIfExprKeyword start="\<if\>" end="\<else\>" contains=@nixExpr,nixIfExprKeyword
|
||||
|
||||
syn region nixWithExpr matchgroup=nixWithExprKeyword start="\<with\>" matchgroup=NONE end=";" contains=@nixExpr
|
||||
|
||||
syn region nixAssertExpr matchgroup=nixAssertKeyword start="\<assert\>" matchgroup=NONE end=";" contains=@nixExpr
|
||||
|
||||
syn cluster nixExpr contains=nixBoolean,nixNull,nixOperator,nixParen,nixInteger,nixRecKeyword,nixConditional,nixBuiltin,nixSimpleBuiltin,nixComment,nixFunctionCall,nixFunctionArgument,nixArgOperator,nixSimpleFunctionArgument,nixPath,nixHomePath,nixSearchPathRef,nixURI,nixAttributeSet,nixList,nixSimpleString,nixString,nixLetExpr,nixIfExpr,nixWithExpr,nixAssertExpr,nixInterpolation
|
||||
|
||||
" These definitions override @nixExpr and have to come afterwards:
|
||||
|
||||
syn match nixInterpolationParam "[a-zA-Z_][a-zA-Z0-9_'-]*\%(\.[a-zA-Z_][a-zA-Z0-9_'-]*\)*" contained
|
||||
|
||||
" Non-namespaced Nix builtins as of version 2.0:
|
||||
syn keyword nixSimpleBuiltin
|
||||
\ abort baseNameOf derivation derivationStrict dirOf fetchGit
|
||||
\ fetchMercurial fetchTarball import isNull map mapAttrs placeholder removeAttrs
|
||||
\ scopedImport throw toString
|
||||
|
||||
|
||||
" Namespaced and non-namespaced Nix builtins as of version 2.0:
|
||||
syn keyword nixNamespacedBuiltin contained
|
||||
\ abort add addErrorContext all any attrNames attrValues baseNameOf
|
||||
\ catAttrs compareVersions concatLists concatStringsSep currentSystem
|
||||
\ currentTime deepSeq derivation derivationStrict dirOf div elem elemAt
|
||||
\ fetchGit fetchMercurial fetchTarball fetchurl filter \ filterSource
|
||||
\ findFile foldl' fromJSON functionArgs genList \ genericClosure getAttr
|
||||
\ getEnv hasAttr hasContext hashString head import intersectAttrs isAttrs
|
||||
\ isBool isFloat isFunction isInt isList isNull isString langVersion
|
||||
\ length lessThan listToAttrs map mapAttrs match mul nixPath nixVersion
|
||||
\ parseDrvName partition path pathExists placeholder readDir readFile
|
||||
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
||||
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
||||
\ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency
|
||||
\ unsafeDiscardStringContext unsafeGetAttrPos valueSize fromTOML bitAnd
|
||||
\ bitOr bitXor floor ceil
|
||||
|
||||
syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin
|
||||
|
||||
hi def link nixArgOperator Operator
|
||||
hi def link nixArgumentDefinition Identifier
|
||||
hi def link nixArgumentEllipsis Operator
|
||||
hi def link nixAssertKeyword Keyword
|
||||
hi def link nixAttribute Identifier
|
||||
hi def link nixAttributeDot Operator
|
||||
hi def link nixBoolean Boolean
|
||||
hi def link nixBuiltin Special
|
||||
hi def link nixComment Comment
|
||||
hi def link nixConditional Conditional
|
||||
hi def link nixHomePath Include
|
||||
hi def link nixIfExprKeyword Keyword
|
||||
hi def link nixInherit Keyword
|
||||
hi def link nixInteger Integer
|
||||
hi def link nixInterpolation Macro
|
||||
hi def link nixInterpolationDelimiter Delimiter
|
||||
hi def link nixInterpolationParam Macro
|
||||
hi def link nixInvalidSimpleStringEscape Error
|
||||
hi def link nixInvalidStringEscape Error
|
||||
hi def link nixLetExprKeyword Keyword
|
||||
hi def link nixNamespacedBuiltin Special
|
||||
hi def link nixNull Constant
|
||||
hi def link nixOperator Operator
|
||||
hi def link nixPath Include
|
||||
hi def link nixPathDelimiter Delimiter
|
||||
hi def link nixRecKeyword Keyword
|
||||
hi def link nixSearchPath Include
|
||||
hi def link nixSimpleBuiltin Keyword
|
||||
hi def link nixSimpleFunctionArgument Identifier
|
||||
hi def link nixSimpleString String
|
||||
hi def link nixSimpleStringSpecial SpecialChar
|
||||
hi def link nixString String
|
||||
hi def link nixStringDelimiter Delimiter
|
||||
hi def link nixStringSpecial Special
|
||||
hi def link nixTodo Todo
|
||||
hi def link nixURI Include
|
||||
hi def link nixWithExprKeyword Keyword
|
||||
|
||||
" This could lead up to slow syntax highlighting for large files, but usually
|
||||
" large files such as all-packages.nix are one large attribute set, so if we'd
|
||||
" use sync patterns we'd have to go back to the start of the file anyway
|
||||
syn sync fromstart
|
||||
|
||||
let b:current_syntax = "nix"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
+47
-16
@@ -2,7 +2,7 @@
|
||||
" Language: rego policy language
|
||||
" Maintainer: Matt Dunford (zenmatic@gmail.com)
|
||||
" URL: https://github.com/zenmatic/vim-syntax-rego
|
||||
" Last Change: 2019 Dec 12
|
||||
" Last Change: 2022 Dec 4
|
||||
|
||||
" https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
|
||||
@@ -14,36 +14,56 @@ endif
|
||||
syn case match
|
||||
|
||||
syn keyword regoDirective package import allow deny
|
||||
syn keyword regoKeywords as default else false not null true with some
|
||||
syn keyword regoKeywords as default else every false if import package not null true with some in print
|
||||
|
||||
syn keyword regoFuncAggregates count sum product max min sort all any
|
||||
syn match regoFuncArrays "\<array\.\(concat\|slice\)\>"
|
||||
syn match regoFuncArrays "\<array\.\(concat\|slice\|reverse\)\>"
|
||||
syn keyword regoFuncSets intersection union
|
||||
|
||||
syn keyword regoFuncStrings concat /\<contains\>/ endswith format_int indexof lower replace split sprintf startswith substring trim trim_left trim_prefix trim_right trim_suffix trim_space upper
|
||||
syn match regoFuncStrings2 "\<strings\.replace_n\>"
|
||||
syn keyword regoFuncStrings concat /\<contains\>/ endswith format_int indexof indexof_n lower replace split sprintf startswith substring trim trim_left trim_prefix trim_right trim_suffix trim_space upper
|
||||
syn match regoFuncStrings2 "\<strings\.\(replace_n\|reverse\|any_prefix_match\|any_suffix_match\)\>"
|
||||
syn match regoFuncStrings3 "\<contains\>"
|
||||
|
||||
syn keyword regoFuncRegex re_match
|
||||
syn match regoFuncRegex2 "\<regex\.\(split\|globs_match\|template_match\|find_n\|find_all_string_submatch_n\)\>"
|
||||
syn match regoFuncRegex2 "\<regex\.\(is_valid\|split\|globs_match\|template_match\|find_n\|find_all_string_submatch_n\|replace\)\>"
|
||||
|
||||
syn match regoFuncUuid "\<uuid.rfc4122\>"
|
||||
syn match regoFuncBits "\<bits\.\(or\|and\|negate\|xor\|lsh\|rsh\)\>"
|
||||
syn match regoFuncObject "\<object\.\(get\|remove\|subset\|union\|union_n\|filter\)\>"
|
||||
syn match regoFuncGlob "\<glob\.\(match\|quote_meta\)\>"
|
||||
syn match regoFuncUnits "\<units\.parse_bytes\>"
|
||||
syn match regoFuncUnits "\<units\.parse\(_bytes\)\=\>"
|
||||
syn keyword regoFuncTypes is_number is_string is_boolean is_array is_set is_object is_null type_name
|
||||
syn match regoFuncEncoding1 "\<\(base64\|base64url\)\.\(encode\|decode\)\>"
|
||||
syn match regoFuncEncoding2 "\<urlquery\.\(encode\|decode\|encode_object\)\>"
|
||||
syn match regoFuncEncoding3 "\<\(json\|yaml\)\.\(marshal\|unmarshal\)\>"
|
||||
syn match regoFuncEncoding1 "\<base64\.\(encode\|decode\|is_valid\)\>"
|
||||
syn match regoFuncEncoding2 "\<base64url\.\(encode\(_no_pad\)\=\|decode\)\>"
|
||||
syn match regoFuncEncoding3 "\<urlquery\.\(encode\|decode\|\(en\|de\)code_object\)\>"
|
||||
syn match regoFuncEncoding4 "\<\(json\|yaml\)\.\(is_valid\|marshal\|unmarshal\)\>"
|
||||
syn match regoFuncEncoding5 "\<json\.\(filter\|patch\|remove\)\>"
|
||||
syn match regoFuncTokenSigning "\<io\.jwt\.\(encode_sign_raw\|encode_sign\)\>"
|
||||
syn match regoFuncTokenVerification "\<io\.jwt\.\(verify_rs256\|verify_ps256\|verify_es256\|verify_hs256\|decode\|decode_verify\)\>"
|
||||
syn match regoFuncTime "\<time\.\(now_ns\|parse_ns\|parse_rfc3339_ns\|parse_duration_ns\|date\|clock\|weekday\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.x509\.parse_certificates\>"
|
||||
syn match regoFuncTokenVerification1 "\<io\.jwt\.\(decode\|decode_verify\)\>"
|
||||
syn match regoFuncTokenVerification2 "\<io\.jwt\.verify_\(rs\|ps\|es\|hs\)\(256\|384\|512\)\>"
|
||||
syn match regoFuncTime "\<time\.\(now_ns\|parse_ns\|parse_rfc3339_ns\|parse_duration_ns\|date\|clock\|weekday\|diff\|add_date\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.x509\.\(parse_certificates\|parse_certificate_request\|parse_and_verify_certificates\|parse_rsa_private_key\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.\(md5\|sha1\|sha256\)"
|
||||
syn match regoFuncCryptography "\<crypto\.hmac\.\(md5\|sha1\|sha256\|sha512\)"
|
||||
syn keyword regoFuncGraphs walk
|
||||
syn match regoFuncGraphs2 "\<graph\.reachable\(_paths\)\=\>"
|
||||
syn match regoFuncGraphQl "\<graphql\.\(\(schema_\)\=is_valid\|parse\(_\(and_verify\|query\|schema\)\)\=\)\>"
|
||||
syn match regoFuncHttp "\<http\.send\>"
|
||||
syn match regoFuncNet "\<net\.\(cidr_contains\|cidr_intersects\)\>"
|
||||
syn match regoFuncRego "\<rego\.parse_module\>"
|
||||
syn match regoFuncNet "\<net\.\(cidr_merge\|cidr_contains\|cidr_contains_matches\|cidr_intersects\|cidr_expand\|lookup_ip_addr\|cidr_is_valid\)\>"
|
||||
syn match regoFuncRego "\<rego\.\(parse_module\|metadata\.\(rule\|chain\)\)\>"
|
||||
syn match regoFuncOpa "\<opa\.runtime\>"
|
||||
syn keyword regoFuncDebugging trace
|
||||
syn match regoFuncRand "\<rand\.intn\>"
|
||||
|
||||
syn match regoFuncNumbers "\<numbers\.\(range\|intn\)\>"
|
||||
syn keyword regoFuncNumbers round ceil floor abs
|
||||
|
||||
syn match regoFuncSemver "\<semver\.\(is_valid\|compare\)\>"
|
||||
syn keyword regoFuncConversions to_number
|
||||
syn match regoFuncHex "\<hex\.\(encode\|decode\)\>"
|
||||
|
||||
hi def link regoFuncUuid Statement
|
||||
hi def link regoFuncBits Statement
|
||||
hi def link regoDirective Statement
|
||||
hi def link regoKeywords Statement
|
||||
hi def link regoFuncAggregates Statement
|
||||
@@ -60,16 +80,27 @@ hi def link regoFuncTypes Statement
|
||||
hi def link regoFuncEncoding1 Statement
|
||||
hi def link regoFuncEncoding2 Statement
|
||||
hi def link regoFuncEncoding3 Statement
|
||||
hi def link regoFuncEncoding4 Statement
|
||||
hi def link regoFuncEncoding5 Statement
|
||||
hi def link regoFuncTokenSigning Statement
|
||||
hi def link regoFuncTokenVerification Statement
|
||||
hi def link regoFuncTokenVerification1 Statement
|
||||
hi def link regoFuncTokenVerification2 Statement
|
||||
hi def link regoFuncTime Statement
|
||||
hi def link regoFuncCryptography Statement
|
||||
hi def link regoFuncGraphs Statement
|
||||
hi def link regoFuncGraphQl Statement
|
||||
hi def link regoFuncGraphs2 Statement
|
||||
hi def link regoFuncHttp Statement
|
||||
hi def link regoFuncNet Statement
|
||||
hi def link regoFuncRego Statement
|
||||
hi def link regoFuncOpa Statement
|
||||
hi def link regoFuncDebugging Statement
|
||||
hi def link regoFuncObject Statement
|
||||
hi def link regoFuncNumbers Statement
|
||||
hi def link regoFuncSemver Statement
|
||||
hi def link regoFuncConversions Statement
|
||||
hi def link regoFuncHex Statement
|
||||
hi def link regoFuncRand Statement
|
||||
|
||||
" https://www.openpolicyagent.org/docs/latest/policy-language/#strings
|
||||
syn region regoString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
|
||||
+24
-27
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Jul 08, 2022
|
||||
" Version: 203
|
||||
" Last Change: Nov 25, 2022
|
||||
" Version: 204
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras
|
||||
@@ -84,15 +84,9 @@ elseif g:sh_fold_enabled != 0 && !has("folding")
|
||||
let g:sh_fold_enabled= 0
|
||||
echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support"
|
||||
endif
|
||||
if !exists("s:sh_fold_functions")
|
||||
let s:sh_fold_functions= and(g:sh_fold_enabled,1)
|
||||
endif
|
||||
if !exists("s:sh_fold_heredoc")
|
||||
let s:sh_fold_heredoc = and(g:sh_fold_enabled,2)
|
||||
endif
|
||||
if !exists("s:sh_fold_ifdofor")
|
||||
let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4)
|
||||
endif
|
||||
let s:sh_fold_functions= and(g:sh_fold_enabled,1)
|
||||
let s:sh_fold_heredoc = and(g:sh_fold_enabled,2)
|
||||
let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4)
|
||||
if g:sh_fold_enabled && &fdm == "manual"
|
||||
" Given that the user provided g:sh_fold_enabled
|
||||
" AND g:sh_fold_enabled is manual (usual default)
|
||||
@@ -113,6 +107,9 @@ endif
|
||||
|
||||
" Set up folding commands for shell {{{1
|
||||
" =================================
|
||||
sil! delc ShFoldFunctions
|
||||
sil! delc ShFoldHereDoc
|
||||
sil! delc ShFoldIfDoFor
|
||||
if s:sh_fold_functions
|
||||
com! -nargs=* ShFoldFunctions <args> fold
|
||||
else
|
||||
@@ -415,22 +412,22 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup
|
||||
" Here Documents: {{{1
|
||||
" (modified by Felipe Contreras)
|
||||
" =========================================
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1$"
|
||||
|
||||
|
||||
" Here Strings: {{{1
|
||||
|
||||
+33
-35
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 9.0 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: October 20, 2022
|
||||
" Version: 9.0-08
|
||||
" Last Change: December 06, 2022
|
||||
" Version: 9.0-14
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -19,39 +19,38 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a ar[gs] argl[ocal] bad[d] bn[ext] breakl[ist] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier echow[indow] enddef endinterface ex files fini[sh] folddoc[losed] go[to] ha[rdcopy] hid[e] if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argu[ment] balt bo[tright] bro[wse] c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec el[se] endenum endt[ry] exi[t] filet fir[st] foldo[pen] gr[ep] helpc[lose] his[tory] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bp[revious] bufdo ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delfunction dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] elsei[f] endfo[r] endw[hile] exp filetype fix[del] for grepa[dd] helpf[ind] hor[izontal] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] au bel[owright] br[ewind] buffers cabc[lear] call cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] em[enu] endfun ene[w] export filt[er] fo[ld] fun gui helpg[rep] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp static sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xnoreme xwininfo
|
||||
syn keyword vimCommand contained abstract argdo bN[ext] bf[irst] brea[k] bun[load] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] en[dif] endfunc enum exu[sage] fin[d] foldc[lose] func gvim helpt[ags] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] return rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained addd arge[dit] b[uffer] bl[ast] breaka[dd] bw[ipeout] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endclass endfunction eval f[ile] fina[lly] foldd[oopen] function h[elp] hi iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xprop z[^.=]
|
||||
syn keyword vimCommand contained al[l] argg[lobal] ba[ll] bm[odified] breakd[el] cN[ext]
|
||||
syn keyword vimCommand contained a ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec el[se] endfun eval f[ile] fina[lly] foldd[oopen] function h[elp] hi iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delfunction dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] elsei[f] endfunc ex files fini[sh] folddoc[losed] go[to] ha[rdcopy] hid[e] if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] call cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] em[enu] endfunction exi[t] filet fir[st] foldo[pen] gr[ep] helpc[lose] his[tory] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] en[dif] endt[ry] exp filetype fix[del] for grepa[dd] helpf[ind] hor[izontal] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xnoreme xwininfo
|
||||
syn keyword vimCommand contained addd argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon enddef endw[hile] export filt[er] fo[ld] fun gui helpg[rep] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained al[l] arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier echow[indow] endfo[r] ene[w] exu[sage] fin[d] foldc[lose] func gvim helpt[ags] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] return rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xprop z[^.=]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns
|
||||
|
||||
" vimOptions are caught only when contained in a vimSet {{{2
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispoptions lop ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc sp spf sps stal suffixes sws tabpagemax tags tc termwinscroll tfu title toolbariconsize ttimeout ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw lispwords lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spc spk sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tgc titlelen top ttimeoutlen ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr list lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj smoothscroll spell spl srr statusline sw sxq tag tal tenc termwintype tgst titleold tpm ttm tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs listchars ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm sms spellcapcheck splitbelow ss stl swapfile syn tagbsearch tb term terse thesaurus titlestring tr tty twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lm lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm sn spellfile splitkeep ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurusfunc tl ts ttybuiltin tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lmap luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase so spelllang splitright ssop sts swb syntax tagfunc tbidi termencoding textmode tildeop tm tsl ttyfast twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace lnr lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent softtabstop spelloptions spo st su swf ta taglength tbis termguicolors textwidth timeout to tsr ttym twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp loadplugins lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab sol spellsuggest spr sta sua switchbuf tabline tagrelative tbs termwinkey tf timeoutlen toolbar tsrfu ttymouse
|
||||
syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langmap linebreak lm lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm sn spellfile splitkeep ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurusfunc tl ts ttybuiltin tws undodir varsofttabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
|
||||
syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langmenu lines lmap luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase so spelllang splitright ssop sts swb syntax tagfunc tbidi termencoding textmode tildeop tm tsl ttyfast twsl undofile vartabstop vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
|
||||
syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endoffile errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keyprotocol langnoremap linespace lnr lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent softtabstop spelloptions spo st su swf ta taglength tbis termguicolors textwidth timeout to tsr ttym twt undolevels vb viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
|
||||
syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm endofline errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp keywordprg langremap lisp loadplugins lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab sol spellsuggest spr sta sua switchbuf tabline tagrelative tbs termwinkey tf timeoutlen toolbar tsrfu ttymouse tx undoreload vbs viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
|
||||
syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei eof esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint km laststatus lispoptions lop ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc sp spf sps stal suffixes sws tabpagemax tags tc termwinscroll tfu title toolbariconsize ttimeout ttyscroll uc updatecount vdir vif vts wcr wi wildmenu winfixheight wiv wrap ws
|
||||
syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kmp lazyredraw lispwords lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spc spk sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tgc titlelen top ttimeoutlen ttytype udf updatetime ve viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
|
||||
syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js kp lbr list lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj smoothscroll spell spl srr statusline sw sxq tag tal tenc termwintype tgst titleold tpm ttm tw udir ur verbose viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
|
||||
syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key kpc lcs listchars ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm sms spellcapcheck splitbelow ss stl swapfile syn tagbsearch tb term terse thesaurus titlestring tr tty twk ul ut verbosefile
|
||||
|
||||
" vimOptions: These are the turn-off setting variants {{{2
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousehide noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosmoothscroll nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendofline noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nonu noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosms nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified nomousefocus nonumber
|
||||
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoindent noautowrite noawa noballoonevalterm nobin nobl nobri noci nocompatible nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noemoji noeof noerrorbells noex nofen nofixendofline nofkmap nofsync noguipty nohk nohkp noic noim noimd noinf nois nolangnoremap nolbr nolist nolpl noma nomh nomod nomodifiable nomousef nonu noopendevice nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosmoothscroll nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
|
||||
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noasd noautoread noautowriteall nobackup nobeval nobinary nobomb nobuflisted nocin noconfirm nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noendoffile noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomodeline nomodified nomousefocus nonumber nopaste nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosms nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup noxtermcodes
|
||||
syn keyword vimOption contained noakm noanti noarab noari noautochdir noautoshelldir noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noendofline noequalalways noet noexrc nofileignorecase nofk nofs nogdefault nohidden nohkmapp nohlsearch noignorecase noimcmdline noincsearch noinsertmode nojs nolazyredraw nolisp noloadplugins nolz nomagic nomle nomodelineexpr nomore nomousehide noodev nopi
|
||||
|
||||
" vimOptions: These are the invertible variants {{{2
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousehide invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsmoothscroll invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendofline inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invnu invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsms invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified invmousefocus invnumber
|
||||
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoindent invautowrite invawa invballoonevalterm invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji inveof inverrorbells invex invfen invfixendofline invfkmap invfsync invguipty invhk invhkp invic invim invimd invinf invis invlangnoremap invlbr invlist invlpl invma invmh invmod invmodifiable invmousef invnu invopendevice invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsmoothscroll invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
|
||||
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invasd invautoread invautowriteall invbackup invbeval invbinary invbomb invbuflisted invcin invconfirm invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invendoffile inveol invesckeys invexpandtab invfic invfixeol invfoldenable invgd invhid invhkmap invhls invicon invimc invimdisable invinfercase invjoinspaces invlangremap invlinebreak invlnr invlrm invmacatsui invml invmodeline invmodified invmousefocus invnumber invpaste invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsms invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup invxtermcodes
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautochdir invautoshelldir invaw invballooneval invbevalterm invbk invbreakindent invcf invcindent invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invemo invendofline invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs invlazyredraw invlisp invloadplugins invlz invmagic invmle invmodelineexpr invmore invmousehide invodev invpi
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_Ds t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_KH t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_ds t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_fe t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke t_KF t_kh t_kI
|
||||
syn keyword vimOption contained t_8b t_8u t_AF t_AL t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_Ds t_EI t_F2 t_F4 t_F6 t_F8 t_fd t_fs t_IE t_k1 t_k2 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_kb t_KB t_kd t_KD t_KE t_KG t_KH t_KI t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_PE t_PS t_RB t_RC t_RF t_Ri t_RI t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_Si t_SI t_so t_sr t_SR t_ST t_te t_Te t_TE t_ti t_TI t_ts t_Ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AB t_al t_AU t_BD t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_ds t_EC t_F1 t_F3 t_F5 t_F7 t_F9 t_fe t_GP t_IS t_K1 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_KA t_kB t_KC t_kD t_ke t_KF t_kh t_kI t_KJ
|
||||
syn match vimOption contained "t_%1"
|
||||
syn match vimOption contained "t_#2"
|
||||
syn match vimOption contained "t_#4"
|
||||
@@ -67,8 +66,8 @@ syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beauti
|
||||
|
||||
" AutoCmd Events {{{2
|
||||
syn case ignore
|
||||
syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWrite BufWritePost CmdlineChanged CmdlineLeave CmdwinEnter ColorScheme CompleteChanged CompleteDonePre CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileExplorer FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinScrolled
|
||||
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre BufWinEnter BufWipeout BufWriteCmd BufWritePre CmdlineEnter CmdUndefined CmdwinLeave ColorSchemePre CompleteDone CursorHold
|
||||
syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWrite BufWritePost CmdlineChanged CmdlineLeave CmdwinEnter ColorScheme CompleteChanged CompleteDonePre CursorHoldI CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileExplorer FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinResized WinScrolled
|
||||
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre BufWinEnter BufWipeout BufWriteCmd BufWritePre CmdlineEnter CmdUndefined CmdwinLeave ColorSchemePre CompleteDone CursorHold CursorMoved
|
||||
|
||||
" Highlight commonly used Groupnames {{{2
|
||||
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
|
||||
@@ -79,12 +78,12 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getcharmod getcmdpos getcursorcharpos getftime getmarklist getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys line2byte listener_remove maparg match matchend matchstrpos mode pathshorten popup_close popup_findecho popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos 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_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdscreenpos getcwd getftype getmatches getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join keytrans lispindent localtime mapcheck matchadd matchfuzzy max mzeval perleval popup_create 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 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_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcmdtype getenv getimstatus getmousepos getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode len list2blob log maplist matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog 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 setcmdline 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_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufvar getcharstr getcmdwintype getfontname getjumplist getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcall list2str log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar 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_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getchangelist getcmdcompltype getcompletion getfperm getline getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode libcallnr listener_add luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno 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 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_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchar getcmdline getcurpos getfsize getloclist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line listener_flush map
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan balloon_show bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled extendnew findfile fnameescape foldtextresult get getchar getcmdline getcurpos getfsize getloclist getpos gettabinfo getwinpos globpath histdel hlset input insert islocked job_start json_decode libcallnr listener_add luaeval mapset matchend max mzeval perleval popup_create 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 setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_channel test_null_partial test_setmouse timer_info tolower type values winbufnr win_getid win_id2win winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 balloon_split buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp feedkeys flatten fnamemodify foreground getbufinfo getcharmod getcmdpos getcursorcharpos getftime getmarklist getqflist gettabvar getwinposx has histget hostname inputdialog interrupt isnan job_status json_encode line listener_flush map match matchfuzzy menu_info nextnonblank popup_atcursor popup_dialog 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 setcmdline setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch 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_settime timer_pause toupper typename virtcol wincol win_gettype winlayout winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal autocmd_add blob2list bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filereadable flattennew foldclosed fullcommand getbufline getcharpos getcmdscreenpos getcwd getftype getmatches getreg gettabwinvar getwinposy has_key histnr iconv inputlist invert items job_stop keys line2byte listener_remove maparg matchadd matchfuzzypos min nr2char popup_beval popup_filter_menu popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute 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_srand_seed timer_start tr undofile virtcol2col windowsversion win_gotoid winline winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch autocmd_delete browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filewritable float2nr foldclosedend funcref getbufoneline getcharsearch getcmdtype getenv getimstatus getmousepos getreginfo gettagstack getwinvar haslocaldir hlexists indent inputrestore isabsolutepath job_getchannel join keytrans lispindent localtime mapcheck matchaddpos matchlist mkdir or popup_clear popup_filter_yesno 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 setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapfilelist synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_ignore_error test_null_job test_override test_unknown timer_stop trim undotree visualmode win_execute winheight win_move_separator winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report autocmd_get browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath expr10 filter floor foldlevel function getbufvar getcharstr getcmdwintype getfontname getjumplist getmouseshape getregtype gettext glob hasmapto hlget index inputsave isdirectory job_info js_decode len list2blob log maplist matcharg matchstr mode pathshorten popup_close popup_findecho popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans 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_void timer_stopall trunc uniq wildmenumode win_findbuf win_id2tabwin win_move_statusline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true balloon_gettext bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extend finddir fmod foldtext garbagecollect getchangelist getcmdcompltype getcompletion getfperm getline getpid getscriptinfo getwininfo glob2regpat histadd hlID indexof inputsecret isinf job_setoptions js_encode libcall list2str log10 mapnew matchdelete matchstrpos
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@@ -649,9 +648,8 @@ syn match vimCtrlChar "[--]"
|
||||
|
||||
" Beginners - Patterns that involve ^ {{{2
|
||||
" =========
|
||||
" Adjusted comment pattern - avoid matching string (appears in Vim9 code)
|
||||
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment
|
||||
syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
"syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
|
||||
syn match vimContinue "^\s*\\"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file
|
||||
" Language: wdl
|
||||
" Maintainer: Matt Dunford (zenmatic@gmail.com)
|
||||
" URL: https://github.com/zenmatic/vim-syntax-wdl
|
||||
" Last Change: 2022 Nov 24
|
||||
|
||||
" https://github.com/openwdl/wdl
|
||||
|
||||
" quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
syn keyword wdlStatement alias task input command runtime input output workflow call scatter import as meta parameter_meta in version
|
||||
syn keyword wdlConditional if then else
|
||||
syn keyword wdlType struct Array String File Int Float Boolean Map Pair Object
|
||||
|
||||
syn keyword wdlFunctions stdout stderr read_lines read_tsv read_map read_object read_objects read_json read_int read_string read_float read_boolean write_lines write_tsv write_map write_object write_objects write_json size sub range transpose zip cross length flatten prefix select_first defined basename floor ceil round
|
||||
|
||||
syn region wdlCommandSection start="<<<" end=">>>"
|
||||
|
||||
syn region wdlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region wdlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword wdlTodo contained TODO FIXME XXX BUG
|
||||
syn cluster wdlCommentGroup contains=wdlTodo
|
||||
syn region wdlComment start="#" end="$" contains=@wdlCommentGroup
|
||||
|
||||
hi def link wdlStatement Statement
|
||||
hi def link wdlConditional Conditional
|
||||
hi def link wdlType Type
|
||||
hi def link wdlFunctions Function
|
||||
hi def link wdlString String
|
||||
hi def link wdlCommandSection String
|
||||
hi def link wdlComment Comment
|
||||
hi def link wdlTodo Todo
|
||||
|
||||
let b:current_syntax = 'wdl'
|
||||
@@ -0,0 +1,292 @@
|
||||
" Vim syntax file
|
||||
" Language: Zig
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:zig_syntax_keywords = {
|
||||
\ 'zigBoolean': ["true"
|
||||
\ , "false"]
|
||||
\ , 'zigNull': ["null"]
|
||||
\ , 'zigType': ["bool"
|
||||
\ , "f16"
|
||||
\ , "f32"
|
||||
\ , "f64"
|
||||
\ , "f80"
|
||||
\ , "f128"
|
||||
\ , "void"
|
||||
\ , "type"
|
||||
\ , "anytype"
|
||||
\ , "anyerror"
|
||||
\ , "anyframe"
|
||||
\ , "volatile"
|
||||
\ , "linksection"
|
||||
\ , "noreturn"
|
||||
\ , "allowzero"
|
||||
\ , "i0"
|
||||
\ , "u0"
|
||||
\ , "isize"
|
||||
\ , "usize"
|
||||
\ , "comptime_int"
|
||||
\ , "comptime_float"
|
||||
\ , "c_short"
|
||||
\ , "c_ushort"
|
||||
\ , "c_int"
|
||||
\ , "c_uint"
|
||||
\ , "c_long"
|
||||
\ , "c_ulong"
|
||||
\ , "c_longlong"
|
||||
\ , "c_ulonglong"
|
||||
\ , "c_longdouble"
|
||||
\ , "anyopaque"]
|
||||
\ , 'zigConstant': ["undefined"
|
||||
\ , "unreachable"]
|
||||
\ , 'zigConditional': ["if"
|
||||
\ , "else"
|
||||
\ , "switch"]
|
||||
\ , 'zigRepeat': ["while"
|
||||
\ , "for"]
|
||||
\ , 'zigComparatorWord': ["and"
|
||||
\ , "or"
|
||||
\ , "orelse"]
|
||||
\ , 'zigStructure': ["struct"
|
||||
\ , "enum"
|
||||
\ , "union"
|
||||
\ , "error"
|
||||
\ , "packed"
|
||||
\ , "opaque"]
|
||||
\ , 'zigException': ["error"]
|
||||
\ , 'zigVarDecl': ["var"
|
||||
\ , "const"
|
||||
\ , "comptime"
|
||||
\ , "threadlocal"]
|
||||
\ , 'zigDummyVariable': ["_"]
|
||||
\ , 'zigKeyword': ["fn"
|
||||
\ , "try"
|
||||
\ , "test"
|
||||
\ , "pub"
|
||||
\ , "usingnamespace"]
|
||||
\ , 'zigExecution': ["return"
|
||||
\ , "break"
|
||||
\ , "continue"]
|
||||
\ , 'zigMacro': ["defer"
|
||||
\ , "errdefer"
|
||||
\ , "async"
|
||||
\ , "nosuspend"
|
||||
\ , "await"
|
||||
\ , "suspend"
|
||||
\ , "resume"
|
||||
\ , "export"
|
||||
\ , "extern"]
|
||||
\ , 'zigPreProc': ["catch"
|
||||
\ , "inline"
|
||||
\ , "noinline"
|
||||
\ , "asm"
|
||||
\ , "callconv"
|
||||
\ , "noalias"]
|
||||
\ , 'zigBuiltinFn': ["align"
|
||||
\ , "@addWithOverflow"
|
||||
\ , "@as"
|
||||
\ , "@atomicLoad"
|
||||
\ , "@atomicStore"
|
||||
\ , "@bitCast"
|
||||
\ , "@breakpoint"
|
||||
\ , "@alignCast"
|
||||
\ , "@alignOf"
|
||||
\ , "@cDefine"
|
||||
\ , "@cImport"
|
||||
\ , "@cInclude"
|
||||
\ , "@cUndef"
|
||||
\ , "@clz"
|
||||
\ , "@cmpxchgWeak"
|
||||
\ , "@cmpxchgStrong"
|
||||
\ , "@compileError"
|
||||
\ , "@compileLog"
|
||||
\ , "@ctz"
|
||||
\ , "@popCount"
|
||||
\ , "@divExact"
|
||||
\ , "@divFloor"
|
||||
\ , "@divTrunc"
|
||||
\ , "@embedFile"
|
||||
\ , "@export"
|
||||
\ , "@extern"
|
||||
\ , "@tagName"
|
||||
\ , "@TagType"
|
||||
\ , "@errorName"
|
||||
\ , "@call"
|
||||
\ , "@errorReturnTrace"
|
||||
\ , "@fence"
|
||||
\ , "@fieldParentPtr"
|
||||
\ , "@field"
|
||||
\ , "@unionInit"
|
||||
\ , "@frameAddress"
|
||||
\ , "@import"
|
||||
\ , "@newStackCall"
|
||||
\ , "@asyncCall"
|
||||
\ , "@intToPtr"
|
||||
\ , "@max"
|
||||
\ , "@min"
|
||||
\ , "@memcpy"
|
||||
\ , "@memset"
|
||||
\ , "@mod"
|
||||
\ , "@mulAdd"
|
||||
\ , "@mulWithOverflow"
|
||||
\ , "@splat"
|
||||
\ , "@src"
|
||||
\ , "@bitOffsetOf"
|
||||
\ , "@byteOffsetOf"
|
||||
\ , "@offsetOf"
|
||||
\ , "@OpaqueType"
|
||||
\ , "@panic"
|
||||
\ , "@prefetch"
|
||||
\ , "@ptrCast"
|
||||
\ , "@ptrToInt"
|
||||
\ , "@rem"
|
||||
\ , "@returnAddress"
|
||||
\ , "@setCold"
|
||||
\ , "@Type"
|
||||
\ , "@shuffle"
|
||||
\ , "@reduce"
|
||||
\ , "@select"
|
||||
\ , "@setRuntimeSafety"
|
||||
\ , "@setEvalBranchQuota"
|
||||
\ , "@setFloatMode"
|
||||
\ , "@shlExact"
|
||||
\ , "@This"
|
||||
\ , "@hasDecl"
|
||||
\ , "@hasField"
|
||||
\ , "@shlWithOverflow"
|
||||
\ , "@shrExact"
|
||||
\ , "@sizeOf"
|
||||
\ , "@bitSizeOf"
|
||||
\ , "@sqrt"
|
||||
\ , "@byteSwap"
|
||||
\ , "@subWithOverflow"
|
||||
\ , "@intCast"
|
||||
\ , "@floatCast"
|
||||
\ , "@intToFloat"
|
||||
\ , "@floatToInt"
|
||||
\ , "@boolToInt"
|
||||
\ , "@errSetCast"
|
||||
\ , "@truncate"
|
||||
\ , "@typeInfo"
|
||||
\ , "@typeName"
|
||||
\ , "@TypeOf"
|
||||
\ , "@atomicRmw"
|
||||
\ , "@intToError"
|
||||
\ , "@errorToInt"
|
||||
\ , "@intToEnum"
|
||||
\ , "@enumToInt"
|
||||
\ , "@setAlignStack"
|
||||
\ , "@frame"
|
||||
\ , "@Frame"
|
||||
\ , "@frameSize"
|
||||
\ , "@bitReverse"
|
||||
\ , "@Vector"
|
||||
\ , "@sin"
|
||||
\ , "@cos"
|
||||
\ , "@tan"
|
||||
\ , "@exp"
|
||||
\ , "@exp2"
|
||||
\ , "@log"
|
||||
\ , "@log2"
|
||||
\ , "@log10"
|
||||
\ , "@fabs"
|
||||
\ , "@floor"
|
||||
\ , "@ceil"
|
||||
\ , "@trunc"
|
||||
\ , "@wasmMemorySize"
|
||||
\ , "@wasmMemoryGrow"
|
||||
\ , "@round"]
|
||||
\ }
|
||||
|
||||
function! s:syntax_keyword(dict)
|
||||
for key in keys(a:dict)
|
||||
execute 'syntax keyword' key join(a:dict[key], ' ')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
call s:syntax_keyword(s:zig_syntax_keywords)
|
||||
|
||||
syntax match zigType "\v<[iu][1-9]\d*>"
|
||||
syntax match zigOperator display "\V\[-+/*=^&?|!><%~]"
|
||||
syntax match zigArrowCharacter display "\V->"
|
||||
|
||||
" 12_34 (. but not ..)? (12_34)? (exponent 12_34)?
|
||||
syntax match zigDecNumber display "\v<\d%(_?\d)*%(\.\.@!)?%(\d%(_?\d)*)?%([eE][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigHexNumber display "\v<0x\x%(_?\x)*%(\.\.@!)?%(\x%(_?\x)*)?%([pP][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigOctNumber display "\v<0o\o%(_?\o)*"
|
||||
syntax match zigBinNumber display "\v<0b[01]%(_?[01])*"
|
||||
|
||||
syntax match zigCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
syntax match zigCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syntax match zigCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=zigEscape,zigEscapeError,zigCharacterInvalid,zigCharacterInvalidUnicode
|
||||
syntax match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigCharacterInvalid
|
||||
|
||||
syntax region zigBlock start="{" end="}" transparent fold
|
||||
|
||||
syntax region zigCommentLine start="//" end="$" contains=zigTodo,@Spell
|
||||
syntax region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell
|
||||
|
||||
syntax match zigMultilineStringPrefix /c\?\\\\/ contained containedin=zigMultilineString
|
||||
syntax region zigMultilineString matchgroup=zigMultilineStringDelimiter start="c\?\\\\" end="$" contains=zigMultilineStringPrefix display
|
||||
|
||||
syntax keyword zigTodo contained TODO
|
||||
|
||||
syntax region zigString matchgroup=zigStringDelimiter start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zigEscape,zigEscapeUnicode,zigEscapeError,@Spell
|
||||
syntax match zigEscapeError display contained /\\./
|
||||
syntax match zigEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syntax match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
|
||||
highlight default link zigDecNumber zigNumber
|
||||
highlight default link zigHexNumber zigNumber
|
||||
highlight default link zigOctNumber zigNumber
|
||||
highlight default link zigBinNumber zigNumber
|
||||
|
||||
highlight default link zigBuiltinFn Statement
|
||||
highlight default link zigKeyword Keyword
|
||||
highlight default link zigType Type
|
||||
highlight default link zigCommentLine Comment
|
||||
highlight default link zigCommentLineDoc Comment
|
||||
highlight default link zigDummyVariable Comment
|
||||
highlight default link zigTodo Todo
|
||||
highlight default link zigString String
|
||||
highlight default link zigStringDelimiter String
|
||||
highlight default link zigMultilineString String
|
||||
highlight default link zigMultilineStringContent String
|
||||
highlight default link zigMultilineStringPrefix String
|
||||
highlight default link zigMultilineStringDelimiter Delimiter
|
||||
highlight default link zigCharacterInvalid Error
|
||||
highlight default link zigCharacterInvalidUnicode zigCharacterInvalid
|
||||
highlight default link zigCharacter Character
|
||||
highlight default link zigEscape Special
|
||||
highlight default link zigEscapeUnicode zigEscape
|
||||
highlight default link zigEscapeError Error
|
||||
highlight default link zigBoolean Boolean
|
||||
highlight default link zigNull Boolean
|
||||
highlight default link zigConstant Constant
|
||||
highlight default link zigNumber Number
|
||||
highlight default link zigArrowCharacter zigOperator
|
||||
highlight default link zigOperator Operator
|
||||
highlight default link zigStructure Structure
|
||||
highlight default link zigExecution Special
|
||||
highlight default link zigMacro Macro
|
||||
highlight default link zigConditional Conditional
|
||||
highlight default link zigComparatorWord Keyword
|
||||
highlight default link zigRepeat Repeat
|
||||
highlight default link zigSpecial Special
|
||||
highlight default link zigVarDecl Function
|
||||
highlight default link zigPreProc PreProc
|
||||
highlight default link zigException Exception
|
||||
|
||||
delfunction s:syntax_keyword
|
||||
|
||||
let b:current_syntax = "zig"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet! s:cpo_save
|
||||
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file
|
||||
" Language: Zir
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = "zir"
|
||||
|
||||
syn region zirCommentLine start=";" end="$" contains=zirTodo,@Spell
|
||||
|
||||
syn region zirBlock start="{" end="}" transparent fold
|
||||
|
||||
syn keyword zirKeyword primitive fntype int str as ptrtoint fieldptr deref asm unreachable export ref fn
|
||||
|
||||
syn keyword zirTodo contained TODO
|
||||
|
||||
syn region zirString start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zirEscape,zirEscapeUnicode,zirEscapeError,@Spell
|
||||
|
||||
syn match zirEscapeError display contained /\\./
|
||||
syn match zirEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syn match zirEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
|
||||
syn match zirDecNumber display "\<[0-9]\+\%(.[0-9]\+\)\=\%([eE][+-]\?[0-9]\+\)\="
|
||||
syn match zirHexNumber display "\<0x[a-fA-F0-9]\+\%([a-fA-F0-9]\+\%([pP][+-]\?[0-9]\+\)\?\)\="
|
||||
syn match zirOctNumber display "\<0o[0-7]\+"
|
||||
syn match zirBinNumber display "\<0b[01]\+\%(.[01]\+\%([eE][+-]\?[0-9]\+\)\?\)\="
|
||||
|
||||
syn match zirGlobal display "[^a-zA-Z0-9_]\?\zs@[a-zA-Z0-9_]\+"
|
||||
syn match zirLocal display "[^a-zA-Z0-9_]\?\zs%[a-zA-Z0-9_]\+"
|
||||
|
||||
hi def link zirCommentLine Comment
|
||||
hi def link zirTodo Todo
|
||||
|
||||
hi def link zirKeyword Keyword
|
||||
|
||||
hi def link zirString Constant
|
||||
|
||||
hi def link zirEscape Special
|
||||
hi def link zirEscapeUnicode zirEscape
|
||||
hi def link zirEscapeError Error
|
||||
|
||||
hi def link zirDecNumber Constant
|
||||
hi def link zirHexNumber Constant
|
||||
hi def link zirOctNumber Constant
|
||||
hi def link zirBinNumber Constant
|
||||
|
||||
hi def link zirGlobal Identifier
|
||||
hi def link zirLocal Identifier
|
||||
+5
-2
@@ -2069,6 +2069,9 @@ apply_autocmds_group(
|
||||
&& (event == EVENT_WINLEAVE || event == EVENT_BUFLEAVE)))
|
||||
goto BYPASS_AU;
|
||||
|
||||
if (event == EVENT_CMDLINECHANGED)
|
||||
++aucmd_cmdline_changed_count;
|
||||
|
||||
/*
|
||||
* Save the autocmd_* variables and info about the current buffer.
|
||||
*/
|
||||
@@ -2089,8 +2092,8 @@ apply_autocmds_group(
|
||||
if (fname_io == NULL)
|
||||
{
|
||||
if (event == EVENT_COLORSCHEME || event == EVENT_COLORSCHEMEPRE
|
||||
|| event == EVENT_OPTIONSET
|
||||
|| event == EVENT_MODECHANGED)
|
||||
|| event == EVENT_OPTIONSET
|
||||
|| event == EVENT_MODECHANGED)
|
||||
autocmd_fname = NULL;
|
||||
else if (fname != NULL && !ends_excmd(*fname))
|
||||
autocmd_fname = fname;
|
||||
|
||||
+1
-1
@@ -1195,7 +1195,7 @@ win_lbr_chartabsize(
|
||||
|
||||
cells = text_prop_position(wp, tp, vcol,
|
||||
(vcol + size) % (wp->w_width - col_off) + col_off,
|
||||
&n_extra, &p, NULL, NULL);
|
||||
&n_extra, &p, NULL, NULL, FALSE);
|
||||
#ifdef FEAT_LINEBREAK
|
||||
no_sbr = TRUE; // don't use 'showbreak' now
|
||||
#endif
|
||||
|
||||
+25
-17
@@ -35,7 +35,7 @@ static int compl_match_arraysize;
|
||||
static int compl_startcol;
|
||||
static int compl_selected;
|
||||
|
||||
#define SHOW_FILE_TEXT(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
|
||||
#define SHOW_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
|
||||
|
||||
/*
|
||||
* Returns TRUE if fuzzy completion is supported for a given cmdline completion
|
||||
@@ -339,7 +339,7 @@ cmdline_pum_create(
|
||||
compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize);
|
||||
for (i = 0; i < numMatches; i++)
|
||||
{
|
||||
compl_match_array[i].pum_text = SHOW_FILE_TEXT(i);
|
||||
compl_match_array[i].pum_text = SHOW_MATCH(i);
|
||||
compl_match_array[i].pum_info = NULL;
|
||||
compl_match_array[i].pum_extra = NULL;
|
||||
compl_match_array[i].pum_kind = NULL;
|
||||
@@ -369,7 +369,8 @@ cmdline_pum_create(
|
||||
/*
|
||||
* Display the cmdline completion matches in a popup menu
|
||||
*/
|
||||
void cmdline_pum_display(void)
|
||||
void
|
||||
cmdline_pum_display(void)
|
||||
{
|
||||
pum_display(compl_match_array, compl_match_arraysize, compl_selected);
|
||||
}
|
||||
@@ -377,7 +378,8 @@ void cmdline_pum_display(void)
|
||||
/*
|
||||
* Returns TRUE if the cmdline completion popup menu is being displayed.
|
||||
*/
|
||||
int cmdline_pum_active(void)
|
||||
int
|
||||
cmdline_pum_active(void)
|
||||
{
|
||||
return pum_visible() && compl_match_array != NULL;
|
||||
}
|
||||
@@ -386,7 +388,8 @@ int cmdline_pum_active(void)
|
||||
* Remove the cmdline completion popup menu (if present), free the list of
|
||||
* items and refresh the screen.
|
||||
*/
|
||||
void cmdline_pum_remove(void)
|
||||
void
|
||||
cmdline_pum_remove(void)
|
||||
{
|
||||
int save_p_lz = p_lz;
|
||||
int save_KeyTyped = KeyTyped;
|
||||
@@ -403,7 +406,8 @@ void cmdline_pum_remove(void)
|
||||
KeyTyped = save_KeyTyped;
|
||||
}
|
||||
|
||||
void cmdline_pum_cleanup(cmdline_info_T *cclp)
|
||||
void
|
||||
cmdline_pum_cleanup(cmdline_info_T *cclp)
|
||||
{
|
||||
cmdline_pum_remove();
|
||||
wildmenu_cleanup(cclp);
|
||||
@@ -413,7 +417,8 @@ void cmdline_pum_cleanup(cmdline_info_T *cclp)
|
||||
* Returns the starting column number to use for the cmdline completion popup
|
||||
* menu.
|
||||
*/
|
||||
int cmdline_compl_startcol(void)
|
||||
int
|
||||
cmdline_compl_startcol(void)
|
||||
{
|
||||
return compl_startcol;
|
||||
}
|
||||
@@ -484,7 +489,6 @@ win_redr_status_matches(
|
||||
int match,
|
||||
int showtail)
|
||||
{
|
||||
#define L_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
|
||||
int row;
|
||||
char_u *buf;
|
||||
int len;
|
||||
@@ -520,7 +524,7 @@ win_redr_status_matches(
|
||||
highlight = FALSE;
|
||||
}
|
||||
// count 1 for the ending ">"
|
||||
clen = status_match_len(xp, L_MATCH(match)) + 3;
|
||||
clen = status_match_len(xp, SHOW_MATCH(match)) + 3;
|
||||
if (match == 0)
|
||||
first_match = 0;
|
||||
else if (match < first_match)
|
||||
@@ -533,7 +537,7 @@ win_redr_status_matches(
|
||||
{
|
||||
// check if match fits on the screen
|
||||
for (i = first_match; i < match; ++i)
|
||||
clen += status_match_len(xp, L_MATCH(i)) + 2;
|
||||
clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
|
||||
if (first_match > 0)
|
||||
clen += 2;
|
||||
// jumping right, put match at the left
|
||||
@@ -544,7 +548,7 @@ win_redr_status_matches(
|
||||
clen = 2;
|
||||
for (i = match; i < num_matches; ++i)
|
||||
{
|
||||
clen += status_match_len(xp, L_MATCH(i)) + 2;
|
||||
clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
|
||||
if ((long)clen >= Columns)
|
||||
break;
|
||||
}
|
||||
@@ -555,7 +559,7 @@ win_redr_status_matches(
|
||||
if (add_left)
|
||||
while (first_match > 0)
|
||||
{
|
||||
clen += status_match_len(xp, L_MATCH(first_match - 1)) + 2;
|
||||
clen += status_match_len(xp, SHOW_MATCH(first_match - 1)) + 2;
|
||||
if ((long)clen >= Columns)
|
||||
break;
|
||||
--first_match;
|
||||
@@ -576,7 +580,7 @@ win_redr_status_matches(
|
||||
clen = len;
|
||||
|
||||
i = first_match;
|
||||
while ((long)(clen + status_match_len(xp, L_MATCH(i)) + 2) < Columns)
|
||||
while ((long)(clen + status_match_len(xp, SHOW_MATCH(i)) + 2) < Columns)
|
||||
{
|
||||
if (i == match)
|
||||
{
|
||||
@@ -584,7 +588,7 @@ win_redr_status_matches(
|
||||
selstart_col = clen;
|
||||
}
|
||||
|
||||
s = L_MATCH(i);
|
||||
s = SHOW_MATCH(i);
|
||||
// Check for menu separators - replace with '|'
|
||||
#ifdef FEAT_MENU
|
||||
emenu = (xp->xp_context == EXPAND_MENUS
|
||||
@@ -975,6 +979,10 @@ ExpandOne(
|
||||
FreeWild(xp->xp_numfiles, xp->xp_files);
|
||||
xp->xp_numfiles = -1;
|
||||
VIM_CLEAR(orig_save);
|
||||
|
||||
// The entries from xp_files may be used in the PUM, remove it.
|
||||
if (compl_match_array != NULL)
|
||||
cmdline_pum_remove();
|
||||
}
|
||||
findex = 0;
|
||||
|
||||
@@ -1120,7 +1128,7 @@ showmatches_oneline(
|
||||
// Expansion was done here, file names are literal.
|
||||
isdir = mch_isdir(matches[j]);
|
||||
if (showtail)
|
||||
p = SHOW_FILE_TEXT(j);
|
||||
p = SHOW_MATCH(j);
|
||||
else
|
||||
{
|
||||
home_replace(NULL, matches[j], NameBuff, MAXPATHL,
|
||||
@@ -1131,7 +1139,7 @@ showmatches_oneline(
|
||||
else
|
||||
{
|
||||
isdir = FALSE;
|
||||
p = SHOW_FILE_TEXT(j);
|
||||
p = SHOW_MATCH(j);
|
||||
}
|
||||
lastlen = msg_outtrans_attr(p, isdir ? dir_attr : 0);
|
||||
}
|
||||
@@ -1210,7 +1218,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
|
||||
j = vim_strsize(NameBuff);
|
||||
}
|
||||
else
|
||||
j = vim_strsize(SHOW_FILE_TEXT(i));
|
||||
j = vim_strsize(SHOW_MATCH(i));
|
||||
if (j > maxlen)
|
||||
maxlen = j;
|
||||
}
|
||||
|
||||
+18
-3
@@ -73,7 +73,7 @@ typedef struct {
|
||||
char_u *p2, int last);
|
||||
} cryptmethod_T;
|
||||
|
||||
static int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
|
||||
static int crypt_sodium_init_(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
|
||||
static long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
|
||||
static long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
|
||||
|
||||
@@ -145,7 +145,7 @@ static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
|
||||
#endif
|
||||
FALSE,
|
||||
NULL,
|
||||
crypt_sodium_init,
|
||||
crypt_sodium_init_,
|
||||
NULL, NULL,
|
||||
crypt_sodium_buffer_encode, crypt_sodium_buffer_decode,
|
||||
NULL, NULL,
|
||||
@@ -198,6 +198,7 @@ typedef struct {
|
||||
dll_crypto_secretstream_xchacha20poly1305_pull
|
||||
# define crypto_pwhash dll_crypto_pwhash
|
||||
# define randombytes_buf dll_randombytes_buf
|
||||
# define randombytes_random dll_randombytes_random
|
||||
|
||||
static int (*dll_sodium_init)(void) = NULL;
|
||||
static void (*dll_sodium_free)(void *) = NULL;
|
||||
@@ -231,6 +232,7 @@ static int (*dll_crypto_pwhash)(unsigned char * const out,
|
||||
unsigned long long opslimit, size_t memlimit, int alg)
|
||||
= NULL;
|
||||
static void (*dll_randombytes_buf)(void * const buf, const size_t size);
|
||||
static uint32_t (*dll_randombytes_random)(void);
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
@@ -248,6 +250,7 @@ static struct {
|
||||
{"crypto_secretstream_xchacha20poly1305_pull", (SODIUM_PROC*)&dll_crypto_secretstream_xchacha20poly1305_pull},
|
||||
{"crypto_pwhash", (SODIUM_PROC*)&dll_crypto_pwhash},
|
||||
{"randombytes_buf", (SODIUM_PROC*)&dll_randombytes_buf},
|
||||
{"randombytes_random", (SODIUM_PROC*)&dll_randombytes_random},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -855,7 +858,7 @@ crypt_append_msg(
|
||||
}
|
||||
|
||||
static int
|
||||
crypt_sodium_init(
|
||||
crypt_sodium_init_(
|
||||
cryptstate_T *state UNUSED,
|
||||
char_u *key UNUSED,
|
||||
char_u *salt UNUSED,
|
||||
@@ -1143,6 +1146,18 @@ crypt_sodium_randombytes_buf(void *const buf, const size_t size)
|
||||
{
|
||||
randombytes_buf(buf, size);
|
||||
}
|
||||
|
||||
int
|
||||
crypt_sodium_init(void)
|
||||
{
|
||||
return sodium_init();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
crypt_sodium_randombytes_random(void)
|
||||
{
|
||||
return randombytes_random();
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif // FEAT_CRYPT
|
||||
|
||||
+69
-38
@@ -637,7 +637,8 @@ text_prop_position(
|
||||
int *n_extra, // nr of bytes for virtual text
|
||||
char_u **p_extra, // virtual text
|
||||
int *n_attr, // attribute cells, NULL if not used
|
||||
int *n_attr_skip) // cells to skip attr, NULL if not used
|
||||
int *n_attr_skip, // cells to skip attr, NULL if not used
|
||||
int do_skip) // skip_cells is not zero
|
||||
{
|
||||
int right = (tp->tp_flags & TP_FLAG_ALIGN_RIGHT);
|
||||
int above = (tp->tp_flags & TP_FLAG_ALIGN_ABOVE);
|
||||
@@ -690,6 +691,8 @@ text_prop_position(
|
||||
else
|
||||
n_used = *n_extra;
|
||||
}
|
||||
else if (below && before > vcol && do_skip)
|
||||
before -= vcol;
|
||||
else
|
||||
before = 0;
|
||||
}
|
||||
@@ -1500,15 +1503,75 @@ win_line(
|
||||
area_highlighting = TRUE;
|
||||
}
|
||||
|
||||
// When w_skipcol is non-zero and there is virtual text above the actual
|
||||
// text, then this much of the virtual text is skipped.
|
||||
int skipcol_in_text_prop_above = 0;
|
||||
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
if (WIN_IS_POPUP(wp))
|
||||
wlv.screen_line_flags |= SLF_POPUP;
|
||||
|
||||
char_u *prop_start;
|
||||
text_prop_count = get_text_props(wp->w_buffer, lnum, &prop_start, FALSE);
|
||||
if (text_prop_count > 0)
|
||||
{
|
||||
// Make a copy of the properties, so that they are properly
|
||||
// aligned.
|
||||
text_props = ALLOC_MULT(textprop_T, text_prop_count);
|
||||
if (text_props != NULL)
|
||||
mch_memmove(text_props, prop_start,
|
||||
text_prop_count * sizeof(textprop_T));
|
||||
|
||||
// Allocate an array for the indexes.
|
||||
text_prop_idxs = ALLOC_MULT(int, text_prop_count);
|
||||
if (text_prop_idxs == NULL)
|
||||
VIM_CLEAR(text_props);
|
||||
|
||||
if (text_props != NULL)
|
||||
{
|
||||
area_highlighting = TRUE;
|
||||
extra_check = TRUE;
|
||||
|
||||
// When skipping virtual text the props need to be sorted. The
|
||||
// order is reversed!
|
||||
if (lnum == wp->w_topline && wp->w_skipcol > 0)
|
||||
{
|
||||
for (int i = 0; i < text_prop_count; ++i)
|
||||
text_prop_idxs[i] = i;
|
||||
sort_text_props(wp->w_buffer, text_props,
|
||||
text_prop_idxs, text_prop_count);
|
||||
}
|
||||
|
||||
// Text props "above" move the line number down to where the text
|
||||
// is. Only count the ones that are visible, not those that are
|
||||
// skipped because of w_skipcol.
|
||||
int text_width = wp->w_width - win_col_off(wp);
|
||||
for (int i = text_prop_count - 1; i >= 0; --i)
|
||||
if (text_props[i].tp_flags & TP_FLAG_ALIGN_ABOVE)
|
||||
{
|
||||
if (lnum == wp->w_topline
|
||||
&& wp->w_skipcol - skipcol_in_text_prop_above
|
||||
>= text_width)
|
||||
{
|
||||
// This virtual text above is skipped, remove it from
|
||||
// the array.
|
||||
skipcol_in_text_prop_above += text_width;
|
||||
for (int j = i + 1; j < text_prop_count; ++j)
|
||||
text_props[j - 1] = text_props[j];
|
||||
++i;
|
||||
--text_prop_count;
|
||||
}
|
||||
else
|
||||
++wlv.text_prop_above_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
|
||||
// first character to be displayed.
|
||||
if (wp->w_p_wrap)
|
||||
v = startrow == 0 ? wp->w_skipcol : 0;
|
||||
v = startrow == 0 ? wp->w_skipcol - skipcol_in_text_prop_above : 0;
|
||||
else
|
||||
v = wp->w_leftcol;
|
||||
if (v > 0 && !number_only)
|
||||
@@ -1559,7 +1622,8 @@ win_line(
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
// If there the text doesn't reach to the desired column, need to skip
|
||||
// "skip_cells" cells when virtual text follows.
|
||||
if (!wp->w_p_wrap && v > wlv.vcol)
|
||||
if ((!wp->w_p_wrap || (lnum == wp->w_topline && wp->w_skipcol > 0))
|
||||
&& v > wlv.vcol)
|
||||
skip_cells = v - wlv.vcol;
|
||||
#endif
|
||||
|
||||
@@ -1703,40 +1767,6 @@ win_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_PROP_POPUP
|
||||
{
|
||||
char_u *prop_start;
|
||||
|
||||
text_prop_count = get_text_props(wp->w_buffer, lnum,
|
||||
&prop_start, FALSE);
|
||||
if (text_prop_count > 0)
|
||||
{
|
||||
// Make a copy of the properties, so that they are properly
|
||||
// aligned.
|
||||
text_props = ALLOC_MULT(textprop_T, text_prop_count);
|
||||
if (text_props != NULL)
|
||||
mch_memmove(text_props, prop_start,
|
||||
text_prop_count * sizeof(textprop_T));
|
||||
|
||||
// Allocate an array for the indexes.
|
||||
text_prop_idxs = ALLOC_MULT(int, text_prop_count);
|
||||
if (text_prop_idxs == NULL)
|
||||
VIM_CLEAR(text_props);
|
||||
|
||||
if (text_props != NULL)
|
||||
{
|
||||
area_highlighting = TRUE;
|
||||
extra_check = TRUE;
|
||||
// text props "above" move the line number down to where the
|
||||
// text is.
|
||||
for (int i = 0; i < text_prop_count; ++i)
|
||||
if (text_props[i].tp_flags & TP_FLAG_ALIGN_ABOVE)
|
||||
++wlv.text_prop_above_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
win_line_start(wp, &wlv, FALSE);
|
||||
|
||||
// Repeat for the whole displayed line.
|
||||
@@ -2059,7 +2089,8 @@ win_line(
|
||||
wlv.vcol,
|
||||
wlv.col,
|
||||
&wlv.n_extra, &wlv.p_extra,
|
||||
&n_attr, &wlv.n_attr_skip);
|
||||
&n_attr, &wlv.n_attr_skip,
|
||||
skip_cells > 0);
|
||||
if (wlv.p_extra != prev_p_extra)
|
||||
{
|
||||
// wlv.p_extra was allocated
|
||||
|
||||
+11
-4
@@ -1058,12 +1058,19 @@ doESCkey:
|
||||
|
||||
case K_COMMAND: // <Cmd>command<CR>
|
||||
case K_SCRIPT_COMMAND: // <ScriptCmd>command<CR>
|
||||
do_cmdkey_command(c, 0);
|
||||
{
|
||||
do_cmdkey_command(c, 0);
|
||||
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_use_loop())
|
||||
// Started a terminal that gets the input, exit Insert mode.
|
||||
goto doESCkey;
|
||||
if (term_use_loop())
|
||||
// Started a terminal that gets the input, exit Insert mode.
|
||||
goto doESCkey;
|
||||
#endif
|
||||
if (curbuf->b_u_synced)
|
||||
// The command caused undo to be synced. Need to save the
|
||||
// line for undo before inserting the next char.
|
||||
ins_need_undo = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case K_CURSORHOLD: // Didn't type something for a while.
|
||||
|
||||
@@ -3351,4 +3351,30 @@ EXTERN char e_not_allowed_to_add_or_remove_entries_str[]
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_class_name_must_start_with_uppercase_letter_str[]
|
||||
INIT(= N_("E1314: Class name must start with an uppercase letter: %s"));
|
||||
EXTERN char e_white_space_required_after_class_name_str[]
|
||||
INIT(= N_("E1315: White space required after class name: %s"));
|
||||
EXTERN char e_class_can_only_be_defined_in_vim9_script[]
|
||||
INIT(= N_("E1316: Class can only be defined in Vim9 script"));
|
||||
EXTERN char e_invalid_object_member_declaration_str[]
|
||||
INIT(= N_("E1317: Invalid object member declaration: %s"));
|
||||
EXTERN char e_not_valid_command_in_class_str[]
|
||||
INIT(= N_("E1318: Not a valid command in a class: %s"));
|
||||
EXTERN char e_using_class_as_number[]
|
||||
INIT(= N_("E1319: Using a class as a Number"));
|
||||
EXTERN char e_using_object_as_number[]
|
||||
INIT(= N_("E1320: Using an object as a Number"));
|
||||
EXTERN char e_using_class_as_float[]
|
||||
INIT(= N_("E1321: Using a class as a Float"));
|
||||
EXTERN char e_using_object_as_float[]
|
||||
INIT(= N_("E1322: Using an object as a Float"));
|
||||
EXTERN char e_using_class_as_string[]
|
||||
INIT(= N_("E1323: Using a class as a String"));
|
||||
EXTERN char e_using_object_as_string[]
|
||||
INIT(= N_("E1324: Using an object as a String"));
|
||||
EXTERN char e_method_not_found_on_class_str_str[]
|
||||
INIT(= N_("E1325: Method not found on class \"%s\": %s"));
|
||||
EXTERN char e_member_not_found_on_object_str_str[]
|
||||
INIT(= N_("E1326: Member not found on object \"%s\": %s"));
|
||||
EXTERN char e_object_required_found_str[]
|
||||
INIT(= N_("E1327: Object required, found %s"));
|
||||
#endif
|
||||
|
||||
+248
-147
@@ -295,7 +295,7 @@ eval_expr_typval(
|
||||
|
||||
// Shortcut to call a compiled function with minimal overhead.
|
||||
r = call_def_function(partial->pt_func, argc, argv,
|
||||
DEF_USE_PT_ARGV, partial, fc, rettv);
|
||||
DEF_USE_PT_ARGV, partial, NULL, fc, rettv);
|
||||
if (fc_arg == NULL)
|
||||
remove_funccal();
|
||||
if (r == FAIL)
|
||||
@@ -1548,7 +1548,7 @@ set_var_lval(
|
||||
{
|
||||
cc = *endp;
|
||||
*endp = NUL;
|
||||
if (in_vim9script() && check_reserved_name(lp->ll_name) == FAIL)
|
||||
if (in_vim9script() && check_reserved_name(lp->ll_name, NULL) == FAIL)
|
||||
return;
|
||||
|
||||
if (lp->ll_blob != NULL)
|
||||
@@ -1724,6 +1724,8 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
break;
|
||||
|
||||
case VAR_BLOB:
|
||||
@@ -3850,12 +3852,25 @@ handle_predefined(char_u *s, int len, typval_T *rettv)
|
||||
return OK;
|
||||
}
|
||||
break;
|
||||
case 10: if (STRNCMP(s, "null_class", 10) == 0)
|
||||
{
|
||||
rettv->v_type = VAR_CLASS;
|
||||
rettv->vval.v_class = NULL;
|
||||
return OK;
|
||||
}
|
||||
break;
|
||||
case 11: if (STRNCMP(s, "null_string", 11) == 0)
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
return OK;
|
||||
}
|
||||
if (STRNCMP(s, "null_object", 11) == 0)
|
||||
{
|
||||
rettv->v_type = VAR_OBJECT;
|
||||
rettv->vval.v_object = NULL;
|
||||
return OK;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (STRNCMP(s, "null_channel", 12) == 0)
|
||||
@@ -4685,6 +4700,8 @@ check_can_index(typval_T *rettv, int evaluate, int verbose)
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
if (verbose)
|
||||
emsg(_(e_cannot_index_special_variable));
|
||||
return FAIL;
|
||||
@@ -4788,6 +4805,8 @@ eval_index_inner(
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
break; // not evaluating, skipping over subscript
|
||||
|
||||
case VAR_NUMBER:
|
||||
@@ -5214,12 +5233,15 @@ free_unref_items(int copyID)
|
||||
* themselves yet, so that it is possible to decrement refcount counters
|
||||
*/
|
||||
|
||||
// Go through the list of dicts and free items without the copyID.
|
||||
// Go through the list of dicts and free items without this copyID.
|
||||
did_free |= dict_free_nonref(copyID);
|
||||
|
||||
// Go through the list of lists and free items without the copyID.
|
||||
// Go through the list of lists and free items without this copyID.
|
||||
did_free |= list_free_nonref(copyID);
|
||||
|
||||
// Go through the list of objects and free items without this copyID.
|
||||
did_free |= object_free_nonref(copyID);
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
// Go through the list of jobs and free items without the copyID. This
|
||||
// must happen before doing channels, because jobs refer to channels, but
|
||||
@@ -5386,7 +5408,8 @@ set_ref_in_callback(callback_T *cb, int copyID)
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark all lists and dicts referenced through typval "tv" with "copyID".
|
||||
* Mark all lists, dicts and other container types referenced through typval
|
||||
* "tv" with "copyID".
|
||||
* "list_stack" is used to add lists to be marked. Can be NULL.
|
||||
* "ht_stack" is used to add hashtabs to be marked. Can be NULL.
|
||||
*
|
||||
@@ -5401,162 +5424,214 @@ set_ref_in_item(
|
||||
{
|
||||
int abort = FALSE;
|
||||
|
||||
if (tv->v_type == VAR_DICT)
|
||||
switch (tv->v_type)
|
||||
{
|
||||
dict_T *dd = tv->vval.v_dict;
|
||||
|
||||
if (dd != NULL && dd->dv_copyID != copyID)
|
||||
case VAR_DICT:
|
||||
{
|
||||
// Didn't see this dict yet.
|
||||
dd->dv_copyID = copyID;
|
||||
if (ht_stack == NULL)
|
||||
{
|
||||
abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
ht_stack_T *newitem = ALLOC_ONE(ht_stack_T);
|
||||
dict_T *dd = tv->vval.v_dict;
|
||||
|
||||
if (newitem == NULL)
|
||||
abort = TRUE;
|
||||
if (dd != NULL && dd->dv_copyID != copyID)
|
||||
{
|
||||
// Didn't see this dict yet.
|
||||
dd->dv_copyID = copyID;
|
||||
if (ht_stack == NULL)
|
||||
{
|
||||
abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
newitem->ht = &dd->dv_hashtab;
|
||||
newitem->prev = *ht_stack;
|
||||
*ht_stack = newitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tv->v_type == VAR_LIST)
|
||||
{
|
||||
list_T *ll = tv->vval.v_list;
|
||||
ht_stack_T *newitem = ALLOC_ONE(ht_stack_T);
|
||||
|
||||
if (ll != NULL && ll->lv_copyID != copyID)
|
||||
{
|
||||
// Didn't see this list yet.
|
||||
ll->lv_copyID = copyID;
|
||||
if (list_stack == NULL)
|
||||
{
|
||||
abort = set_ref_in_list_items(ll, copyID, ht_stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_stack_T *newitem = ALLOC_ONE(list_stack_T);
|
||||
|
||||
if (newitem == NULL)
|
||||
abort = TRUE;
|
||||
else
|
||||
{
|
||||
newitem->list = ll;
|
||||
newitem->prev = *list_stack;
|
||||
*list_stack = newitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tv->v_type == VAR_FUNC)
|
||||
{
|
||||
abort = set_ref_in_func(tv->vval.v_string, NULL, copyID);
|
||||
}
|
||||
else if (tv->v_type == VAR_PARTIAL)
|
||||
{
|
||||
partial_T *pt = tv->vval.v_partial;
|
||||
int i;
|
||||
|
||||
if (pt != NULL && pt->pt_copyID != copyID)
|
||||
{
|
||||
// Didn't see this partial yet.
|
||||
pt->pt_copyID = copyID;
|
||||
|
||||
abort = set_ref_in_func(pt->pt_name, pt->pt_func, copyID);
|
||||
|
||||
if (pt->pt_dict != NULL)
|
||||
{
|
||||
typval_T dtv;
|
||||
|
||||
dtv.v_type = VAR_DICT;
|
||||
dtv.vval.v_dict = pt->pt_dict;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
|
||||
for (i = 0; i < pt->pt_argc; ++i)
|
||||
abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID,
|
||||
ht_stack, list_stack);
|
||||
// pt_funcstack is handled in set_ref_in_funcstacks()
|
||||
// pt_loopvars is handled in set_ref_in_loopvars()
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
else if (tv->v_type == VAR_JOB)
|
||||
{
|
||||
job_T *job = tv->vval.v_job;
|
||||
typval_T dtv;
|
||||
|
||||
if (job != NULL && job->jv_copyID != copyID)
|
||||
{
|
||||
job->jv_copyID = copyID;
|
||||
if (job->jv_channel != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_CHANNEL;
|
||||
dtv.vval.v_channel = job->jv_channel;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (job->jv_exit_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = job->jv_exit_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tv->v_type == VAR_CHANNEL)
|
||||
{
|
||||
channel_T *ch =tv->vval.v_channel;
|
||||
ch_part_T part;
|
||||
typval_T dtv;
|
||||
jsonq_T *jq;
|
||||
cbq_T *cq;
|
||||
|
||||
if (ch != NULL && ch->ch_copyID != copyID)
|
||||
{
|
||||
ch->ch_copyID = copyID;
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
{
|
||||
for (jq = ch->ch_part[part].ch_json_head.jq_next; jq != NULL;
|
||||
jq = jq->jq_next)
|
||||
set_ref_in_item(jq->jq_value, copyID, ht_stack, list_stack);
|
||||
for (cq = ch->ch_part[part].ch_cb_head.cq_next; cq != NULL;
|
||||
cq = cq->cq_next)
|
||||
if (cq->cq_callback.cb_partial != NULL)
|
||||
if (newitem == NULL)
|
||||
abort = TRUE;
|
||||
else
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = cq->cq_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
newitem->ht = &dd->dv_hashtab;
|
||||
newitem->prev = *ht_stack;
|
||||
*ht_stack = newitem;
|
||||
}
|
||||
if (ch->ch_part[part].ch_callback.cb_partial != NULL)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_LIST:
|
||||
{
|
||||
list_T *ll = tv->vval.v_list;
|
||||
|
||||
if (ll != NULL && ll->lv_copyID != copyID)
|
||||
{
|
||||
// Didn't see this list yet.
|
||||
ll->lv_copyID = copyID;
|
||||
if (list_stack == NULL)
|
||||
{
|
||||
abort = set_ref_in_list_items(ll, copyID, ht_stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_stack_T *newitem = ALLOC_ONE(list_stack_T);
|
||||
|
||||
if (newitem == NULL)
|
||||
abort = TRUE;
|
||||
else
|
||||
{
|
||||
newitem->list = ll;
|
||||
newitem->prev = *list_stack;
|
||||
*list_stack = newitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_FUNC:
|
||||
{
|
||||
abort = set_ref_in_func(tv->vval.v_string, NULL, copyID);
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_PARTIAL:
|
||||
{
|
||||
partial_T *pt = tv->vval.v_partial;
|
||||
int i;
|
||||
|
||||
if (pt != NULL && pt->pt_copyID != copyID)
|
||||
{
|
||||
// Didn't see this partial yet.
|
||||
pt->pt_copyID = copyID;
|
||||
|
||||
abort = set_ref_in_func(pt->pt_name, pt->pt_func, copyID);
|
||||
|
||||
if (pt->pt_dict != NULL)
|
||||
{
|
||||
typval_T dtv;
|
||||
|
||||
dtv.v_type = VAR_DICT;
|
||||
dtv.vval.v_dict = pt->pt_dict;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
|
||||
for (i = 0; i < pt->pt_argc; ++i)
|
||||
abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID,
|
||||
ht_stack, list_stack);
|
||||
// pt_funcstack is handled in set_ref_in_funcstacks()
|
||||
// pt_loopvars is handled in set_ref_in_loopvars()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_JOB:
|
||||
{
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
job_T *job = tv->vval.v_job;
|
||||
typval_T dtv;
|
||||
|
||||
if (job != NULL && job->jv_copyID != copyID)
|
||||
{
|
||||
job->jv_copyID = copyID;
|
||||
if (job->jv_channel != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_CHANNEL;
|
||||
dtv.vval.v_channel = job->jv_channel;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (job->jv_exit_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial =
|
||||
ch->ch_part[part].ch_callback.cb_partial;
|
||||
dtv.vval.v_partial = job->jv_exit_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
if (ch->ch_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (ch->ch_close_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_close_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_CHANNEL:
|
||||
{
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
channel_T *ch = tv->vval.v_channel;
|
||||
ch_part_T part;
|
||||
typval_T dtv;
|
||||
jsonq_T *jq;
|
||||
cbq_T *cq;
|
||||
|
||||
if (ch != NULL && ch->ch_copyID != copyID)
|
||||
{
|
||||
ch->ch_copyID = copyID;
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
{
|
||||
for (jq = ch->ch_part[part].ch_json_head.jq_next;
|
||||
jq != NULL; jq = jq->jq_next)
|
||||
set_ref_in_item(jq->jq_value, copyID,
|
||||
ht_stack, list_stack);
|
||||
for (cq = ch->ch_part[part].ch_cb_head.cq_next; cq != NULL;
|
||||
cq = cq->cq_next)
|
||||
if (cq->cq_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = cq->cq_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (ch->ch_part[part].ch_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial =
|
||||
ch->ch_part[part].ch_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
if (ch->ch_callback.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_callback.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
if (ch->ch_close_cb.cb_partial != NULL)
|
||||
{
|
||||
dtv.v_type = VAR_PARTIAL;
|
||||
dtv.vval.v_partial = ch->ch_close_cb.cb_partial;
|
||||
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_CLASS:
|
||||
// TODO: mark methods in class_obj_methods ?
|
||||
break;
|
||||
|
||||
case VAR_OBJECT:
|
||||
{
|
||||
object_T *obj = tv->vval.v_object;
|
||||
if (obj != NULL && obj->obj_copyID != copyID)
|
||||
{
|
||||
obj->obj_copyID = copyID;
|
||||
|
||||
// The typval_T array is right after the object_T.
|
||||
typval_T *mtv = (typval_T *)(obj + 1);
|
||||
for (int i = 0; !abort
|
||||
&& i < obj->obj_class->class_obj_member_count; ++i)
|
||||
abort = abort || set_ref_in_item(mtv + i, copyID,
|
||||
ht_stack, list_stack);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VAR_UNKNOWN:
|
||||
case VAR_ANY:
|
||||
case VAR_VOID:
|
||||
case VAR_BOOL:
|
||||
case VAR_SPECIAL:
|
||||
case VAR_NUMBER:
|
||||
case VAR_FLOAT:
|
||||
case VAR_STRING:
|
||||
case VAR_BLOB:
|
||||
case VAR_INSTR:
|
||||
// Types that do not contain any other item
|
||||
break;
|
||||
}
|
||||
|
||||
return abort;
|
||||
}
|
||||
|
||||
@@ -5781,6 +5856,16 @@ echo_string_core(
|
||||
r = (char_u *)"instructions";
|
||||
break;
|
||||
|
||||
case VAR_CLASS:
|
||||
*tofree = NULL;
|
||||
r = (char_u *)"class";
|
||||
break;
|
||||
|
||||
case VAR_OBJECT:
|
||||
*tofree = NULL;
|
||||
r = (char_u *)"object";
|
||||
break;
|
||||
|
||||
case VAR_FLOAT:
|
||||
*tofree = NULL;
|
||||
vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv->vval.v_float);
|
||||
@@ -6588,6 +6673,20 @@ handle_subscript(
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
else if (**arg == '.' && (rettv->v_type == VAR_CLASS
|
||||
|| rettv->v_type == VAR_OBJECT))
|
||||
{
|
||||
// class member: SomeClass.varname
|
||||
// class method: SomeClass.SomeMethod()
|
||||
// class constructor: SomeClass.new()
|
||||
// object member: someObject.varname
|
||||
// object method: someObject.SomeMethod()
|
||||
if (class_object_index(arg, rettv, evalarg, verbose) == FAIL)
|
||||
{
|
||||
clear_tv(rettv);
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -6644,6 +6743,8 @@ item_copy(
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
copy_tv(from, to);
|
||||
break;
|
||||
case VAR_LIST:
|
||||
|
||||
+52
-3
@@ -167,6 +167,7 @@ static void f_split(typval_T *argvars, typval_T *rettv);
|
||||
static void f_srand(typval_T *argvars, typval_T *rettv);
|
||||
static void f_submatch(typval_T *argvars, typval_T *rettv);
|
||||
static void f_substitute(typval_T *argvars, typval_T *rettv);
|
||||
static void f_swapfilelist(typval_T *argvars, typval_T *rettv);
|
||||
static void f_swapinfo(typval_T *argvars, typval_T *rettv);
|
||||
static void f_swapname(typval_T *argvars, typval_T *rettv);
|
||||
static void f_synID(typval_T *argvars, typval_T *rettv);
|
||||
@@ -2582,6 +2583,8 @@ static funcentry_T global_functions[] =
|
||||
ret_string, f_submatch},
|
||||
{"substitute", 4, 4, FEARG_1, arg4_string_string_any_string,
|
||||
ret_string, f_substitute},
|
||||
{"swapfilelist", 0, 0, 0, NULL,
|
||||
ret_list_string, f_swapfilelist},
|
||||
{"swapinfo", 1, 1, FEARG_1, arg1_string,
|
||||
ret_dict_any, f_swapinfo},
|
||||
{"swapname", 1, 1, FEARG_1, arg1_buffer,
|
||||
@@ -3770,6 +3773,12 @@ f_empty(typval_T *argvars, typval_T *rettv)
|
||||
case VAR_SPECIAL:
|
||||
n = argvars[0].vval.v_number != VVAL_TRUE;
|
||||
break;
|
||||
case VAR_CLASS:
|
||||
n = argvars[0].vval.v_class != NULL;
|
||||
break;
|
||||
case VAR_OBJECT:
|
||||
n = argvars[0].vval.v_object != NULL;
|
||||
break;
|
||||
|
||||
case VAR_BLOB:
|
||||
n = argvars[0].vval.v_blob == NULL
|
||||
@@ -7302,6 +7311,8 @@ f_len(typval_T *argvars, typval_T *rettv)
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
emsg(_(e_invalid_type_for_len));
|
||||
break;
|
||||
}
|
||||
@@ -8194,9 +8205,32 @@ init_srand(UINT32_T *x)
|
||||
}
|
||||
}
|
||||
if (dev_urandom_state != OK)
|
||||
// Reading /dev/urandom doesn't work, fall back to time().
|
||||
#endif
|
||||
*x = vim_time();
|
||||
{
|
||||
// Reading /dev/urandom doesn't work, fall back to:
|
||||
// - randombytes_random()
|
||||
// - reltime() or time()
|
||||
// - XOR with process ID
|
||||
#if defined(FEAT_SODIUM)
|
||||
if (crypt_sodium_init() >= 0)
|
||||
*x = crypt_sodium_randombytes_random();
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if defined(FEAT_RELTIME)
|
||||
proftime_T res;
|
||||
profile_start(&res);
|
||||
# if defined(MSWIN)
|
||||
*x = (UINT32_T)res.LowPart;
|
||||
# else
|
||||
*x = (UINT32_T)res.tv_usec;
|
||||
# endif
|
||||
#else
|
||||
*x = vim_time();
|
||||
#endif
|
||||
*x ^= mch_get_pid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define ROTL(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
|
||||
@@ -10195,7 +10229,9 @@ f_substitute(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (argvars[2].v_type == VAR_FUNC
|
||||
|| argvars[2].v_type == VAR_PARTIAL
|
||||
|| argvars[2].v_type == VAR_INSTR)
|
||||
|| argvars[2].v_type == VAR_INSTR
|
||||
|| argvars[2].v_type == VAR_CLASS
|
||||
|| argvars[2].v_type == VAR_OBJECT)
|
||||
expr = &argvars[2];
|
||||
else
|
||||
sub = tv_get_string_buf_chk(&argvars[2], subbuf);
|
||||
@@ -10208,6 +10244,17 @@ f_substitute(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_string = do_string_sub(str, pat, sub, expr, flg);
|
||||
}
|
||||
|
||||
/*
|
||||
* "swapfilelist()" function
|
||||
*/
|
||||
static void
|
||||
f_swapfilelist(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
recover_names(NULL, FALSE, rettv->vval.v_list, 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* "swapinfo(swap_filename)" function
|
||||
*/
|
||||
@@ -10618,6 +10665,8 @@ f_type(typval_T *argvars, typval_T *rettv)
|
||||
case VAR_CHANNEL: n = VAR_TYPE_CHANNEL; break;
|
||||
case VAR_BLOB: n = VAR_TYPE_BLOB; break;
|
||||
case VAR_INSTR: n = VAR_TYPE_INSTR; break;
|
||||
case VAR_CLASS: n = VAR_TYPE_CLASS; break;
|
||||
case VAR_OBJECT: n = VAR_TYPE_OBJECT; break;
|
||||
case VAR_UNKNOWN:
|
||||
case VAR_ANY:
|
||||
case VAR_VOID:
|
||||
|
||||
@@ -2266,6 +2266,8 @@ item_lock(typval_T *tv, int deep, int lock, int check_refcount)
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
break;
|
||||
|
||||
case VAR_BLOB:
|
||||
|
||||
+16
-12
@@ -798,12 +798,13 @@ cmdline_init(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the backslash key pressed in the command-line mode. CTRL-\ CTRL-N
|
||||
* goes to Normal mode, CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is
|
||||
* set, CTRL-\ e prompts for an expression.
|
||||
* Handle CTRL-\ pressed in Command-line mode:
|
||||
* - CTRL-\ CTRL-N goes to Normal mode
|
||||
* - CTRL-\ CTRL-G goes to Insert mode when 'insertmode' is set
|
||||
* - CTRL-\ e prompts for an expression.
|
||||
*/
|
||||
static int
|
||||
cmdline_handle_backslash_key(int c, int *gotesc)
|
||||
cmdline_handle_ctrl_bsl(int c, int *gotesc)
|
||||
{
|
||||
++no_mapping;
|
||||
++allow_keys;
|
||||
@@ -832,8 +833,7 @@ cmdline_handle_backslash_key(int c, int *gotesc)
|
||||
|
||||
/*
|
||||
* Replace the command line with the result of an expression.
|
||||
* Need to save and restore the current command line, to be
|
||||
* able to enter a new one...
|
||||
* This will call getcmdline() recursively in get_expr_register().
|
||||
*/
|
||||
if (ccline.cmdpos == ccline.cmdlen)
|
||||
new_cmdpos = 99999; // keep it at the end
|
||||
@@ -843,9 +843,8 @@ cmdline_handle_backslash_key(int c, int *gotesc)
|
||||
c = get_expr_register();
|
||||
if (c == '=')
|
||||
{
|
||||
// Need to save and restore ccline. And set "textlock"
|
||||
// to avoid nasty things like going to another buffer when
|
||||
// evaluating an expression.
|
||||
// Evaluate the expression. Set "textlock" to avoid nasty things
|
||||
// like going to another buffer.
|
||||
++textlock;
|
||||
p = get_expr_line();
|
||||
--textlock;
|
||||
@@ -1787,10 +1786,15 @@ getcmdline_int(
|
||||
if (c == K_COMMAND || c == K_SCRIPT_COMMAND)
|
||||
{
|
||||
int clen = ccline.cmdlen;
|
||||
int cc_count = aucmd_cmdline_changed_count;
|
||||
|
||||
if (do_cmdkey_command(c, DOCMD_NOWAIT) == OK)
|
||||
{
|
||||
if (clen == ccline.cmdlen)
|
||||
// Do not trigger CmdlineChanged below if:
|
||||
// - the length of the command line didn't change
|
||||
// - the <Cmd> mapping already triggered the event
|
||||
if (clen == ccline.cmdlen
|
||||
|| cc_count != aucmd_cmdline_changed_count)
|
||||
trigger_cmdlinechanged = FALSE;
|
||||
goto cmdline_changed;
|
||||
}
|
||||
@@ -1909,7 +1913,7 @@ getcmdline_int(
|
||||
// mode when 'insertmode' is set, CTRL-\ e prompts for an expression.
|
||||
if (c == Ctrl_BSL)
|
||||
{
|
||||
res = cmdline_handle_backslash_key(c, &gotesc);
|
||||
res = cmdline_handle_ctrl_bsl(c, &gotesc);
|
||||
if (res == CMDLINE_CHANGED)
|
||||
goto cmdline_changed;
|
||||
else if (res == CMDLINE_NOT_CHANGED)
|
||||
@@ -1917,7 +1921,7 @@ getcmdline_int(
|
||||
else if (res == GOTO_NORMAL_MODE)
|
||||
goto returncmd; // back to cmd mode
|
||||
c = Ctrl_BSL; // backslash key not processed by
|
||||
// cmdline_handle_backslash_key()
|
||||
// cmdline_handle_ctrl_bsl()
|
||||
}
|
||||
|
||||
if (c == cedit_key || c == K_CMDWIN)
|
||||
|
||||
@@ -1584,10 +1584,13 @@ EXTERN char_u last_mode[MODE_MAX_LENGTH] INIT(= "n"); // for ModeChanged event
|
||||
EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":)
|
||||
EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "."
|
||||
EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline
|
||||
//
|
||||
EXTERN char_u *autocmd_fname INIT(= NULL); // fname for <afile> on cmdline
|
||||
EXTERN int autocmd_fname_full; // autocmd_fname is full path
|
||||
EXTERN int autocmd_bufnr INIT(= 0); // fnum for <abuf> on cmdline
|
||||
EXTERN char_u *autocmd_match INIT(= NULL); // name for <amatch> on cmdline
|
||||
EXTERN int aucmd_cmdline_changed_count INIT(= 0);
|
||||
|
||||
EXTERN int did_cursorhold INIT(= FALSE); // set when CursorHold t'gerd
|
||||
EXTERN pos_T last_cursormoved // for CursorMoved event
|
||||
# ifdef DO_INIT
|
||||
|
||||
@@ -4081,10 +4081,12 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
|
||||
#endif
|
||||
savewin = curwin;
|
||||
curwin = self->win;
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
VimTryStart();
|
||||
win_setheight((int) height);
|
||||
curwin = savewin;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (VimTryEnd())
|
||||
return -1;
|
||||
|
||||
@@ -4103,10 +4105,12 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
|
||||
#endif
|
||||
savewin = curwin;
|
||||
curwin = self->win;
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
VimTryStart();
|
||||
win_setwidth((int) width);
|
||||
curwin = savewin;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (VimTryEnd())
|
||||
return -1;
|
||||
|
||||
@@ -6422,6 +6426,8 @@ ConvertToPyObject(typval_T *tv)
|
||||
case VAR_CHANNEL:
|
||||
case VAR_JOB:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
case VAR_BOOL:
|
||||
|
||||
@@ -308,6 +308,8 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
|
||||
case VAR_JOB:
|
||||
case VAR_CHANNEL:
|
||||
case VAR_INSTR:
|
||||
case VAR_CLASS:
|
||||
case VAR_OBJECT:
|
||||
semsg(_(e_cannot_json_encode_str), vartype_name(val->v_type));
|
||||
return FAIL;
|
||||
|
||||
|
||||
+1
-1
@@ -530,7 +530,7 @@ vim_main2(void)
|
||||
*/
|
||||
if (recoverymode && params.fname == NULL)
|
||||
{
|
||||
recover_names(NULL, TRUE, 0, NULL);
|
||||
recover_names(NULL, TRUE, NULL, 0, NULL);
|
||||
mch_exit(0);
|
||||
}
|
||||
|
||||
|
||||
+30
-13
@@ -1208,7 +1208,7 @@ ml_recover(int checkext)
|
||||
directly = FALSE;
|
||||
|
||||
// count the number of matching swap files
|
||||
len = recover_names(fname, FALSE, 0, NULL);
|
||||
len = recover_names(fname, FALSE, NULL, 0, NULL);
|
||||
if (len == 0) // no swap files found
|
||||
{
|
||||
semsg(_(e_no_swap_file_found_for_str), fname);
|
||||
@@ -1219,7 +1219,7 @@ ml_recover(int checkext)
|
||||
else // several swap files found, choose
|
||||
{
|
||||
// list the names of the swap files
|
||||
(void)recover_names(fname, TRUE, 0, NULL);
|
||||
(void)recover_names(fname, TRUE, NULL, 0, NULL);
|
||||
msg_putchar('\n');
|
||||
msg_puts(_("Enter number of swap file to use (0 to quit): "));
|
||||
i = get_number(FALSE, NULL);
|
||||
@@ -1227,7 +1227,7 @@ ml_recover(int checkext)
|
||||
goto theend;
|
||||
}
|
||||
// get the swap file name that will be used
|
||||
(void)recover_names(fname, FALSE, i, &fname_used);
|
||||
(void)recover_names(fname, FALSE, NULL, i, &fname_used);
|
||||
}
|
||||
if (fname_used == NULL)
|
||||
goto theend; // out of memory
|
||||
@@ -1801,12 +1801,14 @@ theend:
|
||||
* - list the swap files for "vim -r"
|
||||
* - count the number of swap files when recovering
|
||||
* - list the swap files when recovering
|
||||
* - list the swap files for swapfilelist()
|
||||
* - find the name of the n'th swap file when recovering
|
||||
*/
|
||||
int
|
||||
recover_names(
|
||||
char_u *fname, // base for swap file name
|
||||
int list, // when TRUE, list the swap file names
|
||||
int do_list, // when TRUE, list the swap file names
|
||||
list_T *ret_list UNUSED, // when not NULL add file names to it
|
||||
int nr, // when non-zero, return nr'th swap file name
|
||||
char_u **fname_out) // result when "nr" > 0
|
||||
{
|
||||
@@ -1817,7 +1819,6 @@ recover_names(
|
||||
int num_files;
|
||||
int file_count = 0;
|
||||
char_u **files;
|
||||
int i;
|
||||
char_u *dirp;
|
||||
char_u *dir_name;
|
||||
char_u *fname_res = NULL;
|
||||
@@ -1837,7 +1838,7 @@ recover_names(
|
||||
fname_res = fname;
|
||||
}
|
||||
|
||||
if (list)
|
||||
if (do_list)
|
||||
{
|
||||
// use msg() to start the scrolling properly
|
||||
msg(_("Swap files found:"));
|
||||
@@ -1938,7 +1939,7 @@ recover_names(
|
||||
}
|
||||
|
||||
// check for out-of-memory
|
||||
for (i = 0; i < num_names; ++i)
|
||||
for (int i = 0; i < num_names; ++i)
|
||||
{
|
||||
if (names[i] == NULL)
|
||||
{
|
||||
@@ -1987,12 +1988,14 @@ recover_names(
|
||||
}
|
||||
|
||||
/*
|
||||
* remove swapfile name of the current buffer, it must be ignored
|
||||
* Remove swapfile name of the current buffer, it must be ignored.
|
||||
* But keep it for swapfilelist().
|
||||
*/
|
||||
if (curbuf->b_ml.ml_mfp != NULL
|
||||
&& (p = curbuf->b_ml.ml_mfp->mf_fname) != NULL)
|
||||
&& (p = curbuf->b_ml.ml_mfp->mf_fname) != NULL
|
||||
&& ret_list == NULL)
|
||||
{
|
||||
for (i = 0; i < num_files; ++i)
|
||||
for (int i = 0; i < num_files; ++i)
|
||||
// Do not expand wildcards, on windows would try to expand
|
||||
// "%tmp%" in "%tmp%file".
|
||||
if (fullpathcmp(p, files[i], TRUE, FALSE) & FPC_SAME)
|
||||
@@ -2018,7 +2021,7 @@ recover_names(
|
||||
dirp = (char_u *)""; // stop searching
|
||||
}
|
||||
}
|
||||
else if (list)
|
||||
else if (do_list)
|
||||
{
|
||||
if (dir_name[0] == '.' && dir_name[1] == NUL)
|
||||
{
|
||||
@@ -2036,7 +2039,7 @@ recover_names(
|
||||
|
||||
if (num_files)
|
||||
{
|
||||
for (i = 0; i < num_files; ++i)
|
||||
for (int i = 0; i < num_files; ++i)
|
||||
{
|
||||
// print the swap file name
|
||||
msg_outnum((long)++file_count);
|
||||
@@ -2050,10 +2053,24 @@ recover_names(
|
||||
msg_puts(_(" -- none --\n"));
|
||||
out_flush();
|
||||
}
|
||||
#ifdef FEAT_EVAL
|
||||
else if (ret_list != NULL)
|
||||
{
|
||||
for (int i = 0; i < num_files; ++i)
|
||||
{
|
||||
char_u *name = concat_fnames(dir_name, files[i], TRUE);
|
||||
if (name != NULL)
|
||||
{
|
||||
list_append_string(ret_list, name, -1);
|
||||
vim_free(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else
|
||||
file_count += num_files;
|
||||
|
||||
for (i = 0; i < num_names; ++i)
|
||||
for (int i = 0; i < num_names; ++i)
|
||||
vim_free(names[i]);
|
||||
if (num_files > 0)
|
||||
FreeWild(num_files, files);
|
||||
|
||||
+11
@@ -1426,6 +1426,12 @@ textpos2screenpos(
|
||||
is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
||||
#endif
|
||||
row = plines_m_win(wp, wp->w_topline, lnum - 1) + 1;
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
// Add filler lines above this buffer line.
|
||||
row += diff_check_fill(wp, lnum);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
if (is_folded)
|
||||
{
|
||||
@@ -1500,6 +1506,11 @@ f_screenpos(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
return;
|
||||
|
||||
pos.lnum = tv_get_number(&argvars[1]);
|
||||
if (pos.lnum > wp->w_buffer->b_ml.ml_line_count)
|
||||
{
|
||||
semsg(_(e_invalid_line_number_nr), pos.lnum);
|
||||
return;
|
||||
}
|
||||
pos.col = tv_get_number(&argvars[2]) - 1;
|
||||
pos.coladd = 0;
|
||||
textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol);
|
||||
|
||||
+918
-54
File diff suppressed because it is too large
Load Diff
@@ -26,4 +26,6 @@ char_u *crypt_get_key(int store, int twice);
|
||||
void crypt_append_msg(buf_T *buf);
|
||||
int crypt_sodium_munlock(void *const addr, const size_t len);
|
||||
void crypt_sodium_randombytes_buf(void *const buf, const size_t size);
|
||||
int crypt_sodium_init(void);
|
||||
uint32_t crypt_sodium_randombytes_random(void);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* drawline.c */
|
||||
int text_prop_position(win_T *wp, textprop_T *tp, int vcol, int scr_col, int *n_extra, char_u **p_extra, int *n_attr, int *n_attr_skip);
|
||||
int text_prop_position(win_T *wp, textprop_T *tp, int vcol, int scr_col, int *n_extra, char_u **p_extra, int *n_attr, int *n_attr_skip, int do_skip);
|
||||
int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int nochange, int number_only);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -10,7 +10,7 @@ void ml_close_all(int del_file);
|
||||
void ml_close_notmod(void);
|
||||
void ml_timestamp(buf_T *buf);
|
||||
void ml_recover(int checkext);
|
||||
int recover_names(char_u *fname, int list, int nr, char_u **fname_out);
|
||||
int recover_names(char_u *fname, int do_list, list_T *ret_list, int nr, char_u **fname_out);
|
||||
char_u *make_percent_swname(char_u *dir, char_u *name);
|
||||
void get_b0_dict(char_u *fname, dict_T *d);
|
||||
void ml_sync_all(int check_file, int check_char);
|
||||
|
||||
@@ -7,6 +7,7 @@ char_u *register_cfunc(cfunc_T cb, cfunc_free_T cb_free, void *state);
|
||||
int get_lambda_tv(char_u **arg, typval_T *rettv, int types_optional, evalarg_T *evalarg);
|
||||
char_u *deref_func_name(char_u *name, int *lenp, partial_T **partialp, type_T **type, int no_autoload, int new_function, int *found_var);
|
||||
void emsg_funcname(char *ermsg, char_u *name);
|
||||
int get_func_arguments(char_u **arg, evalarg_T *evalarg, int partial_argc, typval_T *argvars, int *argcount);
|
||||
int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, evalarg_T *evalarg, funcexe_T *funcexe);
|
||||
char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error);
|
||||
void func_name_with_sid(char_u *name, int sid, char_u *buffer);
|
||||
@@ -45,7 +46,7 @@ char_u *get_scriptlocal_funcname(char_u *funcname);
|
||||
char_u *alloc_printable_func_name(char_u *fname);
|
||||
char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, funcdict_T *fudi);
|
||||
void list_functions(regmatch_T *regmatch);
|
||||
ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free);
|
||||
ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free, int in_class);
|
||||
void ex_function(exarg_T *eap);
|
||||
ufunc_T *find_func_by_name(char_u *name, compiletype_T *compile_type);
|
||||
void ex_defcompile(exarg_T *eap);
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
/* vim9class.c */
|
||||
void ex_class(exarg_T *eap);
|
||||
type_T *class_member_type(class_T *cl, char_u *name, char_u *name_end, int *member_idx);
|
||||
void ex_interface(exarg_T *eap);
|
||||
void ex_enum(exarg_T *eap);
|
||||
void ex_type(exarg_T *eap);
|
||||
int class_object_index(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int verbose);
|
||||
void copy_object(typval_T *from, typval_T *to);
|
||||
void object_unref(object_T *obj);
|
||||
void copy_class(typval_T *from, typval_T *to);
|
||||
void class_unref(class_T *cl);
|
||||
void object_created(object_T *obj);
|
||||
void object_cleared(object_T *obj);
|
||||
int object_free_nonref(int copyID);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -9,7 +9,7 @@ void restore_current_ectx(ectx_T *ectx);
|
||||
int add_defer_function(char_u *name, int argcount, typval_T *argvars);
|
||||
char_u *char_from_string(char_u *str, varnumber_T index);
|
||||
char_u *string_slice(char_u *str, varnumber_T first, varnumber_T last, int exclusive);
|
||||
int fill_partial_and_closure(partial_T *pt, ufunc_T *ufunc, loopvarinfo_T *loopvarinfo, ectx_T *ectx);
|
||||
int fill_partial_and_closure(partial_T *pt, ufunc_T *ufunc, loopvarinfo_T *lvi, ectx_T *ectx);
|
||||
int may_load_script(int sid, int *loaded);
|
||||
typval_T *lookup_debug_var(char_u *name);
|
||||
int may_break_in_function(ufunc_T *ufunc);
|
||||
@@ -17,7 +17,7 @@ int loopvars_check_refcount(loopvars_T *loopvars);
|
||||
int set_ref_in_loopvars(int copyID);
|
||||
int exe_typval_instr(typval_T *tv, typval_T *rettv);
|
||||
char_u *exe_substitute_instr(void);
|
||||
int call_def_function(ufunc_T *ufunc, int argc_arg, typval_T *argv, int flags, partial_T *partial, funccall_T *funccal, typval_T *rettv);
|
||||
int call_def_function(ufunc_T *ufunc, int argc_arg, typval_T *argv, int flags, partial_T *partial, object_T *object, funccall_T *funccal, typval_T *rettv);
|
||||
void unwind_def_callstack(ectx_T *ectx);
|
||||
void may_invoke_defer_funcs(ectx_T *ectx);
|
||||
void set_context_in_disassemble_cmd(expand_T *xp, char_u *arg);
|
||||
|
||||
@@ -3,6 +3,8 @@ isn_T *generate_instr(cctx_T *cctx, isntype_T isn_type);
|
||||
isn_T *generate_instr_drop(cctx_T *cctx, isntype_T isn_type, int drop);
|
||||
isn_T *generate_instr_type(cctx_T *cctx, isntype_T isn_type, type_T *type);
|
||||
isn_T *generate_instr_debug(cctx_T *cctx);
|
||||
int generate_CONSTRUCT(cctx_T *cctx, class_T *cl);
|
||||
int generate_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type);
|
||||
int may_generate_2STRING(int offset, int tolerant, cctx_T *cctx);
|
||||
int generate_add_instr(cctx_T *cctx, vartype_T vartype, type_T *type1, type_T *type2, exprtype_T expr_type);
|
||||
vartype_T operator_type(type_T *type1, type_T *type2);
|
||||
|
||||
@@ -19,5 +19,5 @@ void update_vim9_script_var(int create, dictitem_T *di, char_u *name, int flags,
|
||||
void hide_script_var(scriptitem_T *si, int idx, int func_defined);
|
||||
svar_T *find_typval_in_script(typval_T *dest, scid_T sid, int must_find);
|
||||
int check_script_var_type(svar_T *sv, typval_T *value, char_u *name, where_T where);
|
||||
int check_reserved_name(char_u *name);
|
||||
int check_reserved_name(char_u *name, cctx_T *cctx);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* vim9type.c */
|
||||
type_T *get_type_ptr(garray_T *type_gap);
|
||||
type_T *copy_type(type_T *type, garray_T *type_gap);
|
||||
void clear_type_list(garray_T *gap);
|
||||
type_T *alloc_type(type_T *type);
|
||||
|
||||
+70
-13
@@ -1406,6 +1406,9 @@ typedef struct {
|
||||
typedef struct isn_S isn_T; // instruction
|
||||
typedef struct dfunc_S dfunc_T; // :def function
|
||||
|
||||
typedef struct type_S type_T;
|
||||
typedef struct ufunc_S ufunc_T;
|
||||
|
||||
typedef struct jobvar_S job_T;
|
||||
typedef struct readq_S readq_T;
|
||||
typedef struct writeq_S writeq_T;
|
||||
@@ -1415,6 +1418,8 @@ typedef struct channel_S channel_T;
|
||||
typedef struct cctx_S cctx_T;
|
||||
typedef struct ectx_S ectx_T;
|
||||
typedef struct instr_S instr_T;
|
||||
typedef struct class_S class_T;
|
||||
typedef struct object_S object_T;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -1434,16 +1439,18 @@ typedef enum
|
||||
VAR_JOB, // "v_job" is used
|
||||
VAR_CHANNEL, // "v_channel" is used
|
||||
VAR_INSTR, // "v_instr" is used
|
||||
VAR_CLASS, // "v_class" is used
|
||||
VAR_OBJECT, // "v_object" is used
|
||||
} vartype_T;
|
||||
|
||||
// A type specification.
|
||||
typedef struct type_S type_T;
|
||||
struct type_S {
|
||||
vartype_T tt_type;
|
||||
int8_T tt_argcount; // for func, incl. vararg, -1 for unknown
|
||||
int8_T tt_min_argcount; // number of non-optional arguments
|
||||
char_u tt_flags; // TTFLAG_ values
|
||||
type_T *tt_member; // for list, dict, func return type
|
||||
// for class: class_T
|
||||
type_T **tt_args; // func argument types, allocated
|
||||
};
|
||||
|
||||
@@ -1452,6 +1459,44 @@ typedef struct {
|
||||
type_T *type_decl; // declared type or equal to type_current
|
||||
} type2_T;
|
||||
|
||||
/*
|
||||
* Entry for an object member variable.
|
||||
*/
|
||||
typedef struct {
|
||||
char_u *om_name; // allocated
|
||||
type_T *om_type;
|
||||
} objmember_T;
|
||||
|
||||
// "class_T": used for v_class of typval of VAR_CLASS
|
||||
struct class_S
|
||||
{
|
||||
char_u *class_name; // allocated
|
||||
int class_refcount;
|
||||
|
||||
int class_obj_member_count;
|
||||
objmember_T *class_obj_members; // allocated
|
||||
|
||||
int class_obj_method_count;
|
||||
ufunc_T **class_obj_methods; // allocated
|
||||
|
||||
garray_T class_type_list; // used for type pointers
|
||||
type_T class_type;
|
||||
type_T class_object_type; // same as class_type but VAR_OBJECT
|
||||
};
|
||||
|
||||
// Used for v_object of typval of VAR_OBJECT.
|
||||
// The member variables follow in an array of typval_T.
|
||||
struct object_S
|
||||
{
|
||||
class_T *obj_class; // class this object is created for;
|
||||
// pointer adds to class_refcount
|
||||
int obj_refcount;
|
||||
|
||||
object_T *obj_next_used; // for list headed by "first_object"
|
||||
object_T *obj_prev_used; // for list headed by "first_object"
|
||||
int obj_copyID; // used by garbage collection
|
||||
};
|
||||
|
||||
#define TTFLAG_VARARGS 0x01 // func args ends with "..."
|
||||
#define TTFLAG_BOOL_OK 0x02 // can be converted to bool
|
||||
#define TTFLAG_STATIC 0x04 // one of the static types, e.g. t_any
|
||||
@@ -1467,17 +1512,19 @@ typedef struct
|
||||
union
|
||||
{
|
||||
varnumber_T v_number; // number value
|
||||
float_T v_float; // floating number value
|
||||
char_u *v_string; // string value (can be NULL!)
|
||||
list_T *v_list; // list value (can be NULL!)
|
||||
dict_T *v_dict; // dict value (can be NULL!)
|
||||
float_T v_float; // floating point number value
|
||||
char_u *v_string; // string value (can be NULL)
|
||||
list_T *v_list; // list value (can be NULL)
|
||||
dict_T *v_dict; // dict value (can be NULL)
|
||||
partial_T *v_partial; // closure: function with args
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
job_T *v_job; // job value (can be NULL!)
|
||||
channel_T *v_channel; // channel value (can be NULL!)
|
||||
job_T *v_job; // job value (can be NULL)
|
||||
channel_T *v_channel; // channel value (can be NULL)
|
||||
#endif
|
||||
blob_T *v_blob; // blob value (can be NULL!)
|
||||
blob_T *v_blob; // blob value (can be NULL)
|
||||
instr_T *v_instr; // instructions to execute
|
||||
class_T *v_class; // class value (can be NULL)
|
||||
object_T *v_object; // object value (can be NULL)
|
||||
} vval;
|
||||
} typval_T;
|
||||
|
||||
@@ -1663,7 +1710,7 @@ typedef enum {
|
||||
* Structure to hold info for a user function.
|
||||
* When adding a field check copy_lambda_to_global_func().
|
||||
*/
|
||||
typedef struct
|
||||
struct ufunc_S
|
||||
{
|
||||
int uf_varargs; // variable nr of arguments (old style)
|
||||
int uf_flags; // FC_ flags
|
||||
@@ -1671,6 +1718,9 @@ typedef struct
|
||||
int uf_cleared; // func_clear() was already called
|
||||
def_status_T uf_def_status; // UF_NOT_COMPILED, UF_TO_BE_COMPILED, etc.
|
||||
int uf_dfunc_idx; // only valid if uf_def_status is UF_COMPILED
|
||||
|
||||
class_T *uf_class; // for object method and constructor
|
||||
|
||||
garray_T uf_args; // arguments, including optional arguments
|
||||
garray_T uf_def_args; // default argument expressions
|
||||
int uf_args_visible; // normally uf_args.ga_len, less when
|
||||
@@ -1731,7 +1781,7 @@ typedef struct
|
||||
char_u uf_name[4]; // name of function (actual size equals name);
|
||||
// can start with <SNR>123_ (<SNR> is K_SPECIAL
|
||||
// KS_EXTRA KE_SNR)
|
||||
} ufunc_T;
|
||||
};
|
||||
|
||||
// flags used in uf_flags
|
||||
#define FC_ABORT 0x01 // abort function on error
|
||||
@@ -1750,6 +1800,9 @@ typedef struct
|
||||
// copy_lambda_to_global_func()
|
||||
#define FC_LAMBDA 0x2000 // one line "return {expr}"
|
||||
|
||||
#define FC_OBJECT 010000 // object method
|
||||
#define FC_NEW 030000 // constructor (also an object method)
|
||||
|
||||
#define MAX_FUNC_ARGS 20 // maximum number of function arguments
|
||||
#define VAR_SHORT_LEN 20 // short variable name length
|
||||
#define FIXVAR_CNT 12 // number of fixed variables
|
||||
@@ -2030,10 +2083,10 @@ typedef struct
|
||||
# endif
|
||||
#else
|
||||
// dummy typedefs for use in function prototypes
|
||||
typedef struct
|
||||
struct ufunc_S
|
||||
{
|
||||
int dummy;
|
||||
} ufunc_T;
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
int dummy;
|
||||
@@ -2071,6 +2124,7 @@ typedef struct {
|
||||
int fe_evaluate; // actually evaluate expressions
|
||||
partial_T *fe_partial; // for extra arguments
|
||||
dict_T *fe_selfdict; // Dictionary for "self"
|
||||
object_T *fe_object; // object, e.g. for "this.Func()"
|
||||
typval_T *fe_basetv; // base for base->method()
|
||||
type_T *fe_check_type; // type from funcref or NULL
|
||||
int fe_found_var; // if the function is not found then give an
|
||||
@@ -3628,8 +3682,11 @@ struct window_S
|
||||
// window
|
||||
#endif
|
||||
|
||||
// five fields that are only used when there is a WinScrolled autocommand
|
||||
// six fields that are only used when there is a WinScrolled autocommand
|
||||
linenr_T w_last_topline; // last known value for w_topline
|
||||
#ifdef FEAT_DIFF
|
||||
int w_last_topfill; // last known value for w_topfill
|
||||
#endif
|
||||
colnr_T w_last_leftcol; // last known value for w_leftcol
|
||||
colnr_T w_last_skipcol; // last known value for w_skipcol
|
||||
int w_last_width; // last known value for w_width
|
||||
|
||||
@@ -37,6 +37,7 @@ SCRIPTS_TINY_OUT = \
|
||||
TEST_VIM9 = \
|
||||
test_vim9_assign \
|
||||
test_vim9_builtin \
|
||||
test_vim9_class \
|
||||
test_vim9_cmd \
|
||||
test_vim9_disassemble \
|
||||
test_vim9_expr \
|
||||
@@ -48,6 +49,7 @@ TEST_VIM9 = \
|
||||
TEST_VIM9_RES = \
|
||||
test_vim9_assign.res \
|
||||
test_vim9_builtin.res \
|
||||
test_vim9_class.res \
|
||||
test_vim9_cmd.res \
|
||||
test_vim9_disassemble.res \
|
||||
test_vim9_expr.res \
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
>"+0&#ffffff0| |l|i|n|e| |1| @51
|
||||
|"| |l|i|n|e| |2| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |3| @51
|
||||
|"| |l|i|n|e| |4| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|@+0#4040ff13&@2| @56
|
||||
| +0#0000000&@41|1|,|1| @10|T|o|p|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |8| @51
|
||||
>"| |l|i|n|e| |9| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |1|0| @50
|
||||
@42|9|,|1| @10|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |8| @51
|
||||
>"| |l|i|n|e| |9| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
| +0#0000000&@41|9|,|1| @10|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |8| @51
|
||||
|"| |l|i|n|e| |9| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
>"| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
| +0#0000000&@41|1|0|,|1| @9|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |9| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
>"| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
| +0#0000000&@41|1|0|,|1| @9|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
>"| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
| +0#0000000&@41|1|0|,|1| @9|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2| +0#0000000&@2|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@39
|
||||
>"| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
| +0#0000000&@41|1|0|,|1| @9|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
>"+0&#ffffff0| |l|i|n|e| |1|0| @50
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
| +0#0000000&@41|1|0|,|1| @9|B|o|t|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |2| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |3| @51
|
||||
>"| |l|i|n|e| |4| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
@42|4|,|1| @10|1|6|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |3| @51
|
||||
>"| |l|i|n|e| |4| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
|"| |l|i|n|e| |6| @51
|
||||
@42|4|,|1| @10|3@1|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2|i+0#0000000&|n|e| |3| @51
|
||||
>"| |l|i|n|e| |4| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
|"| |l|i|n|e| |6| @51
|
||||
|@+0#4040ff13&@2| @56
|
||||
| +0#0000000&@41|4|,|1| @10|3@1|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |4| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
>"| |l|i|n|e| |6| @51
|
||||
|"| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
@42|6|,|1| @10|5|0|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
>"| |l|i|n|e| |6| @51
|
||||
|"| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |8| @51
|
||||
@42|6|,|1| @10|6@1|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2|e+0#0000000#ffd7ff255|r|t| |a|b|o|v|e| |2| +0&#ffffff0@45
|
||||
|"| |l|i|n|e| |5| @51
|
||||
>"| |l|i|n|e| |6| @51
|
||||
|"| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |8| @51
|
||||
|@+0#4040ff13&@2| @56
|
||||
| +0#0000000&@41|6|,|1| @10|6@1|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|<+0#4040ff13#ffffff0@2|i+0#0000000&|n|e| |5| @51
|
||||
>"| |l|i|n|e| |6| @51
|
||||
|"| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
|"| |l|i|n|e| |8| @51
|
||||
|"| |l|i|n|e| |9| @51
|
||||
|@+0#4040ff13&@2| @56
|
||||
| +0#0000000&@41|6|,|1| @10|6@1|%|
|
||||
@@ -0,0 +1,8 @@
|
||||
|"+0&#ffffff0| |l|i|n|e| |6| @51
|
||||
|"| |l|i|n|e| |7| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| +0&#ffffff0@47
|
||||
>"| |l|i|n|e| |8| @51
|
||||
|"| |l|i|n|e| |9| @51
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |1| +0&#ffffff0@45
|
||||
|i+0&#ffd7ff255|n|s|e|r|t| |b|e|l|o|w| |2| +0&#ffffff0@45
|
||||
@42|8|,|1| @10|8|3|%|
|
||||
@@ -0,0 +1,6 @@
|
||||
|t+0&#ffffff0|e|s>t| @70
|
||||
@75
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|1+0#0000000&| |l|i|n|e| |l|e|s@1|;| |b|e|f|o|r|e| |#|2| @1|0| |s|e|c|o|n|d|s| |a|g|o| @19|1|,|4| @10|A|l@1|
|
||||
@@ -0,0 +1,6 @@
|
||||
> +0&#ffffff0@74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|2+0#0000000&| |f|e|w|e|r| |l|i|n|e|s|;| |b|e|f|o|r|e| |#|1| @1|1| |s|e|c|o|n|d| |a|g|o| @18|0|,|0|-|1| @8|A|l@1|
|
||||
@@ -0,0 +1,2 @@
|
||||
" Filter that changes the "1 second ago" message to "0 seconds ago".
|
||||
6s+|1| |s|e|c|o|n|d| |a|g|o| @18|+|0| |s|e|c|o|n|d|s| |a|g|o| @17|+e
|
||||
@@ -0,0 +1,10 @@
|
||||
| +0#0000001#e0e0e08|!| @14| +0#0000000#0000001| +0&#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|#| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|&| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|*| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|+@1| @13| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|-@1| @13| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|<| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|=| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
| +0#0000001#ffd7ff255|>| @14| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@56
|
||||
|:+0#0000000&|!> @72
|
||||
@@ -160,6 +160,7 @@ if has('mac')
|
||||
let $BASH_SILENCE_DEPRECATION_WARNING = 1
|
||||
endif
|
||||
|
||||
|
||||
" Prepare for calling test_garbagecollect_now().
|
||||
let v:testing = 1
|
||||
|
||||
@@ -186,6 +187,30 @@ if has('reltime')
|
||||
let g:func_start = reltime()
|
||||
endif
|
||||
|
||||
" Get the list of swap files in the current directory.
|
||||
func s:GetSwapFileList()
|
||||
let save_dir = &directory
|
||||
let &directory = '.'
|
||||
let files = swapfilelist()
|
||||
let &directory = save_dir
|
||||
|
||||
" remove a match with runtest.vim
|
||||
let idx = indexof(files, 'v:val =~ "runtest.vim."')
|
||||
if idx >= 0
|
||||
call remove(files, idx)
|
||||
endif
|
||||
|
||||
return files
|
||||
endfunc
|
||||
|
||||
" A previous (failed) test run may have left swap files behind. Delete them
|
||||
" before running tests again, they might interfere.
|
||||
for name in s:GetSwapFileList()
|
||||
call delete(name)
|
||||
endfor
|
||||
unlet name
|
||||
|
||||
|
||||
" Invoked when a test takes too much time.
|
||||
func TestTimeout(id)
|
||||
split test.log
|
||||
@@ -339,6 +364,35 @@ func RunTheTest(test)
|
||||
endif
|
||||
call add(s:messages, message)
|
||||
let s:done += 1
|
||||
|
||||
" close any split windows
|
||||
while winnr('$') > 1
|
||||
bwipe!
|
||||
endwhile
|
||||
|
||||
" May be editing some buffer, wipe it out. Then we may end up in another
|
||||
" buffer, continue until we end up in an empty no-name buffer without a swap
|
||||
" file.
|
||||
while bufname() != '' || execute('swapname') !~ 'No swap file'
|
||||
let bn = bufnr()
|
||||
|
||||
noswapfile bwipe!
|
||||
|
||||
if bn == bufnr()
|
||||
" avoid getting stuck in the same buffer
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Check if the test has left any swap files behind. Delete them before
|
||||
" running tests again, they might interfere.
|
||||
let swapfiles = s:GetSwapFileList()
|
||||
if len(swapfiles) > 0
|
||||
call add(s:messages, "Found swap files: " .. string(swapfiles))
|
||||
for name in swapfiles
|
||||
call delete(name)
|
||||
endfor
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func AfterTheTest(func_name)
|
||||
|
||||
@@ -393,8 +393,8 @@ func Test_WinScrolled()
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 1, 'topline': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': -1, 'topline': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ 'all': {'leftcol': 1, 'topline': 0, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': -1, 'topline': 0, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
" Scroll up/down in Normal mode.
|
||||
@@ -403,8 +403,8 @@ func Test_WinScrolled()
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 1, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': -1, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ 'all': {'leftcol': 0, 'topline': 1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': -1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
" Scroll up/down in Insert mode.
|
||||
@@ -414,8 +414,8 @@ func Test_WinScrolled()
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 1, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': -1, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ 'all': {'leftcol': 0, 'topline': 1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': -1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
" Scroll the window horizontally to focus the last letter of the third line
|
||||
@@ -427,8 +427,8 @@ func Test_WinScrolled()
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 5, 'topline': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': -5, 'topline': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ 'all': {'leftcol': 5, 'topline': 0, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': -5, 'topline': 0, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
" Ensure the command was triggered for the specified window ID.
|
||||
@@ -578,6 +578,68 @@ func Test_WinScrolled_long_wrapped()
|
||||
call term_sendkeys(buf, '$')
|
||||
call term_sendkeys(buf, ":echo g:scrolled\<CR>")
|
||||
call WaitForAssert({-> assert_match('^3 ', term_getline(buf, 6))}, 1000)
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_WinScrolled_diff()
|
||||
CheckRunVimInTerminal
|
||||
|
||||
let lines =<< trim END
|
||||
set diffopt+=foldcolumn:0
|
||||
call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])
|
||||
vnew
|
||||
call setline(1, ['d', 'e', 'f', 'g', 'h', 'i'])
|
||||
windo diffthis
|
||||
func WriteScrollEvent()
|
||||
call writefile([json_encode(v:event)], 'XscrollEvent')
|
||||
endfunc
|
||||
au WinScrolled * call WriteScrollEvent()
|
||||
END
|
||||
call writefile(lines, 'Xtest_winscrolled_diff', 'D')
|
||||
let buf = RunVimInTerminal('-S Xtest_winscrolled_diff', {'rows': 8})
|
||||
|
||||
call term_sendkeys(buf, "\<C-E>")
|
||||
call WaitForAssert({-> assert_match('^d', term_getline(buf, 3))}, 1000)
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 1, 'topfill': 1, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': 1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1001': {'leftcol': 0, 'topline': 0, 'topfill': -1, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
call term_sendkeys(buf, "2\<C-E>")
|
||||
call WaitForAssert({-> assert_match('^f', term_getline(buf, 3))}, 1000)
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 2, 'topfill': 2, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': 2, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1001': {'leftcol': 0, 'topline': 0, 'topfill': -2, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
call term_sendkeys(buf, "\<C-E>")
|
||||
call WaitForAssert({-> assert_match('^g', term_getline(buf, 3))}, 1000)
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 2, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': 1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1001': {'leftcol': 0, 'topline': 1, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
call term_sendkeys(buf, "2\<C-Y>")
|
||||
call WaitForAssert({-> assert_match('^e', term_getline(buf, 3))}, 1000)
|
||||
|
||||
let event = readfile('XscrollEvent')[0]->json_decode()
|
||||
call assert_equal({
|
||||
\ 'all': {'leftcol': 0, 'topline': 3, 'topfill': 1, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1000': {'leftcol': 0, 'topline': -2, 'topfill': 0, 'width': 0, 'height': 0, 'skipcol': 0},
|
||||
\ '1001': {'leftcol': 0, 'topline': -1, 'topfill': 1, 'width': 0, 'height': 0, 'skipcol': 0}
|
||||
\ }, event)
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_WinClosed()
|
||||
@@ -1846,6 +1908,15 @@ func Test_Cmdline()
|
||||
call assert_equal(':', g:entered)
|
||||
au! CmdlineChanged
|
||||
|
||||
let g:log = []
|
||||
cnoremap <F1> <Cmd>call setcmdline('ls')<CR>
|
||||
autocmd CmdlineChanged : let g:log += [getcmdline()]
|
||||
call feedkeys(":\<F1>", 'xt')
|
||||
call assert_equal(['ls'], g:log)
|
||||
unlet g:log
|
||||
au! CmdlineChanged
|
||||
cunmap <F1>
|
||||
|
||||
au! CmdlineEnter : let g:entered = expand('<afile>')
|
||||
au! CmdlineLeave : let g:left = expand('<afile>')
|
||||
let g:entered = 0
|
||||
@@ -3162,7 +3233,7 @@ func Test_autocmd_FileReadCmd()
|
||||
\ 'v:cmdarg = ++ff=mac',
|
||||
\ 'v:cmdarg = ++enc=utf-8'], getline(1, '$'))
|
||||
|
||||
close!
|
||||
bwipe!
|
||||
augroup FileReadCmdTest
|
||||
au!
|
||||
augroup END
|
||||
|
||||
@@ -2485,6 +2485,23 @@ func Test_wildmenu_pum_from_terminal()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_wildmenu_pum_clear_entries()
|
||||
CheckRunVimInTerminal
|
||||
|
||||
" This was using freed memory. Run in a terminal to get the pum to update.
|
||||
let lines =<< trim END
|
||||
set wildoptions=pum
|
||||
set wildchar=<C-E>
|
||||
END
|
||||
call writefile(lines, 'XwildmenuTest', 'D')
|
||||
let buf = RunVimInTerminal('-S XwildmenuTest', #{rows: 10})
|
||||
|
||||
call term_sendkeys(buf, ":\<C-E>\<C-E>")
|
||||
call VerifyScreenDump(buf, 'Test_wildmenu_pum_clear_entries_1', {})
|
||||
|
||||
set wildoptions& wildchar&
|
||||
endfunc
|
||||
|
||||
" Test for completion after a :substitute command followed by a pipe (|)
|
||||
" character
|
||||
func Test_cmdline_complete_substitute()
|
||||
|
||||
@@ -156,6 +156,22 @@ func Test_screenpos_fold()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_screenpos_diff()
|
||||
CheckFeature diff
|
||||
|
||||
enew!
|
||||
call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])
|
||||
vnew
|
||||
call setline(1, ['a', 'b', 'c', 'g', 'h', 'i'])
|
||||
windo diffthis
|
||||
wincmd w
|
||||
call assert_equal(#{col: 3, row: 7, endcol: 3, curscol: 3}, screenpos(0, 4, 1))
|
||||
|
||||
windo diffoff
|
||||
bwipe!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_screenpos_number()
|
||||
rightbelow new
|
||||
rightbelow 73vsplit
|
||||
@@ -167,6 +183,9 @@ func Test_screenpos_number()
|
||||
let pos = screenpos(winid, 1, 66)
|
||||
call assert_equal(winrow, pos.row)
|
||||
call assert_equal(wincol + 66 + 3, pos.col)
|
||||
|
||||
call assert_fails('echo screenpos(0, 2, 1)', 'E966:')
|
||||
|
||||
close
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
@@ -652,6 +652,7 @@ let s:filename_checks = {
|
||||
\ 'zig': ['file.zig'],
|
||||
\ 'zimbu': ['file.zu'],
|
||||
\ 'zimbutempl': ['file.zut'],
|
||||
\ 'zir': ['file.zir'],
|
||||
\ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
|
||||
\
|
||||
\ 'help': [$VIMRUNTIME . '/doc/help.txt'],
|
||||
|
||||
+43
-32
@@ -249,9 +249,10 @@ func Test_normal_formatexpr_returns_nonzero()
|
||||
setlocal formatexpr=Format()
|
||||
normal VGgq
|
||||
call assert_equal(['one two'], getline(1, '$'))
|
||||
|
||||
setlocal formatexpr=
|
||||
delfunc Format
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for using a script-local function for 'formatexpr'
|
||||
@@ -1279,7 +1280,7 @@ func Test_vert_scroll_cmds()
|
||||
call assert_equal(15, line('w$'))
|
||||
|
||||
set foldenable&
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_scroll_in_ex_mode()
|
||||
@@ -2290,7 +2291,7 @@ func Test_normal_section()
|
||||
call assert_equal(2, line('.'))
|
||||
call assert_equal(-1, foldclosedend(line('.')))
|
||||
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for changing case using u, U, gu, gU and ~ (tilde) commands
|
||||
@@ -2387,7 +2388,8 @@ func Test_normal_changecase_turkish()
|
||||
" can't use Turkish locale
|
||||
throw 'Skipped: Turkish locale not available'
|
||||
endtry
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for r (replace) command
|
||||
@@ -2915,7 +2917,8 @@ func Test_normal_nvend()
|
||||
call assert_equal([4, 5], [line('.'), col('.')])
|
||||
exe "normal! \<C-End>"
|
||||
call assert_equal([10, 6], [line('.'), col('.')])
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for cw cW ce
|
||||
@@ -3395,7 +3398,7 @@ func Test_java_motion()
|
||||
call assert_equal([7, 8, 15], [line('.'), col('.'), virtcol('.')])
|
||||
call assert_equal(-1, foldclosedend(7))
|
||||
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Tests for g cmds
|
||||
@@ -3510,7 +3513,8 @@ func Test_normal_yank_with_excmd()
|
||||
let @a = ''
|
||||
call feedkeys("\"ay:if v:true\<CR>normal l\<CR>endif\<CR>", 'xt')
|
||||
call assert_equal('f', @a)
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for supplying a count to a normal-mode command across a cursorhold call
|
||||
@@ -3531,7 +3535,8 @@ func Test_normal_cursorhold_with_count()
|
||||
au!
|
||||
augroup END
|
||||
au! normalcHoldTest
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
delfunc s:cHold
|
||||
endfunc
|
||||
|
||||
@@ -3555,7 +3560,8 @@ func Test_horiz_motion()
|
||||
call assert_equal(11, col('.'))
|
||||
exe "normal! $\<C-BS>"
|
||||
call assert_equal(10, col('.'))
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for using a : command in operator pending mode
|
||||
@@ -3563,7 +3569,7 @@ func Test_normal_colon_op()
|
||||
new
|
||||
call setline(1, ['one', 'two'])
|
||||
call assert_beeps("normal! Gc:d\<CR>")
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for d and D commands
|
||||
@@ -3588,7 +3594,7 @@ func Test_normal_delete_cmd()
|
||||
call assert_fails('normal D', 'E21:')
|
||||
call assert_fails('normal d$', 'E21:')
|
||||
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for deleting or changing characters across lines with 'whichwrap'
|
||||
@@ -3608,7 +3614,8 @@ func Test_normal_op_across_lines()
|
||||
call setline(1, ['one two', 'three four'])
|
||||
exe "norm! $3x"
|
||||
call assert_equal(['one twhree four'], getline(1, '$'))
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
set whichwrap&
|
||||
endfunc
|
||||
|
||||
@@ -3646,11 +3653,11 @@ func Test_normal_word_move()
|
||||
normal 3Gyb
|
||||
call assert_equal("two\n ", @")
|
||||
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for 'scrolloff' with a long line that doesn't fit in the screen
|
||||
func Test_normal_scroloff()
|
||||
func Test_normal_scrolloff()
|
||||
10new
|
||||
60vnew
|
||||
call setline(1, ' 1 ' .. repeat('a', 57)
|
||||
@@ -3691,8 +3698,9 @@ func Test_normal_scroloff()
|
||||
call assert_equal(1, winline())
|
||||
normal $
|
||||
call assert_equal(10, winline())
|
||||
|
||||
set scrolloff&
|
||||
close!
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for vertical scrolling with CTRL-F and CTRL-B with a long line
|
||||
@@ -3712,7 +3720,8 @@ func Test_normal_vert_scroll_longline()
|
||||
exe "normal \<C-B>\<C-B>"
|
||||
call assert_equal(5, line('.'))
|
||||
call assert_equal(5, winline())
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for jumping in a file using %
|
||||
@@ -3725,7 +3734,8 @@ func Test_normal_percent_jump()
|
||||
call feedkeys('50%', 'xt')
|
||||
call assert_equal(50, line('.'))
|
||||
call assert_equal(-1, foldclosedend(50))
|
||||
close!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for << and >> commands to shift text by 'shiftwidth'
|
||||
@@ -3818,24 +3828,25 @@ func Test_mouse_shape_after_failed_change()
|
||||
CheckCanRunGui
|
||||
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
set mouseshape+=o:busy
|
||||
setlocal nomodifiable
|
||||
let g:mouse_shapes = []
|
||||
var mouse_shapes = []
|
||||
|
||||
func SaveMouseShape(timer)
|
||||
let g:mouse_shapes += [getmouseshape()]
|
||||
endfunc
|
||||
|
||||
func SaveAndQuit(timer)
|
||||
call writefile(g:mouse_shapes, 'Xmouseshapes')
|
||||
quit
|
||||
endfunc
|
||||
|
||||
call timer_start(50, {_ -> feedkeys('c')})
|
||||
call timer_start(100, 'SaveMouseShape')
|
||||
call timer_start(150, {_ -> feedkeys('c')})
|
||||
call timer_start(200, 'SaveMouseShape')
|
||||
call timer_start(250, 'SaveAndQuit')
|
||||
feedkeys('c')
|
||||
timer_start(50, (_) => {
|
||||
mouse_shapes += [getmouseshape()]
|
||||
timer_start(50, (_) => {
|
||||
feedkeys('c')
|
||||
timer_start(50, (_) => {
|
||||
mouse_shapes += [getmouseshape()]
|
||||
timer_start(50, (_) => {
|
||||
writefile(mouse_shapes, 'Xmouseshapes')
|
||||
quit
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
END
|
||||
call writefile(lines, 'Xmouseshape.vim', 'D')
|
||||
call RunVim([], [], "-g -S Xmouseshape.vim")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user