Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2020-03-15 00:18:08 -07:00
111 changed files with 4738 additions and 1335 deletions
+43 -22
View File
@@ -1,6 +1,6 @@
" Vim plugin for formatting XML
" Last Change: 2019 Oct 24
" Version: 0.2
" Last Change: 2020 Jan 06
" Version: 0.3
" Author: Christian Brabandt <cb@256bit.org>
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
" License: VIM License
@@ -15,7 +15,7 @@ let s:keepcpo = &cpo
set cpo&vim
" Main function: Format the input {{{1
func! xmlformat#Format()
func! xmlformat#Format() abort
" only allow reformatting through the gq command
" (e.g. Vim is in normal mode)
if mode() != 'n'
@@ -40,14 +40,16 @@ func! xmlformat#Format()
continue
elseif line !~# '<[/]\?[^>]*>'
let nextmatch = match(list, '<[/]\?[^>]*>', current)
let line .= join(list[(current + 1):(nextmatch-1)], "\n")
call remove(list, current+1, nextmatch-1)
if nextmatch > -1
let line .= ' '. join(list[(current + 1):(nextmatch-1)], " ")
call remove(list, current+1, nextmatch-1)
endif
endif
" split on `>`, but don't split on very first opening <
" this means, items can be like ['<tag>', 'tag content</tag>']
for item in split(line, '.\@<=[>]\zs')
if s:EndTag(item)
let s:indent = s:DecreaseIndent()
call s:DecreaseIndent()
call add(result, s:Indent(item))
elseif s:EmptyTag(lastitem)
call add(result, s:Indent(item))
@@ -59,13 +61,23 @@ func! xmlformat#Format()
" Simply split on '<', if there is one,
" but reformat according to &textwidth
let t=split(item, '.<\@=\zs')
" if the content fits well within a single line, add it there
" so that the output looks like this:
"
" <foobar>1</foobar>
if s:TagContent(lastitem) is# s:TagContent(t[1]) && strlen(result[-1]) + strlen(item) <= s:Textwidth()
let result[-1] .= item
let lastitem = t[1]
continue
endif
" t should only contain 2 items, but just be safe here
if s:IsTag(lastitem)
let s:indent+=1
endif
let result+=s:FormatContent([t[0]])
if s:EndTag(t[1])
let s:indent = s:DecreaseIndent()
call s:DecreaseIndent()
endif
"for y in t[1:]
let result+=s:FormatContent(t[1:])
@@ -97,15 +109,15 @@ func! xmlformat#Format()
return 0
endfunc
" Check if given tag is XML Declaration header {{{1
func! s:IsXMLDecl(tag)
func! s:IsXMLDecl(tag) abort
return a:tag =~? '^\s*<?xml\s\?\%(version="[^"]*"\)\?\s\?\%(encoding="[^"]*"\)\? ?>\s*$'
endfunc
" Return tag indented by current level {{{1
func! s:Indent(item)
func! s:Indent(item) abort
return repeat(' ', shiftwidth()*s:indent). s:Trim(a:item)
endfu
" Return item trimmed from leading whitespace {{{1
func! s:Trim(item)
func! s:Trim(item) abort
if exists('*trim')
return trim(a:item)
else
@@ -113,44 +125,53 @@ func! s:Trim(item)
endif
endfunc
" Check if tag is a new opening tag <tag> {{{1
func! s:StartTag(tag)
func! s:StartTag(tag) abort
let is_comment = s:IsComment(a:tag)
return a:tag =~? '^\s*<[^/?]' && !is_comment
endfunc
" Check if tag is a Comment start {{{1
func! s:IsComment(tag)
func! s:IsComment(tag) abort
return a:tag =~? '<!--'
endfunc
" Remove one level of indentation {{{1
func! s:DecreaseIndent()
return (s:indent > 0 ? s:indent - 1 : 0)
func! s:DecreaseIndent() abort
let s:indent = (s:indent > 0 ? s:indent - 1 : 0)
endfunc
" Check if tag is a closing tag </tag> {{{1
func! s:EndTag(tag)
func! s:EndTag(tag) abort
return a:tag =~? '^\s*</'
endfunc
" Check that the tag is actually a tag and not {{{1
" something like "foobar</foobar>"
func! s:IsTag(tag)
func! s:IsTag(tag) abort
return s:Trim(a:tag)[0] == '<'
endfunc
" Check if tag is empty <tag/> {{{1
func! s:EmptyTag(tag)
func! s:EmptyTag(tag) abort
return a:tag =~ '/>\s*$'
endfunc
func! s:TagContent(tag) abort "{{{1
" Return content of a tag
return substitute(a:tag, '^\s*<[/]\?\([^>]*\)>\s*$', '\1', '')
endfunc
func! s:Textwidth() abort "{{{1
" return textwidth (or 80 if not set)
return &textwidth == 0 ? 80 : &textwidth
endfunc
" Format input line according to textwidth {{{1
func! s:FormatContent(list)
func! s:FormatContent(list) abort
let result=[]
let limit = 80
if &textwidth > 0
let limit = &textwidth
endif
let limit = s:Textwidth()
let column=0
let idx = -1
let add_indent = 0
let cnt = 0
for item in a:list
for word in split(item, '\s\+\S\+\zs')
if match(word, '^\s\+$') > -1
" skip empty words
continue
endif
let column += strdisplaywidth(word, column)
if match(word, "^\\s*\n\\+\\s*$") > -1
call add(result, '')
+5 -1
View File
@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 8.2. Last change: 2020 Feb 15
*cmdline.txt* For Vim version 8.2. Last change: 2020 Feb 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -476,6 +476,10 @@ emulate it. For example, this mimics autolist=ambiguous:
This will find the longest match with the first 'wildchar', then list all
matching files with the next.
*complete-script-local-functions*
When completing user function names, prepend "s:" to find script-local
functions.
*suffixes*
For file name completion you can use the 'suffixes' option to set a priority
between files with almost the same name. If there are multiple matches,
+24 -10
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Feb 22
*eval.txt* For Vim version 8.2. Last change: 2020 Mar 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4369,6 +4369,8 @@ feedkeys({string} [, {mode}]) *feedkeys()*
'L' Lowlevel input. Only works for Unix or when using the
GUI. Keys are used as if they were coming from the
terminal. Other flags are not used. *E980*
When a CTRL-C interrupts it sets the internal
"got_int" flag.
'i' Insert the string instead of appending (see above).
'x' Execute commands until typeahead is empty. This is
similar to using ":normal!". You can call feedkeys()
@@ -5841,6 +5843,15 @@ has({feature}) The result is a Number, which is 1 if the feature {feature} is
supported, zero otherwise. The {feature} argument is a
string. See |feature-list| below.
Also see |exists()|.
Note that to skip code that has a syntax error when the
feature is not available, Vim may skip the rest of the line
and miss a following `endif`. Therfore put the `endif` on a
separate line: >
if has('feature')
let x = this->breaks->without->the->feature
endif
< If the `endif` would be in the second line it would not be
found.
has_key({dict}, {key}) *has_key()*
@@ -8624,7 +8635,12 @@ setpos({expr}, {list})
setqflist({list} [, {action} [, {what}]]) *setqflist()*
Create or replace or add to the quickfix list.
When {what} is not present, use the items in {list}. Each
If the optional {what} dictionary argument is supplied, then
only the items listed in {what} are set. The first {list}
argument is ignored. See below for the supported items in
{what}.
When {what} is not present, the items in {list} or used. Each
item must be a dictionary. Non-dictionary items in {list} are
ignored. Each dictionary item can contain the following
entries:
@@ -8679,10 +8695,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
freed. To add a new quickfix list at the end of the stack,
set "nr" in {what} to "$".
If the optional {what} dictionary argument is supplied, then
only the items listed in {what} are set. The first {list}
argument is ignored. The following items can be specified in
{what}:
The following items can be specified in dictionary {what}:
context quickfix list context. See |quickfix-context|
efm errorformat to use when parsing text from
"lines". If this is not present, then the
@@ -10498,11 +10511,12 @@ winlayout([{tabnr}]) *winlayout()*
" Two horizontally split windows
:echo winlayout()
['col', [['leaf', 1000], ['leaf', 1001]]]
" Three horizontally split windows, with two
" vertically split windows in the middle window
" The second tab page, with three horizontally split
" windows, with two vertically split windows in the
" middle window
:echo winlayout(2)
['col', [['leaf', 1002], ['row', ['leaf', 1003],
['leaf', 1001]]], ['leaf', 1000]]
['col', [['leaf', 1002], ['row', [['leaf', 1003],
['leaf', 1001]]], ['leaf', 1000]]]
<
Can also be used as a |method|: >
GetTabnr()->winlayout()
+12 -1
View File
@@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 8.2. Last change: 2019 Oct 18
*helphelp.txt* For Vim version 8.2. Last change: 2020 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -368,4 +368,15 @@ highlighting. So do these:
You can find the details in $VIMRUNTIME/syntax/help.vim
*inclusion*
Some people make a big deal about using "his" when referring to the user,
thinking it means we assume the user is male. That is of course not the case,
it's just a habit of writing help text, which quite often is many years old.
Also, a lot of the text is written by contributors for who English is not
their first language. We do not make any assumptions about the gender of the
user, no matter how the text is phrased. And we do not want to waste time on
this discussion. The goal is that the reader understands how Vim works, the
exact wording is secondary.
vim:tw=78:ts=8:noet:ft=help:norl:
+4 -4
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2020 Feb 14
*options.txt* For Vim version 8.2. Last change: 2020 Mar 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4757,8 +4757,8 @@ A jump table for the options with a short description can be found at |Q_op|.
be able to execute Normal mode commands.
This is the opposite of the 'keymap' option, where characters are
mapped in Insert mode.
Also consider resetting 'langremap' to avoid 'langmap' applies to
characters resulting from a mapping.
Also consider setting 'langremap' to off, to prevent 'langmap' from
applying to characters resulting from a mapping.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -4823,7 +4823,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'langnoremap' is set to the inverted value, and the other way around.
*'langremap'* *'lrm'* *'nolangremap'* *'nolrm'*
'langremap' 'lrm' boolean (default on, reset in |defaults.vim|)
'langremap' 'lrm' boolean (default on, set to off in |defaults.vim|)
global
{only available when compiled with the |+langmap|
feature}
+4 -4
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.2. Last change: 2019 Dec 19
*syntax.txt* For Vim version 8.2. Last change: 2020 Feb 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -217,7 +217,7 @@ The name for a highlight or syntax group must consist of ASCII letters, digits
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
an error when using other characters.
To be able to allow each user to pick his favorite set of colors, there must
To be able to allow each user to pick their favorite set of colors, there must
be preferred names for highlight groups that are common for many languages.
These are the suggested group names (if syntax highlighting works properly
you can see the actual color, except for "Ignore"):
@@ -4512,8 +4512,8 @@ two different ways:
(e.g., "syntax/pod.vim") the file is searched for in 'runtimepath'.
All matching files are loaded. Using a relative path is
recommended, because it allows a user to replace the included file
with his own version, without replacing the file that does the ":syn
include".
with their own version, without replacing the file that does the
":syn include".
*E847*
The maximum number of includes is 999.
+2
View File
@@ -5907,6 +5907,7 @@ complete-item-kind insert.txt /*complete-item-kind*
complete-items insert.txt /*complete-items*
complete-popup insert.txt /*complete-popup*
complete-popuphidden insert.txt /*complete-popuphidden*
complete-script-local-functions cmdline.txt /*complete-script-local-functions*
complete_CTRL-E insert.txt /*complete_CTRL-E*
complete_CTRL-Y insert.txt /*complete_CTRL-Y*
complete_add() eval.txt /*complete_add()*
@@ -7460,6 +7461,7 @@ in_name channel.txt /*in_name*
in_top channel.txt /*in_top*
inactive-buffer windows.txt /*inactive-buffer*
include-search tagsrch.txt /*include-search*
inclusion helphelp.txt /*inclusion*
inclusive motion.txt /*inclusive*
incomp-small-6 version6.txt /*incomp-small-6*
incompatible-5 version5.txt /*incompatible-5*
+4 -3
View File
@@ -1,4 +1,4 @@
*textprop.txt* For Vim version 8.2. Last change: 2020 Feb 22
*textprop.txt* For Vim version 8.2. Last change: 2020 Mar 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -133,8 +133,8 @@ prop_add({lnum}, {col}, {props})
to {lnum}, this is a zero-width text property
bufnr buffer to add the property to; when omitted
the current buffer is used
id user defined ID for the property; when omitted
zero is used
id user defined ID for the property; must be a
number; when omitted zero is used
type name of the text property type
All fields except "type" are optional.
@@ -231,6 +231,7 @@ prop_remove({props} [, {lnum} [, {lnum-end}]])
{props} is a dictionary with these fields:
id remove text properties with this ID
type remove text properties with this type name
both "id" and "type" must both match
bufnr use this buffer instead of the current one
all when TRUE remove all matching text properties,
not just the first one
+43 -15
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Feb 25
*todo.txt* For Vim version 8.2. Last change: 2020 Mar 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,14 +38,23 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Patch for this (#5696):
- Empty text prop which includes start/end does not grow when inserting text.
(Axel Forsman, #5679)
When starting a terminal popup the size defaults to nothing. Should have a
sensible default, e.g. four lines of 30 chars.
call popup_create(term_start(&shell, #{hidden: 1}), #{})
Test_terminal_in_popup() still sometimes fails with "All" instead of "Top".
Patch to fix vimtutor problems on Windows (Wu Yongwei, #5774)
Additional tests for menu. (Yegappan, #5760)
Introduces menu_info(), check that out.
Vim9 script:
- Add vim9 commands to index, so that vim.vim will get them automatically.
See email from Charles March 11 2020.
- "func" inside "vim9script" doesn't work? (Ben Jackson, #5670)
- Completion for :disassemble
- "echo Func()" is an error if Func() does not return anything.
- better implementation for partial and tests for that.
- Make "g:imported = Export.exported" work in Vim9 script.
- Make Foo.Bar() work to call the dict function. (#5676)
- make "let var: string" work in a vim9script.
@@ -84,7 +93,14 @@ Vim9 script:
LOADVARARG (varags idx)
Popup windows:
- popup_clear() and popup_close() should close the terminal popup, and
make the buffer hidden. #5745
- With terminal in popup, allow for popup_hide() to temporarily hide it.?
- With some sequence get get hidden finished terminal buffer. (#5768)
- Fire some autocommand event after a new popup window was created and
positioned? PopupNew? Could be used to set some options or move it out of
the way. (#5737)
However, it may also cause trouble, changing the popup of another plugin.
- Use popup (or popup menu) for command line completion
- When using a popup for the info of a completion menu, and there is not
enough space, let the popup overlap with the menu. (#4544)
@@ -98,7 +114,7 @@ Popup windows:
- Figure out the size and position better if wrapping inserts indent
Text properties:
- prop_find() may not find text property at start of the line. (#5663)
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
- Get E685 with a sequence of commands. (#5674)
- Combining text property with 'cursorline' does not always work (Billie
Cleek, #5533)
@@ -169,7 +185,7 @@ Terminal emulator window:
Error numbers available:
E451, E452, E453, E454, E460, E489, E491, E565, E578, E610, E611, E653,
E654, E856, E857, E860, E861, E900
E654, E856, E857, E861, E900
Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing.
@@ -178,10 +194,15 @@ Patch to use more FOR_ALL_ macros and use them. (Yegappan Lakshmanan, #5339)
Patch to explain use of "%" in :!. (David Briscoe, #5591)
Patch to improve Windows terminal support. (Nobuhiro Takasaki, #5546)
Ready to include.
Patch to add "-d" to xxd. (#5616)
Patch to add Turkish manual. (Emir Sarı, #5641)
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
Running test_gui and test_gui_init with Motif sometimes kills the window
manager. Problem with Motif? Now test_gui crashes in submenu_change().
Athena is OK.
@@ -193,24 +214,27 @@ Flag in 'formatoptions' is not used in the tests.
Patch to add 'vtp' option. (#5344)
Needs better docs. Is there a better name?
Patch for Haiku support. (Emir Sarı, #5605)
undo result wrong: Masato Nishihata, #4798
Patch for Template string: #4491. New pull: #4634
Ready to include? Review the code.
When 'lazyredraw' is set sometimes the title is not updated.
(Jason Franklin, 2020 Feb 3) Looks like a race condition.
Strange sequence of BufWipeout and BufNew events while doing omni-complete.
(Paul Jolly, #5656)
Get BufDelete without preceding BufNew. (Paul Jolly, #5694)
Later more requests for what to track.
Should we add new events that don't allow any buffer manipulation?
Really only for dealing with appearing and disappearing buffers, load and
unload.
BufWinenter event not fired when saving unnamed buffer. (Paul Jolly, #5655)
Another spurious BufDelete. (Dani Dickstein, #5701)
Patch to add function to return the text used in the quickfix window.
(Yegappan, #5465)
Patch for Template string: #4491. New pull: #4634
Implementation is too inefficient, avoid using lambda.
Patch to add readdirex() (Ken Takata, #5619)
Request to support <Cmd> in mappings, similar to how Neovim does this.
@@ -253,6 +277,12 @@ match, total matches). (#5631)
Patch to provide search stats in a variable, so that it can be used in the
statusline. (Fujiwara Takuya, #4446)
Patch for ambiguous width characters in libvterm on MS-Windows 10.
(Nobuhiro Takasaki, #4411)
behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
#5771)
":bnext" in a help buffer is supposed to go to the next help buffer, but it
goes to any buffer, and then :bnext skips help buffers, since they are
unlisted. (#4478)
@@ -310,6 +340,7 @@ Patch to add per-tabpage and per-window previous directory: "lcd -" and "tcd
Does not build with MinGW out of the box:
- _stat64 is not defined, need to use "struct stat" in vim.h
- WINVER conflict, should use 0x0600 by default?
- INT_MAX not defined: need to include <limits.h> in vim.h
Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
13, #2910) Can't reproduce?
@@ -436,9 +467,6 @@ with the first character (like what happens with a last line that doesn't
fit). Display "<<<" at the start of the first visible line (like "@@@" is
displayed in the last line). (Arseny Nasokin, #5154)
Patch for ambiguous width characters in libvterm on MS-Windows 10.
(Nobuhiro Takasaki, #4411)
Window size changes after closing a tab. (#4741)
Problem with colors in terminal window. (Jason Franklin, 2019 May 12)
+3 -2
View File
@@ -1,4 +1,4 @@
*usr_03.txt* For Vim version 8.2. Last change: 2019 Nov 21
*usr_03.txt* For Vim version 8.2. Last change: 2020 Feb 29
VIM USER MANUAL - by Bram Moolenaar
@@ -346,7 +346,8 @@ to find the first #include after the cursor: >
And then type "n" several times. You will move to each #include in the text.
You can also use a count if you know which match you want. Thus "3n" finds
the third match. Using a count with "/" doesn't work.
the third match. You can also use a count with "/": "4/the" goes to the
fourth match of "the".
The "?" command works like "/" but searches backwards: >
+12 -2
View File
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Feb 22
*vim9.txt* For Vim version 8.2. Last change: 2020 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -149,6 +149,12 @@ with `substitute(` this will use the function, prepend a colon to use the
command instead: >
:substitute(pattern (replacement (
Note that while variables need to be defined before they can be used,
functions can be called before being defined. This is required to be able
have cyclic dependencies between functions. It is slightly less efficient,
since the function has to be looked up by name. And a typo in the function
name will only be found when the call is executed.
No curly braces expansion ~
@@ -207,7 +213,7 @@ few exceptions.
blob non-empty
list non-empty (different from JavaScript)
dictionary non-empty (different from JavaScript)
funcref when not NULL
func when not NULL
partial when not NULL
special v:true
job when not NULL
@@ -275,6 +281,8 @@ script, then script-local variables must be accessed with the "s:" prefix.
*:disa* *:disassemble*
:disa[ssemble] {func} Show the instructions generated for {func}.
This is for debugging and testing.
Note that for command line completion of {func} you
can prepend "s:" to find script-local functions.
==============================================================================
@@ -293,6 +301,8 @@ The following builtin types are supported:
(a: type, b: type): type
job
channel
func
partial
Not supported yet:
tuple<a: type, b: type, ...>
+7 -2
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: YAML (YAML Ain't Markup Language)
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive)
" Last Change: 2020 Mar 02
if exists("b:did_ftplugin")
finish
@@ -16,5 +16,10 @@ let b:undo_ftplugin = "setl com< cms< et< fo<"
setlocal comments=:# commentstring=#\ %s expandtab
setlocal formatoptions-=t formatoptions+=croql
if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0
let b:undo_ftplugin ..= " sw< sts<"
setlocal shiftwidth=2 softtabstop=2
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+17 -3
View File
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2017-11-22
" Latest Revision: 2020-01-10
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -14,10 +14,24 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let b:undo_ftplugin = "setl com< cms< fo< "
if executable('zsh')
if !has('gui_running') && executable('less')
command! -buffer -nargs=1 RunHelp silent exe '!zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
elseif has('terminal')
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -ic "autoload -Uz run-help; run-help <args>"'
else
command! -buffer -nargs=1 RunHelp echo system('zsh -ic "autoload -Uz run-help; run-help <args> 2>/dev/null"')
endif
setlocal keywordprg=:RunHelp
setlocal makeprg=zsh\ -n\ --\ %:S
setlocal errorformat=%f:\ line\ %l:\ %m
let b:undo_ftplugin .= 'keywordprg< errorformat< makeprg<'
endif
let b:match_words = ',\<if\>:\<elif\>:\<else\>:\<fi\>'
\ . ',\<case\>:^\s*([^)]*):\<esac\>'
\ . ',\<\%(select\|while\|until\|repeat\|for\%(each\)\=\)\>:\<done\>'
+1 -1
View File
@@ -3,7 +3,7 @@
" Author: John Wellesz <John.wellesz (AT) gmail (DOT) com>
" URL: https://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2019 Jully 21st
" Last Change: 2020 Mar 05
" Version: 1.70
"
"
+3 -1
View File
@@ -1,6 +1,6 @@
" matchit.vim: (global plugin) Extended "%" matching
" autload script of matchit plugin, see ../plugin/matchit.vim
" Last Change: 2019 Oct 24
" Last Change: Mar 01, 2020
let s:last_mps = ""
let s:last_words = ":"
@@ -48,6 +48,8 @@ function matchit#Match_wrapper(word, forward, mode) range
execute "normal! gv\<Esc>"
elseif a:mode == "o" && mode(1) !~# '[vV]'
exe "norm! v"
elseif a:mode == "n" && mode(1) =~# 'ni'
exe "norm! v"
endif
" In s:CleanUp(), we may need to check whether the cursor moved forward.
let startpos = [line("."), col(".")]
+1 -1
View File
@@ -4,7 +4,7 @@ For instructions on installing this file, type
`:help matchit-install`
inside Vim.
For Vim version 8.1. Last change: 2019 Oct 24
For Vim version 8.1. Last change: 2020 Mar 01
VIM REFERENCE MANUAL by Benji Fisher et al
+1 -1
View File
@@ -1,6 +1,6 @@
" matchit.vim: (global plugin) Extended "%" matching
" Maintainer: Christian Brabandt
" Version: 1.16
" Version: 1.17
" Last Change: 2019 Oct 24
" Repository: https://github.com/chrisbra/matchit
" Previous URL:http://www.vim.org/script.php?script_id=39
+5 -1
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types in scripts
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2019 Jun 25
" Last change: 2020 Mar 06
" This file is called by an autocommand for every file that has just been
" loaded into a buffer. It checks if the type of file can be recognized by
@@ -376,6 +376,10 @@ else
elseif s:line1 =~? '-\*-.*erlang.*-\*-'
set ft=erlang
" YAML
elseif s:line1 =~# '^%YAML'
set ft=yaml
" CVS diff
else
let s:lnum = 1
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Bram Moolenaar (Bram@vim.org)
" Last Change: 2019 Nov 26
" Last Change: 2020 Mar 06
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -11,7 +11,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*[ \t]\+\*"me=e-1
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\)"
syn match helpSectionDelim "^===.*===$"
syn match helpSectionDelim "^---.*--$"
if has("conceal")
+31 -18
View File
@@ -3,7 +3,7 @@
" Maintainer: Roland Hieber <rohieb+vim-iR0jGdkV@rohieb.name>, <https://github.com/rohieb>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: https://github.com/vim/vim/blob/master/runtime/syntax/make.vim
" Last Change: 2020 Jan 15
" Last Change: 2020 Mar 04
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -13,22 +13,13 @@ endif
let s:cpo_save = &cpo
set cpo&vim
" some special characters
syn match makeSpecial "^\s*[@+-]\+"
syn match makeNextLine "\\\n\s*"
" some directives
syn match makePreCondit "^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)"
syn match makeInclude "^ *[-s]\=include\s.*$"
syn match makeStatement "^ *vpath"
syn match makeExport "^ *\(export\|unexport\)\>"
syn match makeOverride "^ *override"
hi link makeOverride makeStatement
hi link makeExport makeStatement
" catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend
syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$"
\ contains=makeStatement,makeIdent,makePreCondit,makeDefine
" Microsoft Makefile specials
syn case ignore
@@ -53,17 +44,36 @@ syn match makeConfig "@[A-Za-z0-9_]\+@"
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2
syn region makeTarget transparent matchgroup=makeTarget start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString skipnl nextGroup=makeCommands
syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment skipnl nextgroup=makeCommands,makeCommandError
syn region makeTarget transparent matchgroup=makeTarget
\ start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1
\ end=";"re=e-1,me=e-1 end="[^\\]$"
\ keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString
\ skipnl nextGroup=makeCommands
syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$"
\ contains=makeIdent,makeSpecTarget,makeComment
\ skipnl nextgroup=makeCommands,makeCommandError
syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent,makeComment skipnl nextgroup=makeCommands,makeCommandError
syn region makeSpecTarget transparent matchgroup=makeSpecTarget
\ start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1
\ end="[^\\]$" keepend
\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$"
\ contains=makeIdent,makeComment
\ skipnl nextgroup=makeCommands,makeCommandError
syn match makeCommandError "^\s\+\S.*" contained
syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
syn region makeCommands contained start=";"hs=s+1 start="^\t"
\ end="^[^\t#]"me=e-1,re=e-1 end="^$"
\ contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString
\ nextgroup=makeCommandError
syn match makeCmdNextLine "\\\n."he=e-1 contained
" some directives
syn match makePreCondit "^ *\(ifn\=\(eq\|def\)\>\|else\(\s\+ifn\=\(eq\|def\)\)\=\>\|endif\>\)"
syn match makeInclude "^ *[-s]\=include\s.*$"
syn match makeStatement "^ *vpath"
syn match makeExport "^ *\(export\|unexport\)\>"
syn match makeOverride "^ *override"
" Statements / Functions (GNU make)
syn match makeStatement contained "(\(abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|file\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|guile\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|subst\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
@@ -103,6 +113,9 @@ syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Z
hi def link makeNextLine makeSpecial
hi def link makeCmdNextLine makeSpecial
hi link makeOverride makeStatement
hi link makeExport makeStatement
hi def link makeSpecTarget Statement
if !exists("make_no_commands")
hi def link makeCommands Number
+46 -16
View File
@@ -2,14 +2,19 @@
" Language: resolver configuration file
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
" URL: https://raw.github.com/rid9/vim-resolv/master/resolv.vim
" Last Change: 2020 Feb 15
" By: DJ Lucas
" Version: 1.1
" Last Change: 2020 Mar 10
" Version: 1.4
"
" Credits:
" David Necas (Yeti) <yeti@physics.muni.cz>
" Stefano Zacchiroli <zack@debian.org>
" DJ Lucas <dj@linuxfromscratch.org>
"
" Changelog:
" - 1.4: Added IPv6 support for sortlist.
" - 1.3: Added IPv6 support for IPv4 dot-decimal notation.
" - 1.2: Added new options.
" - 1.1: Added IPv6 support.
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -31,20 +36,47 @@ syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPClu
syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/
" Particular
" Nameserver IPv4
syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{6}\(\x\{1,4}:\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\s\@<=::\(\(\x\{1,4}:\)\{,6}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{1}:\(\(\x\{1,4}:\)\{,5}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{2}:\(\(\x\{1,4}:\)\{,4}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{3}:\(\(\x\{1,4}:\)\{,3}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{4}:\(\(\x\{1,4}:\)\{,2}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{5}:\(\(\x\{1,4}:\)\{,1}\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{6}:\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\(\x\{1,4}:\)\{1,7}:\(\s\|;\|$\)\@=/
" Nameserver IPv6
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{6}\%(\x\{1,4}:\x\{1,4}\)\>/
syn match resolvIPNameserver contained /\s\@<=::\%(\x\{1,4}:\)\{,6}\x\{1,4}\>/
syn match resolvIPNameserver contained /\s\@<=::\%(\x\{1,4}:\)\{,5}\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{1}:\%(\x\{1,4}:\)\{,5}\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{1}:\%(\x\{1,4}:\)\{,4}\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{2}:\%(\x\{1,4}:\)\{,4}\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{2}:\%(\x\{1,4}:\)\{,3}\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{3}:\%(\x\{1,4}:\)\{,3}\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{3}:\%(\x\{1,4}:\)\{,2}\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{4}:\%(\x\{1,4}:\)\{,2}\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{4}:\%(\x\{1,4}:\)\{,1}\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{5}:\%(\d\{1,4}\.\)\{3}\d\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{6}:\x\{1,4}\>/
syn match resolvIPNameserver contained /\<\%(\x\{1,4}:\)\{1,7}:\%(\s\|;\|$\)\@=/
" Search hostname
syn match resolvHostnameSearch contained /\%(\%([-0-9A-Za-z_]\+\.\)*[-0-9A-Za-z_]\+\.\?\%(\s\|$\)\)\+/
" Sortlist IPv4
syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?\%(\s\|$\)\)\+/ contains=resolvOperator,@resolvIPCluster
" Sortlist IPv6
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{6}\%(\x\{1,4}:\x\{1,4}\)\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\s\@<=::\%(\x\{1,4}:\)\{,6}\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\s\@<=::\%(\x\{1,4}:\)\{,5}\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{1}:\%(\x\{1,4}:\)\{,5}\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{1}:\%(\x\{1,4}:\)\{,4}\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{2}:\%(\x\{1,4}:\)\{,4}\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{2}:\%(\x\{1,4}:\)\{,3}\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{3}:\%(\x\{1,4}:\)\{,3}\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{3}:\%(\x\{1,4}:\)\{,2}\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{4}:\%(\x\{1,4}:\)\{,2}\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{4}:\%(\x\{1,4}:\)\{,1}\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{5}:\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{6}:\x\{1,4}\%(\/\d\{1,3}\)\?\>/
syn match resolvIPNetmaskSortList contained /\<\%(\x\{1,4}:\)\{1,7}:\%(\s\|;\|$\)\@=\%(\/\d\{1,3}\)\?/
" Identifiers
syn match resolvNameserver /^\s*nameserver\>/ nextgroup=resolvIPNameserver skipwhite
syn match resolvLwserver /^\s*lwserver\>/ nextgroup=resolvIPNameserver skipwhite
@@ -54,13 +86,12 @@ syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skip
syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite
" Options
syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite
syn match resolvOption /\<\%(debug\|no_tld_query\|no-tld-query\|rotate\|no-check-names\|inet6\|ip6-bytestring\|\%(no-\)\?ip6-dotint\|edns0\|single-request\%(-reopen\)\?\|use-vc\)\>/ contained nextgroup=resolvOption skipwhite
syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite
" Additional errors
syn match resolvError /^search .\{257,}/
hi def link resolvIP Number
hi def link resolvIPNetmask Number
hi def link resolvHostname String
@@ -83,7 +114,6 @@ hi def link resolvError Error
hi def link resolvIPError Error
hi def link resolvIPSpecial Special
let b:current_syntax = "resolv"
" vim: ts=8 ft=vim
+31 -31
View File
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 8.0 script
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Last Change: November 29, 2019
" Version: 8.0-29
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: March 11, 2020
" Version: 8.0-30
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -19,35 +19,35 @@ 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] ba[ll] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletl dep diffpu[t] dl dr[op] ec em[enu] ene[w] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] 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] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tch[dir] tf[irst] tlmenu tm[enu] to[pleft] tu[nmenu] undol[ist] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] cle[arjumps] cnor comp[iler] cpf[ile] cun delc[ommand] deletp di[splay] diffs[plit] dli[st] ds[earch] echoe[rr] en[dif] eval filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] messages mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] 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 sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs tcld[o] th[row] tln tma[p] tp[revious] tunma[p] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do dsp[lit] echom[sg] endf[unction] ex filetype fix[del] for gui helpg[rep] ia in j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] 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 srl star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tclf[ile] tj[ump] tlnoremenu tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
syn keyword vimCommand contained abo[veleft] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delep dell diffg[et] dig[raphs] doau e[dit] echon endfo[r] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] inor ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] 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 srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] te[aroff] tl[ast] tlu tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
syn keyword vimCommand contained addd arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cn[ext] colo[rscheme] cons[t] cs d[elete] deletel delm[arks] diffo[ff] dir doaut ea el[se] endt[ry] exu[sage] fin[d] foldc[lose] g h[elp] hi if intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 python3 qa[ll] redr[aw] retu[rn] 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] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcd ter[minal] tlm tlunmenu tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] com cope[n] cscope debug deletep delp diffp[atch] dj[ump] dp earlier elsei[f] endw[hile] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do 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]
syn keyword vimCommand contained a ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletl dep diffpu[t] dl dr[op] ec em[enu] ene[w] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes 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 st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tch[dir] tf[irst] tlmenu tm[enu] to[pleft] tu[nmenu] undol[ist] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
syn keyword vimCommand contained ab arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] cle[arjumps] cnor comp[iler] cpf[ile] cun delc[ommand] deletp di[splay] diffs[plit] dli[st] ds[earch] echoe[rr] en[dif] eval filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] messages 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 sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs tcld[o] th[row] tln tma[p] tp[revious] tunma[p] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
syn keyword vimCommand contained abc[lear] argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do dsp[lit] echom[sg] endf[unction] ex filetype fix[del] for gui helpg[rep] ia in j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] 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 star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tclf[ile] tj[ump] tlnoremenu tmapc[lear] tr[ewind] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
syn keyword vimCommand contained abo[veleft] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delep dell diffg[et] dig[raphs] doau e[dit] echon endfo[r] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] inor ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks 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 startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] te[aroff] tl[ast] tlu tn[ext] try una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
syn keyword vimCommand contained addd arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cn[ext] colo[rscheme] cons[t] cs d[elete] deletel delm[arks] diffo[ff] dir doaut ea el[se] endt[ry] exu[sage] fin[d] foldc[lose] g h[elp] hi if intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] 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 startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcd ter[minal] tlm tlunmenu tno[remap] ts[elect] undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] com cope[n] cscope debug deletep delp diffp[atch] dj[ump] dp earlier elsei[f] endw[hile] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] 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]
syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimCommand contained def endd[ef] disa[ssemble] vim9[script] imp[ort] exp[ort]
syn keyword vimStdPlugin contained Arguments Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome redrawtime ri rs runtimepath scr sect sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx regexpengine rightleft rtp sb scroll sections sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion relativenumber rightleftcmd ru sbo scrollbind secure shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe remap rl rubydll sbr scrolljump sel shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw quoteescape renderoptions rlc ruf sc scrolloff selection shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll rdt report rnu ruler scb scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome redrawtime ri rs sb scroll sect sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx regexpengine rightleft rtp sbo scrollbind sections sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion relativenumber rightleftcmd ru sbr scrollfocus secure shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe remap rl rubydll sc scrolljump sel shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw quoteescape renderoptions rlc ruf scb scrolloff selection shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll rdt report rnu ruler scf scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome re restorescreen ro rulerformat scl scs sessionoptions shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll readonly revins rop
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll readonly revins rop runtimepath scr
" vimOptions: These are the turn-off setting variants {{{2
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread 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 noma nomagic noml nomod nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd 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
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir 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 nomacatsui nomh nomle nomodeline nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab 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 noakm noanti noarab noari noautoindent 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
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread 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 nomod nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd 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
syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir 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 nomodeline nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscf noscrollfocus nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab 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 noakm noanti noarab noari noautoindent 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
" vimOptions: These are the invertible variants {{{2
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread 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 invma invmagic invml invmod invmodelineexpr invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd 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
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir 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 invmacatsui invmh invmle invmodeline invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab 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 invakm invanti invarab invari invautoindent 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
syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread 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 invmod invmodelineexpr invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscrollbind invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd 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
syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir 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 invmodeline invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscf invscrollfocus invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab 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 invakm invanti invarab invari invautoindent 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
" termcap codes (which can also be set) {{{2
syn keyword vimOption contained t_8b t_AB t_al t_bc t_BE t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_EI t_F2 t_F4 t_F6 t_F8 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_KE t_KF t_KG t_kh t_KH t_kI 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_ut t_vb t_ve t_vi t_vs t_VS t_WP t_WS t_xn t_xs t_ZH t_ZR
@@ -67,8 +67,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 BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd
syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre
" 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,11 +79,11 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isinf job_info join keys line2byte listener_remove map matchaddpos matchstr mode pathshorten popup_close popup_findinfo popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval reg_executing remote_expr remote_startserver reverse screenchars search server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2list strdisplaywidth string strtrans swapinfo synIDattr systemlist tagfiles tempname term_getaltscreen term_getjob term_getstatus term_scrape term_setkill term_wait test_garbagecollect_now test_null_blob test_null_list test_override test_settime timer_stop tr undofile virtcol wincol win_gotoid winlayout winrestview winwidth
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getpos gettabvar getwinposx globpath histadd hlID input inputsecret islocked job_setoptions js_decode len lispindent localtime maparg matcharg matchstrpos mzeval perleval popup_create popup_findpreview popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval reg_recording remote_foreground remove round screencol searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2nr strftime strlen strwidth swapname synIDtrans tabpagebuflist taglist term_dumpdiff term_getansicolors term_getline term_gettitle term_sendkeys term_setrestore test_alloc_fail test_garbagecollect_soon test_null_channel test_null_partial test_refcount timer_info timer_stopall trim undotree visualmode win_execute winheight winline winsaveview wordcount
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert isnan job_start js_encode libcall list2str log mapcheck matchdelete max nextnonblank popup_atcursor popup_dialog popup_getoptions popup_notification prevnonblank prop_add prop_type_add pum_getpos range reltime remote_peek rename rubyeval screenpos searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt strcharpart strgetchar strpart submatch synconcealed synstack tabpagenr tan term_dumpload term_getattr term_getscrolled term_gettty term_setansicolors term_setsize test_autochdir test_getvalue test_null_dict test_null_string test_scrollbar timer_pause tolower trunc uniq wildmenumode win_findbuf win_id2tabwin winnr win_screenpos writefile
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getreg gettagstack getwinvar has_key histget iconv inputlist invert items job_status json_decode libcallnr listener_add log10 match matchend min nr2char popup_beval popup_filter_menu popup_getpos popup_setoptions printf prop_clear prop_type_change pumvisible readdir reltimefloat remote_read repeat screenattr screenrow searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop state strchars stridx strridx substitute synID system tabpagewinnr tanh term_dumpwrite term_getcursor term_getsize term_list term_setapi term_start test_feedinput test_ignore_error test_null_job test_option_not_set test_setmouse timer_start toupper type values winbufnr win_getid win_id2win winrestcmd win_splitmove xor
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmatches getregtype getwininfo glob haslocaldir histnr indent inputrestore isdirectory job_getchannel job_stop json_encode line listener_flush luaeval matchadd matchlist mkdir or popup_clear popup_filter_yesno popup_hide popup_settext prompt_setcallback prop_find prop_type_delete py3eval readfile reltimestr remote_send resolve screenchar screenstring searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword str2float
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmatches getreg gettagstack getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchdelete max nextnonblank popup_atcursor popup_dialog popup_getoptions popup_notification prevnonblank prop_add prop_type_add pum_getpos rand reg_recording remote_foreground remove round screencol searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2list strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_sendkeys term_setsize test_autochdir test_getvalue test_null_dict test_null_string test_scrollbar test_unknown timer_start toupper type values winbufnr win_findbuf winheight winline winsaveview winwidth
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete echoraw eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getmousepos getregtype getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 match matchend min nr2char popup_beval popup_filter_menu popup_getpos popup_setoptions printf prop_clear prop_type_change pumvisible range reltime remote_peek rename rubyeval screenpos searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt str2nr strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_setansicolors term_start test_feedinput test_ignore_error test_null_job test_option_not_set test_setmouse test_void timer_stop tr undofile virtcol wincol win_getid win_id2tabwin winnr win_screenpos wordcount
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval matchadd matchlist mkdir or popup_clear popup_filter_yesno popup_hide popup_settext prompt_setcallback prop_find prop_type_delete py3eval readdir reltimefloat remote_read repeat screenattr screenrow searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop srand strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setapi term_wait test_garbagecollect_now test_null_blob test_null_list test_override test_settime timer_info timer_stopall trim undotree visualmode windowsversion win_gettype win_id2win winrestcmd win_splitmove writefile
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getpos gettabvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map matchaddpos matchstr mode pathshorten popup_close popup_findinfo popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval readfile reltimestr remote_send resolve screenchar screenstring searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword state strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled term_list term_setkill test_alloc_fail test_garbagecollect_soon test_null_channel test_null_partial test_refcount test_srand_seed timer_pause tolower trunc uniq wildmenumode win_execute win_gotoid winlayout winrestview win_type xor
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matcharg matchstrpos mzeval perleval popup_create popup_findpreview popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval reg_executing remote_expr remote_startserver reverse screenchars search server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2float strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_scrape term_setrestore
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
@@ -241,9 +241,9 @@ syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,
syn match vimFunction "\<\(fu\%[nction]\|def\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
else
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
endif
syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
syn match vimFuncSID contained "\c<sid>\|\<s:"
+38 -15
View File
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2018-07-13
" Latest Revision: 2020-01-23
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -13,11 +13,30 @@ endif
let s:cpo_save = &cpo
set cpo&vim
if v:version > 704 || (v:version == 704 && has("patch1142"))
syn iskeyword @,48-57,_,192-255,#,-
else
setlocal iskeyword+=-
endif
function! s:ContainedGroup()
" needs 7.4.2008 for execute() function
let result='TOP'
" vim-pandoc syntax defines the @langname cluster for embedded syntax languages
" However, if no syntax is defined yet, `syn list @zsh` will return
" "No syntax items defined", so make sure the result is actually a valid syn cluster
for cluster in ['markdownHighlightzsh', 'zsh']
try
" markdown syntax defines embedded clusters as @markdownhighlight<lang>,
" pandoc just uses @<lang>, so check both for both clusters
let a=split(execute('syn list @'. cluster), "\n")
if len(a) == 2 && a[0] =~# '^---' && a[1] =~? cluster
return '@'. cluster
endif
catch /E392/
" ignore
endtry
endfor
return result
endfunction
let s:contained=s:ContainedGroup()
syn iskeyword @,48-57,_,192-255,#,-
if get(g:, 'zsh_fold_enable', 0)
setlocal foldmethod=syntax
endif
@@ -32,13 +51,16 @@ syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!'
syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
syn match zshPOSIXQuoted '\\[xX][0-9a-fA-F]\{1,2}'
syn match zshPOSIXQuoted '\\[0-7]\{1,3}'
syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}'
syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}'
syn match zshQuoted '\\.'
syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+
\ contains=zshQuoted,@zshDerefs,@zshSubst fold
syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold
" XXX: This should probably be more precise, but Zsh seems a bit confused about it itself
syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+
\ end=+'+ contains=zshQuoted
\ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted
syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)'
syn keyword zshPrecommand noglob nocorrect exec command builtin - time
@@ -342,22 +364,22 @@ syn match zshNumber '[+-]\=\d\+\.\d\+\>'
" TODO: $[...] is the same as $((...)), so add that as well.
syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst
syn region zshSubst matchgroup=zshSubstDelim transparent
\ start='\$(' skip='\\)' end=')' contains=TOP fold
exe 'syn region zshSubst matchgroup=zshSubstDelim transparent start=/\$(/ skip=/\\)/ end=/)/ contains='.s:contained. ' fold'
syn region zshParentheses transparent start='(' skip='\\)' end=')' fold
syn region zshGlob start='(#' end=')'
syn region zshMathSubst matchgroup=zshSubstDelim transparent
\ start='\$((' skip='\\)' end='))'
\ contains=zshParentheses,@zshSubst,zshNumber,
\ @zshDerefs,zshString keepend fold
syn region zshBrackets contained transparent start='{' skip='\\}'
" The ms=s+1 prevents matching zshBrackets several times on opening brackets
" (see https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-576330348)
syn region zshBrackets contained transparent start='{'ms=s+1 skip='\\}'
\ end='}' fold
syn region zshBrackets transparent start='{' skip='\\}'
\ end='}' contains=TOP fold
exe 'syn region zshBrackets transparent start=/{/ms=s+1 skip=/\\}/ end=/}/ contains='.s:contained. ' fold'
syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
\ end='}' contains=@zshSubst,zshBrackets,zshQuoted,zshString fold
syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+
\ end=+`+ contains=TOP,zshOldSubst fold
exe 'syn region zshOldSubst matchgroup=zshSubstDelim start=/`/ skip=/\\[\\`]/ end=/`/ contains='.s:contained. ',zshOldSubst fold'
syn sync minlines=50 maxlines=90
syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)'
@@ -367,6 +389,7 @@ hi def link zshTodo Todo
hi def link zshComment Comment
hi def link zshPreProc PreProc
hi def link zshQuoted SpecialChar
hi def link zshPOSIXQuoted SpecialChar
hi def link zshString String
hi def link zshStringDelimiter zshString
hi def link zshPOSIXString zshString
+8
View File
@@ -508,6 +508,7 @@ close_buffer(
int wipe_buf = (action == DOBUF_WIPE || action == DOBUF_WIPE_REUSE);
int del_buf = (action == DOBUF_DEL || wipe_buf);
CHECK_CURBUF;
/*
* Force unloading or deleting when 'bufhidden' says so.
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
@@ -530,6 +531,7 @@ close_buffer(
#ifdef FEAT_TERMINAL
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
{
CHECK_CURBUF;
if (term_job_running(buf->b_term))
{
if (wipe_buf || unload_buf)
@@ -554,6 +556,7 @@ close_buffer(
unload_buf = TRUE;
wipe_buf = TRUE;
}
CHECK_CURBUF;
}
#endif
@@ -747,6 +750,7 @@ aucmd_abort:
if (del_buf)
buf->b_p_bl = FALSE;
}
// NOTE: at this point "curbuf" may be invalid!
}
/*
@@ -937,7 +941,11 @@ free_buffer(buf_T *buf)
au_pending_free_buf = buf;
}
else
{
vim_free(buf);
if (curbuf == buf)
curbuf = NULL; // make clear it's not to be used
}
}
/*
+1 -1
View File
@@ -1301,7 +1301,7 @@ del_bytes(
#endif
// mark the buffer as changed and prepare for displaying
inserted_bytes(lnum, curwin->w_cursor.col, -count);
inserted_bytes(lnum, col, -count);
return OK;
}
+14
View File
@@ -1550,6 +1550,7 @@ set_one_cmd_context(
case CMD_function:
case CMD_delfunction:
case CMD_disassemble:
xp->xp_context = EXPAND_USER_FUNC;
xp->xp_pattern = arg;
break;
@@ -1987,6 +1988,7 @@ ExpandFromContext(
regmatch_T regmatch;
int ret;
int flags;
char_u *tofree = NULL;
flags = EW_DIR; // include directories
if (options & WILD_LIST_NOTFOUND)
@@ -2124,6 +2126,17 @@ ExpandFromContext(
if (xp->xp_context == EXPAND_PACKADD)
return ExpandPackAddDir(pat, num_file, file);
// When expanding a function name starting with s:, match the <SNR>nr_
// prefix.
if (xp->xp_context == EXPAND_USER_FUNC && STRNCMP(pat, "^s:", 3) == 0)
{
int len = (int)STRLEN(pat) + 20;
tofree = alloc(len);
vim_snprintf((char *)tofree, len, "^<SNR>\\d\\+_%s", pat + 3);
pat = tofree;
}
regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
if (regmatch.regprog == NULL)
return FAIL;
@@ -2216,6 +2229,7 @@ ExpandFromContext(
}
vim_regfree(regmatch.regprog);
vim_free(tofree);
return ret;
}
+32 -17
View File
@@ -69,6 +69,9 @@ static void win_update(win_T *wp);
#ifdef FEAT_STL_OPT
static void redraw_custom_statusline(win_T *wp);
#endif
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
static int did_update_one_window;
#endif
/*
* Based on the current value of curwin->w_topline, transfer a screenfull
@@ -81,10 +84,8 @@ update_screen(int type_arg)
int type = type_arg;
win_T *wp;
static int did_intro = FALSE;
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
int did_one;
#endif
#ifdef FEAT_GUI
int did_one = FALSE;
int did_undraw = FALSE;
int gui_cursor_col = 0;
int gui_cursor_row = 0;
@@ -276,7 +277,7 @@ update_screen(int type_arg)
// Go from top to bottom through the windows, redrawing the ones that need
// it.
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
did_one = FALSE;
did_update_one_window = FALSE;
#endif
#ifdef FEAT_SEARCH_EXTRA
screen_search_hl.rm.regprog = NULL;
@@ -286,21 +287,11 @@ update_screen(int type_arg)
if (wp->w_redr_type != 0)
{
cursor_off();
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
#ifdef FEAT_GUI
if (!did_one)
{
did_one = TRUE;
# ifdef FEAT_SEARCH_EXTRA
start_search_hl();
# endif
# ifdef FEAT_CLIPBOARD
// When Visual area changed, may have to update selection.
if (clip_star.available && clip_isautosel_star())
clip_update_selection(&clip_star);
if (clip_plus.available && clip_isautosel_plus())
clip_update_selection(&clip_plus);
# endif
#ifdef FEAT_GUI
// Remove the cursor before starting to do anything, because
// scrolling may make it difficult to redraw the text under
// it.
@@ -311,9 +302,9 @@ update_screen(int type_arg)
gui_undraw_cursor();
did_undraw = TRUE;
}
#endif
}
#endif
win_update(wp);
}
@@ -1422,6 +1413,25 @@ win_update(win_T *wp)
proftime_T syntax_tm;
#endif
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
// This needs to be done only for the first window when update_screen() is
// called.
if (!did_update_one_window)
{
did_update_one_window = TRUE;
# ifdef FEAT_SEARCH_EXTRA
start_search_hl();
# endif
# ifdef FEAT_CLIPBOARD
// When Visual area changed, may have to update selection.
if (clip_star.available && clip_isautosel_star())
clip_update_selection(&clip_star);
if (clip_plus.available && clip_isautosel_plus())
clip_update_selection(&clip_plus);
# endif
}
#endif
type = wp->w_redr_type;
if (type == NOT_VALID)
@@ -3029,6 +3039,11 @@ redraw_buf_later(buf_T *buf, int type)
if (wp->w_buffer == buf)
redraw_win_later(wp, type);
}
#if defined(FEAT_TERMINAL) && defined(FEAT_PROP_POPUP)
// terminal in popup window is not in list of windows
if (curwin->w_buffer == buf)
redraw_win_later(curwin, type);
#endif
}
#if defined(FEAT_SIGNS) || defined(PROTO)
+4
View File
@@ -1621,6 +1621,10 @@ decodeModifyOtherKeys(int c)
// Match, consume the code.
typebuf.tb_off += idx + 1;
typebuf.tb_len -= idx + 1;
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
if (typebuf.tb_len == 0)
typebuf_was_filled = FALSE;
#endif
mod_mask = decode_modifiers(arg[!form]);
c = merge_modifyOtherKeys(arg[form]);
+8 -6
View File
@@ -1491,6 +1491,8 @@ next_for_item(void *fi_void, char_u *arg)
{
forinfo_T *fi = (forinfo_T *)fi_void;
int result;
int flag = current_sctx.sc_version == SCRIPT_VERSION_VIM9 ?
LET_NO_COMMAND : 0;
listitem_T *item;
if (fi->fi_blob != NULL)
@@ -1504,7 +1506,7 @@ next_for_item(void *fi_void, char_u *arg)
tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi);
++fi->fi_bi;
return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
fi->fi_varcount, 0, NULL) == OK;
fi->fi_varcount, flag, NULL) == OK;
}
item = fi->fi_lw.lw_item;
@@ -1514,7 +1516,7 @@ next_for_item(void *fi_void, char_u *arg)
{
fi->fi_lw.lw_item = item->li_next;
result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon,
fi->fi_varcount, 0, NULL) == OK);
fi->fi_varcount, flag, NULL) == OK);
}
return result;
}
@@ -5560,7 +5562,7 @@ tv_get_number_chk(typval_T *varp, int *denote)
break;
case VAR_UNKNOWN:
case VAR_VOID:
internal_error("tv_get_number(UNKNOWN)");
internal_error_no_abort("tv_get_number(UNKNOWN)");
break;
}
if (denote == NULL) // useful for values that must be unsigned
@@ -5614,7 +5616,7 @@ tv_get_float(typval_T *varp)
break;
case VAR_UNKNOWN:
case VAR_VOID:
internal_error("tv_get_float(UNKNOWN)");
internal_error_no_abort("tv_get_float(UNKNOWN)");
break;
}
return 0;
@@ -5886,7 +5888,7 @@ copy_tv(typval_T *from, typval_T *to)
break;
case VAR_UNKNOWN:
case VAR_VOID:
internal_error("copy_tv(UNKNOWN)");
internal_error_no_abort("copy_tv(UNKNOWN)");
break;
}
}
@@ -5965,7 +5967,7 @@ item_copy(
break;
case VAR_UNKNOWN:
case VAR_VOID:
internal_error("item_copy(UNKNOWN)");
internal_error_no_abort("item_copy(UNKNOWN)");
ret = FAIL;
}
--recurse;
+6
View File
@@ -752,6 +752,12 @@ f_getbufline(typval_T *argvars, typval_T *rettv)
get_buffer_lines(buf, lnum, end, TRUE, rettv);
}
type_T *
ret_f_getline(int argcount, type_T **argtypes UNUSED)
{
return argcount == 1 ? &t_string : &t_list_string;
}
/*
* "getline(lnum, [end])" function
*/
+591 -499
View File
File diff suppressed because it is too large Load Diff
+12 -5
View File
@@ -2543,8 +2543,10 @@ find_var_ht(char_u *name, char_u **varname)
return &curtab->tp_vars->dv_hashtab;
if (*name == 'v') // v: variable
return &vimvarht;
if (current_sctx.sc_version != SCRIPT_VERSION_VIM9)
if (get_current_funccal() != NULL
&& get_current_funccal()->func->uf_dfunc_idx < 0)
{
// a: and l: are only used in functions defined with ":function"
if (*name == 'a') // a: function argument
return get_funccal_args_ht();
if (*name == 'l') // l: local function variable
@@ -3643,7 +3645,8 @@ f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
callback_T
get_callback(typval_T *arg)
{
callback_T res;
callback_T res;
int r = OK;
res.cb_free_name = FALSE;
if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL)
@@ -3655,17 +3658,21 @@ get_callback(typval_T *arg)
else
{
res.cb_partial = NULL;
if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
if (arg->v_type == VAR_STRING && arg->vval.v_string != NULL
&& isdigit(*arg->vval.v_string))
r = FAIL;
else if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
{
// Note that we don't make a copy of the string.
res.cb_name = arg->vval.v_string;
func_ref(res.cb_name);
}
else if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0)
{
res.cb_name = (char_u *)"";
}
else
r = FAIL;
if (r == FAIL)
{
emsg(_("E921: Invalid callback argument"));
res.cb_name = NULL;
+4
View File
@@ -2363,6 +2363,7 @@ do_one_cmd(
case CMD_finally:
case CMD_endtry:
case CMD_function:
case CMD_def:
break;
// Commands that handle '|' themselves. Check: A command should
@@ -7901,6 +7902,9 @@ ex_pedit(exarg_T *eap)
{
win_T *curwin_save = curwin;
if (ERROR_IF_ANY_POPUP_WINDOW)
return;
// Open the preview window or popup and make it the current window.
g_do_tagpreview = p_pvh;
prepare_tagpreview(TRUE, TRUE, FALSE);
+20 -21
View File
@@ -421,6 +421,10 @@ flush_buffers(flush_buffers_T flush_typeahead)
// remove mapped characters at the start only
typebuf.tb_off += typebuf.tb_maplen;
typebuf.tb_len -= typebuf.tb_maplen;
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
if (typebuf.tb_len == 0)
typebuf_was_filled = FALSE;
#endif
}
else
{
@@ -1283,6 +1287,9 @@ alloc_typebuf(void)
typebuf.tb_no_abbr_cnt = 0;
if (++typebuf.tb_change_cnt == 0)
typebuf.tb_change_cnt = 1;
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
typebuf_was_filled = FALSE;
#endif
return OK;
}
@@ -1623,7 +1630,7 @@ vgetc(void)
// Get two extra bytes for special keys
if (c == K_SPECIAL
#ifdef FEAT_GUI
|| (gui.in_use && c == CSI)
|| (c == CSI)
#endif
)
{
@@ -1678,23 +1685,19 @@ vgetc(void)
}
#endif
#ifdef FEAT_GUI
if (gui.in_use)
// Handle focus event here, so that the caller doesn't need to
// know about it. Return K_IGNORE so that we loop once (needed
// if 'lazyredraw' is set).
if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
{
// Handle focus event here, so that the caller doesn't
// need to know about it. Return K_IGNORE so that we loop
// once (needed if 'lazyredraw' is set).
if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
{
ui_focus_change(c == K_FOCUSGAINED);
c = K_IGNORE;
}
// Translate K_CSI to CSI. The special key is only used
// to avoid it being recognized as the start of a special
// key.
if (c == K_CSI)
c = CSI;
ui_focus_change(c == K_FOCUSGAINED);
c = K_IGNORE;
}
// Translate K_CSI to CSI. The special key is only used to
// avoid it being recognized as the start of a special key.
if (c == K_CSI)
c = CSI;
#endif
}
// a keypad or special function key was not mapped, use it like
@@ -1772,11 +1775,7 @@ vgetc(void)
buf[i] = vgetorpeek(TRUE);
if (buf[i] == K_SPECIAL
#ifdef FEAT_GUI
|| (
# ifdef VIMDLL
gui.in_use &&
# endif
buf[i] == CSI)
|| (buf[i] == CSI)
#endif
)
{
-1
View File
@@ -603,7 +603,6 @@ static struct
static inline void
py3__Py_DECREF(const char *filename UNUSED, int lineno UNUSED, PyObject *op)
{
_Py_DEC_REFTOTAL;
if (--op->ob_refcnt != 0)
{
# ifdef Py_REF_DEBUG
+1 -1
View File
@@ -352,7 +352,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
#endif
case VAR_UNKNOWN:
case VAR_VOID:
internal_error("json_encode_item()");
internal_error_no_abort("json_encode_item()");
return FAIL;
}
return OK;
+5
View File
@@ -344,9 +344,11 @@
// Give an error in curwin is a popup window and evaluate to TRUE.
#ifdef FEAT_PROP_POPUP
# define WIN_IS_POPUP(wp) ((wp)->w_popup_flags != 0)
# define ERROR_IF_POPUP_WINDOW error_if_popup_window(FALSE)
# define ERROR_IF_ANY_POPUP_WINDOW error_if_popup_window(TRUE)
#else
# define WIN_IS_POPUP(wp) 0
# define ERROR_IF_POPUP_WINDOW 0
# define ERROR_IF_ANY_POPUP_WINDOW 0
#endif
@@ -362,8 +364,11 @@
# define ESTACK_CHECK_SETUP estack_len_before = exestack.ga_len;
# define ESTACK_CHECK_NOW if (estack_len_before != exestack.ga_len) \
siemsg("Exestack length expected: %d, actual: %d", estack_len_before, exestack.ga_len);
# define CHECK_CURBUF if (curwin != NULL && curwin->w_buffer != curbuf) \
iemsg("curbuf != curwin->w_buffer")
#else
# define ESTACK_CHECK_DECLARATION
# define ESTACK_CHECK_SETUP
# define ESTACK_CHECK_NOW
# define CHECK_CURBUF
#endif
+22 -4
View File
@@ -838,6 +838,16 @@ internal_error(char *where)
siemsg(_(e_intern2), where);
}
/*
* Like internal_error() but do not call abort(), to avoid tests using
* test_unknown() and test_void() causing Vim to exit.
*/
void
internal_error_no_abort(char *where)
{
semsg(_(e_intern2), where);
}
// emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes.
void
@@ -4717,9 +4727,13 @@ vim_vsnprintf_typval(
// signed
switch (length_modifier)
{
case '\0':
case '\0': str_arg_l += sprintf(
tmp + str_arg_l, f,
int_arg);
break;
case 'h': str_arg_l += sprintf(
tmp + str_arg_l, f, int_arg);
tmp + str_arg_l, f,
(short)int_arg);
break;
case 'l': str_arg_l += sprintf(
tmp + str_arg_l, f, long_arg);
@@ -4734,9 +4748,13 @@ vim_vsnprintf_typval(
// unsigned
switch (length_modifier)
{
case '\0':
case '\0': str_arg_l += sprintf(
tmp + str_arg_l, f,
uint_arg);
break;
case 'h': str_arg_l += sprintf(
tmp + str_arg_l, f, uint_arg);
tmp + str_arg_l, f,
(unsigned short)uint_arg);
break;
case 'l': str_arg_l += sprintf(
tmp + str_arg_l, f, ulong_arg);
+7
View File
@@ -1203,6 +1203,13 @@ curs_columns(
&& !pum_visible())
redraw_later(SOME_VALID);
#endif
#if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
if (popup_is_popup(curwin) && curbuf->b_term != NULL)
{
curwin->w_wrow += popup_top_extra(curwin);
curwin->w_wcol += popup_left_extra(curwin);
}
#endif
// now w_leftcol is valid, avoid check_cursor_moved() thinking otherwise
curwin->w_valid_leftcol = curwin->w_leftcol;
+31 -5
View File
@@ -1782,7 +1782,13 @@ mch_inchar(
int len;
int c;
# define TYPEAHEADLEN 20
# ifdef VIMDLL
// Extra space for maximum three CSIs. E.g. U+1B6DB -> 0xF0 0x9B 0x9B 0x9B.
# define TYPEAHEADSPACE 6
# else
# define TYPEAHEADSPACE 0
# endif
# define TYPEAHEADLEN (20 + TYPEAHEADSPACE)
static char_u typeahead[TYPEAHEADLEN]; // previously typed bytes.
static int typeaheadlen = 0;
@@ -1838,7 +1844,7 @@ mch_inchar(
// to get and still room in the buffer (up to two bytes for a char and
// three bytes for a modifier).
while ((typeaheadlen == 0 || WaitForChar(0L, FALSE))
&& typeaheadlen + 5 <= TYPEAHEADLEN)
&& typeaheadlen + 5 + TYPEAHEADSPACE <= TYPEAHEADLEN)
{
if (typebuf_changed(tb_change_cnt))
{
@@ -1890,7 +1896,7 @@ mch_inchar(
if (ch2 == NUL)
{
int i;
int i, j;
char_u *p;
WCHAR ch[2];
@@ -1903,13 +1909,33 @@ mch_inchar(
p = utf16_to_enc(ch, &n);
if (p != NULL)
{
for (i = 0; i < n; i++)
typeahead[typeaheadlen + i] = p[i];
for (i = 0, j = 0; i < n; i++)
{
typeahead[typeaheadlen + j++] = p[i];
# ifdef VIMDLL
if (p[i] == CSI)
{
typeahead[typeaheadlen + j++] = KS_EXTRA;
typeahead[typeaheadlen + j++] = KE_CSI;
}
# endif
}
n = j;
vim_free(p);
}
}
else
{
typeahead[typeaheadlen] = c;
# ifdef VIMDLL
if (c == CSI)
{
typeahead[typeaheadlen + 1] = KS_EXTRA;
typeahead[typeaheadlen + 2] = KE_CSI;
n = 3;
}
# endif
}
if (ch2 != NUL)
{
if (c == K_NUL)
+382 -108
View File
@@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-02 17:17+0100\n"
"POT-Creation-Date: 2020-02-29 23:12+0100\n"
"PO-Revision-Date: 2008-05-24 17:26+0200\n"
"Last-Translator: Christian Brabandt <cb@256bit.org>\n"
"Language-Team: German\n"
@@ -71,7 +71,7 @@ msgstr ""
#, c-format
msgid "E680: <buffer=%d>: invalid buffer number "
msgstr "E680: <buffer=%d>: Ungültige Puffer Nummer "
msgstr "E680: <buffer=%d>: Ungültige Puffernummer "
msgid "E217: Can't execute autocommands for ALL events"
msgstr "E217: Autokommandos können nicht für ALL Ereignisse ausgeführt werden"
@@ -541,22 +541,6 @@ msgstr "%3d %s %s Zeile %ld"
msgid "%3d expr %s"
msgstr "%3d expr %s"
#, c-format
msgid "E720: Missing colon in Dictionary: %s"
msgstr "E720: Fehlender Doppelpunkt im Dictionary: %s"
#, c-format
msgid "E721: Duplicate key in Dictionary: \"%s\""
msgstr "E721: Doppelter Schlüssel im Dictionary: \"%s\""
#, c-format
msgid "E722: Missing comma in Dictionary: %s"
msgstr "E722: Fehlendes Komma im Dictionary: %s"
#, c-format
msgid "E723: Missing end of Dictionary '}': %s"
msgstr "E723: Fehlendes Ende des Dictionary '}': %s"
msgid "extend() argument"
msgstr "extend() Argument"
@@ -705,18 +689,12 @@ msgstr "E105: :loadkeymap au
msgid "E791: Empty keymap entry"
msgstr "E791: Leerer keymap Eintrag"
msgid "E111: Missing ']'"
msgstr "E111: Fehlende ']'"
msgid "E719: Cannot use [:] with a Dictionary"
msgstr "E719: Kann [:] nicht mit einem Dictionary verwenden"
msgid "E806: using Float as a String"
msgstr "E806: Float als String benutzt."
msgid "E274: No white space allowed before parenthesis"
msgstr "E274: Keine Leerzeichen vor Klammern erlaubt"
msgid "E689: Can only index a List, Dictionary or Blob"
msgstr "E689: Kann nur Listen, Dictionary oder Blob indizieren"
@@ -741,21 +719,6 @@ msgstr "E711: Listenwert hat nicht gen
msgid "E996: Cannot lock a list or dict"
msgstr "E996: Kann List oder Dictionary nicht sperren"
msgid "E690: Missing \"in\" after :for"
msgstr "E690: Fehlendes \"in\" nach :for"
msgid "E109: Missing ':' after '?'"
msgstr "E109: Fehlender ':' nach '?'"
msgid "E804: Cannot use '%' with Float"
msgstr "E804: Kann '%' mit Floats benutzen."
msgid "E973: Blob literal should have an even number of hex characters"
msgstr "E973: Blob-Literal sollte eine gerade Anzahl von Hex-Zeichen haben"
msgid "E110: Missing ')'"
msgstr "E110: Fehlendes ')'"
msgid "E260: Missing name after ->"
msgstr "E260: Fehlende Name nach ->"
@@ -769,9 +732,8 @@ msgstr "E909: Kann Spezialvariable nicht indexieren."
msgid "E112: Option name missing: %s"
msgstr "E112: Optionsname fehlt: %s"
#, c-format
msgid "E113: Unknown option: %s"
msgstr "E113: Unbekannte Option: %s"
msgid "E973: Blob literal should have an even number of hex characters"
msgstr "E973: Blob-Literal sollte eine gerade Anzahl von Hex-Zeichen haben"
#, c-format
msgid "E114: Missing quote: %s"
@@ -822,6 +784,9 @@ msgstr "E893: Liste als Float verwendet."
msgid "E894: Using a Dictionary as a Float"
msgstr "E894: Dictionary als Float verwendet."
msgid "E362: Using a boolean value as a Float"
msgstr "E362: Benutze Boolvariable als Float."
msgid "E907: Using a special value as a Float"
msgstr "E907: Benutze Spezialvariable als Float."
@@ -846,9 +811,6 @@ msgstr "E731: Dictionary als String verwendet"
msgid "E976: using Blob as a String"
msgstr "E976: Blob als String verwendet"
msgid "E908: using an invalid value as a String"
msgstr "E908: Ungültiger Wert als String verwendet."
msgid "E698: variable nested too deep for making a copy"
msgstr "E698: Variable ist zu tief verschachtelt für eine Kopie"
@@ -859,9 +821,6 @@ msgstr ""
"\n"
"\tZuletzt gesetzt in "
msgid " line "
msgstr " Zeile "
msgid "E977: Can only compare Blob with Blob"
msgstr "E977: Kann nur einen Blob mit einem Blob vergleichen"
@@ -950,16 +909,10 @@ msgstr "E258: Kann nicht zum Client senden."
msgid "E962: Invalid action: '%s'"
msgstr "E962: Ungültige Aktion '%s'"
msgid "(Invalid)"
msgstr "(Ungültig)"
#, c-format
msgid "E935: invalid submatch number: %d"
msgstr "E935: Ungültige Submatch Nummer: %d"
msgid "E18: Unexpected characters in :let"
msgstr "E18: Unerwartete Zeichen in :let"
msgid "E991: cannot use =<< here"
msgstr "E991: =<< kann hier nicht genutzt werden"
@@ -992,9 +945,6 @@ msgstr "E738: Kann Variablen nicht auflisten: %s"
msgid "E996: Cannot lock an environment variable"
msgstr "E996: Kann Umgebungsvariable nicht sperren"
msgid "E996: Cannot lock an option"
msgstr "E996: Kann Option nicht sperren"
msgid "E996: Cannot lock a register"
msgstr "E996: Kann Register nicht sperren"
@@ -1009,6 +959,13 @@ msgstr "E940: Kann Variable \"%s\" nicht sperren bzw. entsperren."
msgid "E743: variable nested too deep for (un)lock"
msgstr "E743: Variable ist zu tief verschachtelt zum (ent)sperren."
msgid "E1063: type mismatch for v: variable"
msgstr "E1063: Typendiskrepanz für v: Variable"
#, c-format
msgid "E1041: Redefining script item %s"
msgstr "E1041: Neudefinition von Scriptelement %s"
#, c-format
msgid "E963: setting %s to value with wrong type"
msgstr "E963: %s auf Wert mit falschem Typ gesetzt"
@@ -1519,15 +1476,6 @@ msgstr "Unterbrechung"
msgid "E579: :if nesting too deep"
msgstr "E579: :if Schachtelung zu tief"
msgid "E580: :endif without :if"
msgstr "E580: :endif ohne :if"
msgid "E581: :else without :if"
msgstr "E581: :else ohne :if"
msgid "E582: :elseif without :if"
msgstr "E582: :elseif ohne :if"
msgid "E583: multiple :else"
msgstr "E583: Mehrere :else"
@@ -1537,12 +1485,6 @@ msgstr "E584: :elseif nach :else"
msgid "E585: :while/:for nesting too deep"
msgstr "E585: :while/:for Schachtelung zu tief"
msgid "E586: :continue without :while or :for"
msgstr "E586: :continue ohne :while or :for"
msgid "E587: :break without :while or :for"
msgstr "E587: :break ohne :while oder :for"
msgid "E732: Using :endfor with :while"
msgstr "E732: Nutzung von :endfor mit :while"
@@ -1552,21 +1494,9 @@ msgstr "E733: Nutzung von :endwhile mit :for"
msgid "E601: :try nesting too deep"
msgstr "E601: :try Schachtelung zu tief"
msgid "E603: :catch without :try"
msgstr "E603: :catch ohne :try"
msgid "E604: :catch after :finally"
msgstr "E604: :catch nach :finally"
msgid "E606: :finally without :try"
msgstr "E606: :finally ohne :try"
msgid "E607: multiple :finally"
msgstr "E607: Mehrere :finally"
msgid "E602: :endtry without :try"
msgstr "E602: :endtry ohne :try"
msgid "E193: :endfunction not inside a function"
msgstr "E193: :endfunction außerhalb einer Funktion"
@@ -3612,10 +3542,6 @@ msgstr " Im Verzeichnis "
msgid " -- none --\n"
msgstr " -- Nichts --\n"
# no-c-format
msgid "%a %b %d %H:%M:%S %Y"
msgstr "%a, %d %b %Y %H:%M:%S"
msgid " owned by: "
msgstr " Eigentum von: "
@@ -3996,12 +3922,6 @@ msgstr "Beep!"
msgid "E677: Error writing temp file"
msgstr "E677: Fehler beim Schreiben einer temporären Datei"
#, c-format
msgid "%ld second ago"
msgid_plural "%ld seconds ago"
msgstr[0] "vor %ld Sekunde"
msgstr[1] "vor %ld Sekunden"
msgid "ERROR: "
msgstr "FEHLER: "
@@ -4555,8 +4475,8 @@ msgstr "Vim Achtung"
msgid "shell returned %d"
msgstr "Shell gab %d zurück"
msgid "E278: Cannot put a terminal buffer in a popup window"
msgstr "E278: Terminal kann nicht in einem Popup-Fenster geöffnet werden."
msgid "E450: buffer number, text or a list required"
msgstr "E450: Puffernummer, Text oder Liste erforderlich"
#, c-format
msgid "E997: Tabpage not found: %d"
@@ -4569,6 +4489,9 @@ msgstr "E993: Fenster %d ist kein Popup-Fenster"
msgid "E994: Not allowed in a popup window"
msgstr "E994: Nicht innerhalb eines Popup-Fensters erlaubt"
msgid "E863: Not allowed for a terminal in a popup window"
msgstr "E863: Nicht erlaubt für ein Terminal innerhalb eines Popup-Fensters"
msgid "E750: First use \":profile start {fname}\""
msgstr "E750: Benutze vorher :profile start <fname>"
@@ -4991,6 +4914,9 @@ msgstr "E167: :scriptencoding au
msgid "E984: :scriptversion used outside of a sourced file"
msgstr "E984: :scriptversion außerhalb einer eingelesenen Datei"
msgid "E1040: Cannot use :scriptversion after :vim9script"
msgstr "E1040: :scriptversion kann nicht nach :vim9script verwendet werden"
#, c-format
msgid "E999: scriptversion not supported: %d"
msgstr "E999: scriptversion nicht unterstützt: %d"
@@ -5865,6 +5791,19 @@ msgstr "E969: Eigenschaftentyp %s bereits definiert"
msgid "E970: Unknown highlight group name: '%s'"
msgstr "E970: Unbekannter Highlighting-Gruppenname: '%s'"
msgid "(Invalid)"
msgstr "(Ungültig)"
# no-c-format
msgid "%a %b %d %H:%M:%S %Y"
msgstr "%a, %d %b %Y %H:%M:%S"
#, c-format
msgid "%ld second ago"
msgid_plural "%ld seconds ago"
msgstr[0] "vor %ld Sekunde"
msgstr[1] "vor %ld Sekunden"
msgid "new shell started\n"
msgstr "neue Shell gestartet\n"
@@ -6094,6 +6033,12 @@ msgstr "E125: Unzul
msgid "E853: Duplicate argument name: %s"
msgstr "E853: Doppelter Argumentname: %s"
msgid "E1059: No white space allowed before :"
msgstr "E1059: Keine Leerzeichen erlaubt for :"
msgid "E1055: Missing name after ..."
msgstr "E1055: Fehlender Name nach ..."
msgid "E989: Non-default argument follows default argument"
msgstr "E989: Nicht-default Argument folgt auf default Argument"
@@ -6127,22 +6072,10 @@ msgstr "%s lieferte \"%s\" zur
msgid "E699: Too many arguments"
msgstr "E699: Zu viele Argumente"
#, c-format
msgid "E117: Unknown function: %s"
msgstr "E117: Unbekannte Funktion: %s"
#, c-format
msgid "E276: Cannot use function as a method: %s"
msgstr "E276: Funktion %s kann nicht als Methode genutzt werden"
#, c-format
msgid "E933: Function was deleted: %s"
msgstr "E933: Funktion wurde gelöscht: %s"
#, c-format
msgid "E119: Not enough arguments for function: %s"
msgstr "E119: Zu wenige Argumente für Funktion: %s"
#, c-format
msgid "E120: Using <SID> not in a script context: %s"
msgstr "E120: <SID> wurde nicht in einer Skript-Umgebung benutzt: %s"
@@ -6176,18 +6109,32 @@ msgstr "E124: Fehlendes '(': %s"
msgid "E862: Cannot use g: here"
msgstr "E862: g: kann hier nicht genutzt werden"
#, c-format
msgid "E1056: expected a type: %s"
msgstr "E1056: Typ erwartet: %s"
#, c-format
msgid "E932: Closure function should not be at top level: %s"
msgstr ""
"E932: Closure Funktion kann nicht auf äussersten Level definiert sein: %s"
msgid "E1057: Missing :enddef"
msgstr "E1057: Fehlendes :enddef"
msgid "E126: Missing :endfunction"
msgstr "E126: Fehlendes :endfunction"
#, c-format
msgid "W1001: Text found after :enddef: %s"
msgstr "W1001: Überschüssiger Text nach :enddef: %s"
#, c-format
msgid "W22: Text found after :endfunction: %s"
msgstr "W22: Überschüssiger Text nach :endfunction: %s"
msgid "E1058: function nesting too deep"
msgstr "E1058: Funktions-Schachtelung zu tief"
#, c-format
msgid "E707: Function name conflicts with variable: %s"
msgstr "E707: Funktionsname kollidiert mit Variable: %s"
@@ -6361,6 +6308,9 @@ msgstr "mit X11-neXtaw GUI."
msgid "with X11-Athena GUI."
msgstr "mit X11-Athena GUI."
msgid "with Haiku GUI."
msgstr "mit Haiku GUI."
msgid "with Photon GUI."
msgstr "mit Photon GUI."
@@ -6501,6 +6451,238 @@ msgstr "Tippe :help register<Enter> f
msgid "menu Help->Sponsor/Register for information "
msgstr "Menü Hilfe->Sponsor/Register für mehr Informationen "
#, c-format
msgid "E1001: variable not found: %s"
msgstr "E1001: Variable nicht gefunden: %s"
#, c-format
msgid "E1002: Syntax error at %s"
msgstr "E1002: Syntaxfehler bei %s"
msgid "E1035: wrong argument type for +"
msgstr "E1035: Falscher Argumenttyp für +"
#, c-format
msgid "E1036: %c requires number or float arguments"
msgstr "E1036: %c benötigt eine Nummer oder ein Float als Argument"
msgid "E1035: % requires number arguments"
msgstr "E1035: % benötigt numerische Argumente"
#, c-format
msgid "E1037: Cannot use \"%s\" with %s"
msgstr "E1037: Kann nicht \"%s\" mit %s verwenden"
#, c-format
msgid "E1037: Cannot compare %s with %s"
msgstr "E1037: Kann %s nicht mit %s vergleichen"
#, c-format
msgid "E1004: white space required before and after '%s'"
msgstr "E1004: Leerzeichen vor und nach '%s' benötigt"
#, c-format
msgid "E1006: %s is used as an argument"
msgstr "E1006: %s wird als Argument verwendet"
msgid "E1007: No white space allowed before <"
msgstr "E1007: Keine Leerzeichen vor < erlaubt"
msgid "E1008: Missing <type>"
msgstr "E1008: Fehlendes <type>"
msgid "E1009: Missing > after type"
msgstr "E1009: Fehlendes '>' nach Typ"
msgid "E1055: This Vim is not compiled with float support"
msgstr "E1055: Vim wurde nicht mit der \"float\"-Eigenschaft übersetzt."
#, c-format
msgid "E1010: Type not recognized: %s"
msgstr "E1010: Unbekannter Typ: %s"
#, c-format
msgid "E1060: expected dot after name: %s"
msgstr "E1060: erwarte Punkt nach Name: %s"
#, c-format
msgid "E1050: Item not found: %s"
msgstr "E1050: Element nicht gefunden: %s"
msgid "E1068: No white space allowed before ,"
msgstr "E1068: Keine Leerzeichen vor , erlaubt"
msgid "E1069: white space required after ,"
msgstr "E1069: Leerzeichen benötigt nach ,"
#, c-format
msgid "E1011: name too long: %s"
msgstr "E1011: Name zu lang: %s"
#, c-format
msgid "E1013: type mismatch, expected %s but got %s"
msgstr "E1013: Typendiskrepanz, erwarte %s erhielt jedoch %s"
#, c-format
msgid "E1014: Invalid key: %s"
msgstr "E1014: Ungültiger Schlüssel: %s"
#, c-format
msgid "E1015: Name expected: %s"
msgstr "E1015: Name erwartet: %s"
msgid "E1003: Missing return value"
msgstr "E1003: Fehlender Returnwert"
#, c-format
msgid "E1052: Cannot declare an option: %s"
msgstr "E1052: Kann keine Option deklarieren: %s"
#, c-format
msgid "E1065: Cannot declare an environment variable: %s"
msgstr "E1065: Kann keine Umgebungsvariable deklarieren: %s"
#, c-format
msgid "E1066: Cannot declare a register: %s"
msgstr "E1066: Kann kein Register deklarieren: %s"
#, c-format
msgid "E1016: Cannot declare a global variable: %s"
msgstr "E1016: Kann keine globale Variable deklarieren: %s"
#, c-format
msgid "E1064: Cannot declare a v: variable: %s"
msgstr "E1064: Kann keine v: Variable deklarieren: %s"
#, c-format
msgid "E1034: Cannot use reserved name %s"
msgstr "E1034: Kann reservierten Namen nicht benutzen %s"
#, c-format
msgid "E1017: Variable already declared: %s"
msgstr "E1017: Variable bereits deklariert: %s"
#, c-format
msgid "E1018: Cannot assign to a constant: %s"
msgstr "E1018: Kann nicht einer Konstante zuweisen: %s"
#, c-format
msgid "E1054: Variable already declared in the script: %s"
msgstr "E1054: Variable bereits in Script %s deklariert"
msgid "E1019: Can only concatenate to string"
msgstr "E1019: Kann nur zu einer Zeichenkette verkettet werden"
#, c-format
msgid "E1020: cannot use an operator on a new variable: %s"
msgstr "E1020: kann Operator nicht auf eine neue Variable %s anwenden"
msgid "E1031: Cannot use void value"
msgstr "E1031: Kann nicht void Wert verwenden"
msgid "E1021: const requires a value"
msgstr "E1021: const erfordert einen Wert"
msgid "E1022: type or initialization required"
msgstr "E1022: Typ oder Initialisierung erforderlich"
#, c-format
msgid "E1023: variable already defined: %s"
msgstr "E1023: Variable existiert bereits: %s"
msgid "E1024: need a List to iterate over"
msgstr "E1024: benötige Liste zum iterieren"
msgid "E1033: catch unreachable after catch-all"
msgstr "E1033: catch unerreichbar nach catch-all"
#, c-format
msgid "E1067: Separator mismatch: %s"
msgstr "E1067: Separator-Unstimmigkeit %s"
msgid "E1032: missing :catch or :finally"
msgstr "E1032: fehlendes :catch oder :finally"
#, c-format
msgid "E488: Trailing characters: %s"
msgstr "E488: Überschüssige Zeichen: %s"
msgid "E1025: using } outside of a block scope"
msgstr "E1025: } außerhalb eines Blockbereichs verwendet"
msgid "E1026: Missing }"
msgstr "E1026: Fehlendes }"
msgid "E1027: Missing return statement"
msgstr "E1027: Fehlende Return Anweisung"
msgid "E1028: compile_def_function failed"
msgstr "E1028: compile_def_function fehlgeschlagen"
#, c-format
msgid "E121: Undefined variable: g:%s"
msgstr "E121: Undefinierte Variable: g:%s"
msgid "E1051: Expected string or number"
msgstr "E1051: Erwartete Zeichenkette oder Nummer"
#, c-format
msgid "E1029: Expected %s but got %s"
msgstr "E1029: Erwartete %s, aber erhielt %s"
#, c-format
msgid "E1061: Cannot find function %s"
msgstr "E1061: Funktion %s nicht gefunden"
#, c-format
msgid "E1062: Function %s is not compiled"
msgstr "E1062: Funktion %s ist nicht kompiliert"
msgid "E1030: Using a String as a Number"
msgstr "E1030: Verwende Zeichenkette als Nummer"
msgid "E1042: import/export can only be used in vim9script"
msgstr "E1042: import/export kann nur für vim9script verwendet werden"
msgid "E1038: vim9script can only be used in a script"
msgstr "E1038: vim9script kann nur innerhalb eines Scripts verwendet werden"
msgid "E1039: vim9script must be the first command in a script"
msgstr "E1039: vim9script muss erster Befehl in einem Script sein"
msgid "E1044: export with invalid argument"
msgstr "E1044: export mit ungültigem Argument"
msgid "E1043: Invalid command after :export"
msgstr "E1043: Ungültiger Befehl nach :export"
#, c-format
msgid "E1049: Item not exported in script: %s"
msgstr "E1049: Element nicht exportiert in Script: %s"
#, c-format
msgid "E1048: Item not found in script: %s"
msgstr "E1048: Element nicht in Script %s gefunden"
msgid "E1045: Missing \"as\" after *"
msgstr "E1045: Fehlendes \"as\" nach *"
msgid "E1070: Missing \"from\""
msgstr "E1070: Fehlendes \"from\""
msgid "E1071: Invalid string after \"from\""
msgstr "E1071: Ungültige Zeichenkette nach \"from\""
#, c-format
msgid "E1053: Could not import \"%s\""
msgstr "E1053: Konnte \"%s\" nicht importieren"
msgid "E1046: Missing comma in import"
msgstr "E1046: Fehlendes Komma in import"
msgid "E1047: syntax error in import"
msgstr "E1047: Syntaxfehler in import"
msgid ""
"\n"
"# Buffer list:\n"
@@ -6703,6 +6885,9 @@ msgstr ""
msgid "E445: Other window contains changes"
msgstr "E445: Anderes Fenster enthält Änderungen"
msgid "E366: Not allowed to enter a popup window"
msgstr "E366: Popup-Fenster zu betreten nicht erlaubt"
#, c-format
msgid "E370: Could not load library %s"
msgstr "E370: Konnte Bibliothek %s nicht laden"
@@ -6770,9 +6955,21 @@ msgstr ""
msgid "E171: Missing :endif"
msgstr "E171: Fehlendes :endif"
msgid "E603: :catch without :try"
msgstr "E603: :catch ohne :try"
msgid "E606: :finally without :try"
msgstr "E606: :finally ohne :try"
msgid "E607: multiple :finally"
msgstr "E607: Mehrere :finally"
msgid "E600: Missing :endtry"
msgstr "E600: Fehlendes :endtry"
msgid "E602: :endtry without :try"
msgstr "E602: :endtry ohne :try"
msgid "E170: Missing :endwhile"
msgstr "E170: fehlendes :endwhile"
@@ -7044,6 +7241,14 @@ msgstr "E978: Unzul
msgid "E118: Too many arguments for function: %s"
msgstr "E118: Zu viele Argumente für Funktion: %s"
#, c-format
msgid "E119: Not enough arguments for function: %s"
msgstr "E119: Zu wenige Argumente für Funktion: %s"
#, c-format
msgid "E933: Function was deleted: %s"
msgstr "E933: Funktion wurde gelöscht: %s"
#, c-format
msgid "E716: Key not present in Dictionary: %s"
msgstr "E716: Schlüssel %s nicht im Dictionary vorhanden."
@@ -7062,6 +7267,22 @@ msgstr "E712: Argument von %s muss eine Liste oder ein Dictionary sein."
msgid "E896: Argument of %s must be a List, Dictionary or Blob"
msgstr "E896: Argument von %s muss eine Liste, Dictionary oder ein Blob sein."
msgid "E804: Cannot use '%' with Float"
msgstr "E804: Kann '%' mit Floats benutzen."
msgid "E908: using an invalid value as a String"
msgstr "E908: Ungültiger Wert als String verwendet."
msgid "E996: Cannot lock an option"
msgstr "E996: Kann Option nicht sperren"
#, c-format
msgid "E113: Unknown option: %s"
msgstr "E113: Unbekannte Option: %s"
msgid "E18: Unexpected characters in :let"
msgstr "E18: Unerwartete Zeichen in :let"
msgid "E47: Error while reading errorfile"
msgstr "E47: Fehler während des Lesens der Fehlerdatei"
@@ -7129,6 +7350,25 @@ msgstr "E81: <SID> wurde nicht in einer Skript-Umgebung benutzt"
msgid "E107: Missing parentheses: %s"
msgstr "E107: Fehlende Klammern: %s"
msgid "E110: Missing ')'"
msgstr "E110: Fehlendes ')'"
#, c-format
msgid "E720: Missing colon in Dictionary: %s"
msgstr "E720: Fehlender Doppelpunkt im Dictionary: %s"
#, c-format
msgid "E721: Duplicate key in Dictionary: \"%s\""
msgstr "E721: Doppelter Schlüssel im Dictionary: \"%s\""
#, c-format
msgid "E722: Missing comma in Dictionary: %s"
msgstr "E722: Fehlendes Komma im Dictionary: %s"
#, c-format
msgid "E723: Missing end of Dictionary '}': %s"
msgstr "E723: Fehlendes Ende des Dictionary '}': %s"
msgid "E449: Invalid expression received"
msgstr "E449: Ungültiger Ausdruck"
@@ -7178,12 +7418,46 @@ msgstr "E957: Ung
msgid "E686: Argument of %s must be a List"
msgstr "E686: Argument von %s muss eine Liste sein."
msgid "E109: Missing ':' after '?'"
msgstr "E109: Fehlender ':' nach '?'"
msgid "E690: Missing \"in\" after :for"
msgstr "E690: Fehlendes \"in\" nach :for"
#, c-format
msgid "E117: Unknown function: %s"
msgstr "E117: Unbekannte Funktion: %s"
msgid "E111: Missing ']'"
msgstr "E111: Fehlende ']'"
msgid "E581: :else without :if"
msgstr "E581: :else ohne :if"
msgid "E582: :elseif without :if"
msgstr "E582: :elseif ohne :if"
msgid "E580: :endif without :if"
msgstr "E580: :endif ohne :if"
msgid "E586: :continue without :while or :for"
msgstr "E586: :continue ohne :while or :for"
msgid "E587: :break without :while or :for"
msgstr "E587: :break ohne :while oder :for"
msgid "E274: No white space allowed before parenthesis"
msgstr "E274: Keine Leerzeichen vor Klammern erlaubt"
msgid "search hit TOP, continuing at BOTTOM"
msgstr "Suche erreichte den ANFANG und wurde am ENDE fortgesetzt"
msgid "search hit BOTTOM, continuing at TOP"
msgstr "Suche erreichte das ENDE und wurde am ANFANG fortgesetzt"
msgid " line "
msgstr " Zeile "
#, c-format
msgid "Need encryption key for \"%s\""
msgstr "Geben Sie bitte den Schlüssel für \"%s\" ein: "
+89 -30
View File
@@ -1127,7 +1127,7 @@ popup_adjust_position(win_T *wp)
int org_height = wp->w_height;
int org_leftcol = wp->w_leftcol;
int org_leftoff = wp->w_popup_leftoff;
int minwidth;
int minwidth, minheight;
int wantline = wp->w_wantline; // adjusted for textprop
int wantcol = wp->w_wantcol; // adjusted for textprop
int use_wantcol = wantcol != 0;
@@ -1232,8 +1232,9 @@ popup_adjust_position(win_T *wp)
|| wp->w_popup_pos == POPPOS_BOTLEFT))
{
wp->w_wincol = wantcol - 1;
if (wp->w_wincol >= Columns - 1)
wp->w_wincol = Columns - 1;
// Need to see at least one character after the decoration.
if (wp->w_wincol > Columns - left_extra - 1)
wp->w_wincol = Columns - left_extra - 1;
}
}
@@ -1248,6 +1249,18 @@ popup_adjust_position(win_T *wp)
maxwidth = wp->w_maxwidth;
}
minwidth = wp->w_minwidth;
minheight = wp->w_minheight;
#ifdef FEAT_TERMINAL
// A terminal popup initially does not have content, use a default minimal
// width of 20 characters and height of 5 lines.
if (wp->w_buffer->b_term != NULL)
{
if (minwidth == 0)
minwidth = 20;
if (minheight == 0)
minheight = 5;
}
#endif
// start at the desired first line
if (wp->w_firstline > 0)
@@ -1418,8 +1431,8 @@ popup_adjust_position(win_T *wp)
wp->w_height = wp->w_buffer->b_ml.ml_line_count - wp->w_topline
+ 1 + wrapped;
if (wp->w_minheight > 0 && wp->w_height < wp->w_minheight)
wp->w_height = wp->w_minheight;
if (minheight > 0 && wp->w_height < minheight)
wp->w_height = minheight;
if (wp->w_maxheight > 0 && wp->w_height > wp->w_maxheight)
wp->w_height = wp->w_maxheight;
w_height_before_limit = wp->w_height;
@@ -2114,9 +2127,31 @@ popup_close_and_callback(win_T *wp, typval_T *arg)
#ifdef FEAT_TERMINAL
if (wp == curwin && curbuf->b_term != NULL)
{
// Closing popup window with a terminal: put focus back on the previous
// window.
win_enter(prevwin, FALSE);
win_T *owp;
// Closing popup window with a terminal: put focus back on the first
// that works:
// - another popup window with a terminal
// - the previous window
// - the first one.
for (owp = first_popupwin; owp != NULL; owp = owp->w_next)
if (owp != curwin && owp->w_buffer->b_term != NULL)
break;
if (owp != NULL)
win_enter(owp, FALSE);
else
{
for (owp = curtab->tp_first_popupwin; owp != NULL;
owp = owp->w_next)
if (owp != curwin && owp->w_buffer->b_term != NULL)
break;
if (owp != NULL)
win_enter(owp, FALSE);
else if (win_valid(prevwin) && wp != prevwin)
win_enter(prevwin, FALSE);
else
win_enter(firstwin, FALSE);
}
}
#endif
@@ -2124,11 +2159,13 @@ popup_close_and_callback(win_T *wp, typval_T *arg)
if (wp == curwin && ERROR_IF_POPUP_WINDOW)
return;
CHECK_CURBUF;
if (wp->w_close_cb.cb_name != NULL)
// Careful: This may make "wp" invalid.
invoke_popup_callback(wp, arg);
popup_close(id);
CHECK_CURBUF;
}
void
@@ -2467,6 +2504,31 @@ popup_free(win_T *wp)
popup_mask_refresh = TRUE;
}
static void
error_for_popup_window(void)
{
emsg(_("E994: Not allowed in a popup window"));
}
int
error_if_popup_window(int also_with_term UNUSED)
{
// win_execute() may set "curwin" to a popup window temporarily, but many
// commands are disallowed then. When a terminal runs in the popup most
// things are allowed. When a terminal is finished it can be closed.
if (WIN_IS_POPUP(curwin)
# ifdef FEAT_TERMINAL
&& (also_with_term || curbuf->b_term == NULL)
&& !term_is_finished(curbuf)
# endif
)
{
error_for_popup_window();
return TRUE;
}
return FALSE;
}
/*
* Close a popup window by Window-id.
* Does not invoke the callback.
@@ -2482,6 +2544,11 @@ popup_close(int id)
for (wp = first_popupwin; wp != NULL; prev = wp, wp = wp->w_next)
if (wp->w_id == id)
{
if (wp == curwin)
{
error_for_popup_window();
return;
}
if (prev == NULL)
first_popupwin = wp->w_next;
else
@@ -2508,6 +2575,11 @@ popup_close_tabpage(tabpage_T *tp, int id)
for (wp = *root; wp != NULL; prev = wp, wp = wp->w_next)
if (wp->w_id == id)
{
if (wp == curwin)
{
error_for_popup_window();
return;
}
if (prev == NULL)
*root = wp->w_next;
else
@@ -2853,24 +2925,6 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
}
}
int
error_if_popup_window(int also_with_term UNUSED)
{
// win_execute() may set "curwin" to a popup window temporarily, but many
// commands are disallowed then. When a terminal runs in the popup most
// things are allowed.
if (WIN_IS_POPUP(curwin)
# ifdef FEAT_TERMINAL
&& (also_with_term || curbuf->b_term == NULL)
# endif
)
{
emsg(_("E994: Not allowed in a popup window"));
return TRUE;
}
return FALSE;
}
# if defined(FEAT_TERMINAL) || defined(PROTO)
/*
* Return TRUE if the current window is running a terminal in a popup window.
@@ -2977,7 +3031,7 @@ invoke_popup_filter(win_T *wp, int c)
// Convert the number to a string, so that the function can use:
// if a:c == "\<F2>"
buf[special_to_buf(c, mod_mask, TRUE, buf)] = NUL;
buf[special_to_buf(c, mod_mask, FALSE, buf)] = NUL;
argv[1].v_type = VAR_STRING;
argv[1].vval.v_string = vim_strsave(buf);
@@ -3483,9 +3537,14 @@ update_popups(void (*win_update)(win_T *wp))
wp->w_winrow -= top_off;
wp->w_wincol -= left_extra;
// cursor position matters in terminal
wp->w_wrow += top_off;
wp->w_wcol += left_extra;
// cursor position matters in terminal in job mode
#ifdef FEAT_TERMINAL
if (wp != curwin || !term_in_normal_mode())
#endif
{
wp->w_wrow += top_off;
wp->w_wcol += left_extra;
}
total_width = popup_width(wp);
total_height = popup_height(wp);
+1
View File
@@ -16,6 +16,7 @@ void f_bufwinnr(typval_T *argvars, typval_T *rettv);
void f_deletebufline(typval_T *argvars, typval_T *rettv);
void f_getbufinfo(typval_T *argvars, typval_T *rettv);
void f_getbufline(typval_T *argvars, typval_T *rettv);
type_T *ret_f_getline(int argcount, type_T **argtypes);
void f_getline(typval_T *argvars, typval_T *rettv);
void f_setbufline(typval_T *argvars, typval_T *rettv);
void f_setline(typval_T *argvars, typval_T *rettv);
+1 -1
View File
@@ -4,7 +4,7 @@ char_u *get_expr_name(expand_T *xp, int idx);
int find_internal_func(char_u *name);
int has_internal_func(char_u *name);
char *internal_func_name(int idx);
type_T *internal_func_ret_type(int idx, int argcount);
type_T *internal_func_ret_type(int idx, int argcount, type_T **argtypes);
int check_internal_func(int idx, int argcount);
int call_internal_func(char_u *name, int argcount, typval_T *argvars, typval_T *rettv);
void call_internal_func_by_idx(int idx, typval_T *argvars, typval_T *rettv);
+1
View File
@@ -12,6 +12,7 @@ void do_perror(char *msg);
int emsg(char *s);
void iemsg(char *s);
void internal_error(char *where);
void internal_error_no_abort(char *where);
void emsg_invreg(int name);
void emsg_namelen(char *msg, char_u *name, int len);
char *msg_trunc_attr(char *s, int force, int attr);
+1 -1
View File
@@ -1,11 +1,11 @@
/* vim9compile.c */
int check_defined(char_u *p, int len, cctx_T *cctx);
char_u *skip_type(char_u *start);
type_T *parse_type(char_u **arg, garray_T *type_list);
char *vartype_name(vartype_T type);
char *type_name(type_T *type, char **tofree);
int get_script_item_idx(int sid, char_u *name, int check_writable);
imported_T *find_imported(char_u *name, size_t len, cctx_T *cctx);
char_u *to_name_end(char_u *arg);
char_u *to_name_const_end(char_u *arg);
int assignment_len(char_u *p, int *heredoc);
void compile_def_function(ufunc_T *ufunc, int set_return_type);
+1 -1
View File
@@ -5,5 +5,5 @@ void ex_export(exarg_T *eap);
void free_imports(int sid);
void ex_import(exarg_T *eap);
int find_exported(int sid, char_u **argp, int *name_len, ufunc_T **ufunc, type_T **type);
char_u *handle_import(char_u *arg_start, garray_T *gap, int import_sid);
char_u *handle_import(char_u *arg_start, garray_T *gap, int import_sid, void *cctx);
/* vim: set ft=c : */
+20 -1
View File
@@ -6268,7 +6268,26 @@ load_dummy_buffer(
static void
wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
{
if (curbuf != buf) // safety check
// If any autocommand opened a window on the dummy buffer, close that
// window. If we can't close them all then give up.
while (buf->b_nwindows > 0)
{
int did_one = FALSE;
win_T *wp;
if (firstwin->w_next != NULL)
for (wp = firstwin; wp != NULL; wp = wp->w_next)
if (wp->w_buffer == buf)
{
if (win_close(wp, FALSE) == OK)
did_one = TRUE;
break;
}
if (!did_one)
return;
}
if (curbuf != buf && buf->b_nwindows == 0) // safety check
{
#if defined(FEAT_EVAL)
cleanup_T cs;
+8 -5
View File
@@ -3229,7 +3229,9 @@ parse_match(
tagp->command_end = p;
p += 2; // skip ";\""
if (*p++ == TAB)
while (ASCII_ISALPHA(*p))
// Accept ASCII alphabetic kind characters and any multi-byte
// character.
while (ASCII_ISALPHA(*p) || mb_ptr2len(p) > 1)
{
if (STRNCMP(p, "kind:", 5) == 0)
tagp->tagkind = p + 5;
@@ -3245,20 +3247,21 @@ parse_match(
tagp->tagkind = p;
if (pt == NULL)
break;
p = pt + 1;
p = pt;
MB_PTR_ADV(p);
}
}
if (tagp->tagkind != NULL)
{
for (p = tagp->tagkind;
*p && *p != '\t' && *p != '\r' && *p != '\n'; ++p)
*p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p))
;
tagp->tagkind_end = p;
}
if (tagp->user_data != NULL)
{
for (p = tagp->user_data;
*p && *p != '\t' && *p != '\r' && *p != '\n'; ++p)
*p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p))
;
tagp->user_data_end = p;
}
@@ -4006,7 +4009,7 @@ get_tags(list_T *list, char_u *pat, char_u *buf_fname)
if (tp.command_end != NULL)
{
for (p = tp.command_end + 3;
*p != NUL && *p != '\n' && *p != '\r'; ++p)
*p != NUL && *p != '\n' && *p != '\r'; MB_PTR_ADV(p))
{
if (p == tp.tagkind || (p + 5 == tp.tagkind
&& STRNCMP(p, "kind:", 5) == 0))
+40 -9
View File
@@ -382,6 +382,7 @@ term_close_buffer(buf_T *buf, buf_T *old_curbuf)
curwin->w_buffer = curbuf;
++curbuf->b_nwindows;
}
CHECK_CURBUF;
// Wiping out the buffer will also close the window and call
// free_terminal().
@@ -1800,6 +1801,27 @@ update_snapshot(term_T *term)
#endif
}
/*
* Loop over all windows in the current tab, and also curwin, which is not
* encountered when using a terminal in a popup window.
* Return TRUE if "*wp" was set to the next window.
*/
static int
for_all_windows_and_curwin(win_T **wp, int *did_curwin)
{
if (*wp == NULL)
*wp = firstwin;
else if ((*wp)->w_next != NULL)
*wp = (*wp)->w_next;
else if (!*did_curwin)
*wp = curwin;
else
return FALSE;
if (*wp == curwin)
*did_curwin = TRUE;
return TRUE;
}
/*
* If needed, add the current lines of the terminal to scrollback and to the
* buffer. Called after the job has ended and when switching to
@@ -1809,8 +1831,6 @@ update_snapshot(term_T *term)
static void
may_move_terminal_to_buffer(term_T *term, int redraw)
{
win_T *wp;
if (term->tl_vterm == NULL)
return;
@@ -1825,7 +1845,11 @@ may_move_terminal_to_buffer(term_T *term, int redraw)
&term->tl_default_color.fg, &term->tl_default_color.bg);
if (redraw)
FOR_ALL_WINDOWS(wp)
{
win_T *wp = NULL;
int did_curwin = FALSE;
while (for_all_windows_and_curwin(&wp, &did_curwin))
{
if (wp->w_buffer == term->tl_buffer)
{
@@ -1842,6 +1866,7 @@ may_move_terminal_to_buffer(term_T *term, int redraw)
redraw_win_later(wp, NOT_VALID);
}
}
}
}
#if defined(FEAT_TIMERS) || defined(PROTO)
@@ -1925,6 +1950,7 @@ term_enter_normal_mode(void)
check_cursor();
if (coladvance(term->tl_cursor_pos.col) == FAIL)
coladvance(MAXCOL);
curwin->w_set_curswant = TRUE;
// Display the same lines as in the terminal.
curwin->w_topline = term->tl_scrollback_scrolled + 1;
@@ -1956,6 +1982,10 @@ term_enter_job_mode()
if (term->tl_channel_closed)
cleanup_vterm(term);
redraw_buf_and_status_later(curbuf, NOT_VALID);
#ifdef FEAT_PROP_POPUP
if (WIN_IS_POPUP(curwin))
redraw_win_later(curwin, NOT_VALID);
#endif
}
/*
@@ -2806,14 +2836,15 @@ handle_damage(VTermRect rect, void *user)
static void
term_scroll_up(term_T *term, int start_row, int count)
{
win_T *wp;
win_T *wp = NULL;
int did_curwin = FALSE;
VTermColor fg, bg;
VTermScreenCellAttrs attr;
int clear_attr;
vim_memset(&attr, 0, sizeof(attr));
FOR_ALL_WINDOWS(wp)
while (for_all_windows_and_curwin(&wp, &did_curwin))
{
if (wp->w_buffer == term->tl_buffer)
{
@@ -2863,12 +2894,13 @@ handle_movecursor(
void *user)
{
term_T *term = (term_T *)user;
win_T *wp;
win_T *wp = NULL;
int did_curwin = FALSE;
term->tl_cursor_pos = pos;
term->tl_cursor_visible = visible;
FOR_ALL_WINDOWS(wp)
while (for_all_windows_and_curwin(&wp, &did_curwin))
{
if (wp->w_buffer == term->tl_buffer)
position_cursor(wp, &pos, FALSE);
@@ -5719,13 +5751,12 @@ f_term_scrape(typval_T *argvars, typval_T *rettv)
* "term_sendkeys(buf, keys)" function
*/
void
f_term_sendkeys(typval_T *argvars, typval_T *rettv)
f_term_sendkeys(typval_T *argvars, typval_T *rettv UNUSED)
{
buf_T *buf = term_get_buf(argvars, "term_sendkeys()");
char_u *msg;
term_T *term;
rettv->v_type = VAR_UNKNOWN;
if (buf == NULL)
return;
+3
View File
@@ -146,6 +146,7 @@ NEW_TESTS = \
test_iminsert \
test_increment \
test_increment_dbcs \
test_indent \
test_ins_complete \
test_interrupt \
test_job_fails \
@@ -377,6 +378,7 @@ NEW_TESTS_RES = \
test_iminsert.res \
test_increment.res \
test_increment_dbcs.res \
test_indent.res \
test_ins_complete.res \
test_interrupt.res \
test_job_fails.res \
@@ -400,6 +402,7 @@ NEW_TESTS_RES = \
test_marks.res \
test_match.res \
test_matchadd_conceal.res \
test_matchadd_conceal_utf8.res \
test_memory_usage.res \
test_messages.res \
test_method.res \
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|⇲| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
|t|e|r|m|i|n|a|l| |p|o|p|u|p| @42|0|,|0|-|1| @8|A|l@1|
|t|e|r|m|i|n|a|l| |p|o|p|u|p| @42|1|,|1| @10|T|o|p|
@@ -0,0 +1,15 @@
|0+0&#ffffff0| @73
|1| @73
|2| @73
|3| @12|╔+0#0000001#ffd7ff255|═@44|╗| +0#0000000#ffffff0@13
|4| @12|║+0#0000001#ffd7ff255|s|o|m|e| |t|e|x|t| @35|║| +0#0000000#ffffff0@13
|5| @12|║+0#0000001#ffd7ff255|t|o| |e+0&#ffff4012|d|i|t| +0&#ffd7ff255@37|║| +0#0000000#ffffff0@13
|6| @12|║+0#0000001#ffd7ff255|i+0&#e0e0e08|n| |a| >p+0&#ffd7ff255|o|p|u|p| |w|i|n|d|o|w| @27|║| +0#0000000#ffffff0@13
|7| @12|║+0#0000001#ffd7ff255|~+0#4040ff13&| @43|║+0#0000001&| +0#0000000#ffffff0@13
|8| @12|║+0#0000001#ffd7ff255|~+0#4040ff13&| @43|║+0#0000001&| +0#0000000#ffffff0@13
|9| @12|║+0#0000001#ffd7ff255|~+0#4040ff13&| @43|║+0#0000001&| +0#0000000#ffffff0@13
|1|0| @11|║+0#0000001#ffd7ff255|/|e|d|i|t| @21|2|,|4| @10|A|l@1| |║| +0#0000000#ffffff0@13
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|╝| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|6| @8|3|,|6| @10|A|l@1|
@@ -0,0 +1,15 @@
|0+0&#ffffff0| @73
|1| @73
|2| @73
|3| @12|╔+0#0000001#ffd7ff255|═@44|╗| +0#0000000#ffffff0@13
|4| @12|║+0#0000001#ffd7ff255|s+0#0000000#ffffff0|o|m|e| |t|e|x|t| @35|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|5| @12|║+0#0000001#ffd7ff255|t+0#0000000#ffffff0|o| >e+0&#ffff4012|d|i|t| +0&#ffffff0@37|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|6| @12|║+0#0000001#ffd7ff255|i+0#0000000#ffffff0|n| |a| |p|o|p|u|p| |w|i|n|d|o|w| @27|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|7| @12|║+0#0000001#ffd7ff255|~+0#4040ff13#ffffff0| @43|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|8| @12|║+0#0000001#ffd7ff255|~+0#4040ff13#ffffff0| @43|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|9| @12|║+0#0000001#ffd7ff255|~+0#4040ff13#ffffff0| @43|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|1|0| @11|║+0#0000001#ffd7ff255|/+0#0000000#ffffff0|e|d|i|t| @21|2|,|4| @10|A|l@1| |║+0#0000001#ffd7ff255| +0#0000000#ffffff0@13
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|╝| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
@57|1|,|1| @10|T|o|p|
@@ -0,0 +1,15 @@
|0+0&#ffffff0| @73
|1| @73
|2| @73
|3| @73
|4| @24|╔+0#0000001#ffd7ff255|═@19|╗| +0#0000000#ffffff0@26
|5| @24|║+0#0000001#ffd7ff255|a|n|o|t|h|e|r| |t|e|x|t| @7|║| +0#0000000#ffffff0@26
|6| @24|║+0#0000001#ffd7ff255|t|o| |s|h|o|w| @12|║| +0#0000000#ffffff0@26
|7| @24|║+0#0000001#ffd7ff255|i|n| |a| |p|o|p|u|p| |w|i|n|d|o|w| @2|║| +0#0000000#ffffff0@26
|8| @24|║+0#0000001#ffd7ff255| +0#4040ff13&> @18|║+0#0000001&| +0#0000000#ffffff0@26
|9| @24|║+0#0000001#ffd7ff255| +0#4040ff13&@19|║+0#0000001&| +0#0000000#ffffff0@26
|1|0| @23|╚+0#0000001#ffd7ff255|═@19|╝| +0#0000000#ffffff0@26
|1@1| @72
|1|2| @72
|1|3| @72
|:| @55|1|,|1| @10|T|o|p|
+1 -1
View File
@@ -150,7 +150,7 @@ let test_values = {
\ 'viminfo': [['', '''50', '"30'], ['xxx']],
\ 'virtualedit': [['', 'all', 'all,block'], ['xxx']],
\ 'whichwrap': [['', 'b,s', 'bs'], ['xxx']],
\ 'wildmode': [['', 'full', 'list:full', 'full,longest'], ['xxx']],
\ 'wildmode': [['', 'full', 'list:full', 'full,longest'], ['xxx', 'a4', 'full,full,full,full,full']],
\ 'wildoptions': [['', 'tagfile'], ['xxx']],
\ 'winaltkeys': [['menu', 'no'], ['', 'xxx']],
\
+1 -1
View File
@@ -386,7 +386,7 @@ let s:flaky_errors_re = 'StopVimInTerminal\|VerifyScreenDump'
redir @q
silent function /^Test_
redir END
let s:tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))
let s:tests = split(substitute(@q, '\(function\|def\) \(\k*()\)', '\2', 'g'))
" If there is an extra argument filter the function names against it.
if argc() > 1
+2 -2
View File
@@ -1156,7 +1156,7 @@ EOF
:$put =string(pyeval('dd') is# pyeval('dd'))
:$put =string(pyeval('df'))
:delfunction Put
py << EOF
py <<
del DupDict
del DupList
del DupFun
@@ -1164,7 +1164,7 @@ del dd
del dl
del dl2
del df
EOF
.
:"
:" Test chdir
py << EOF
-1
View File
@@ -7,7 +7,6 @@
source test_charsearch_utf8.vim
source test_expr_utf8.vim
source test_listlbr_utf8.vim
source test_matchadd_conceal_utf8.vim
source test_mksession_utf8.vim
source test_regexp_utf8.vim
source test_source_utf8.vim
+23
View File
@@ -562,3 +562,26 @@ func Test_shape_combination_isolated()
set arabicshape&
bwipe!
endfunc
" Test for entering arabic character in a search command
func Test_arabic_chars_in_search_cmd()
new
set arabic
call feedkeys("i\nsghl!\<C-^>vim\<C-^>", 'tx')
call cursor(1, 1)
call feedkeys("/^sghl!\<C-^>vim$\<C-^>\<CR>", 'tx')
call assert_equal([2, 1], [line('.'), col('.')])
" Try searching in left-to-right mode
set rightleftcmd=
call cursor(1, 1)
call feedkeys("/^sghl!\<C-^>vim$\<CR>", 'tx')
call assert_equal([2, 1], [line('.'), col('.')])
set rightleftcmd&
set rightleft&
set arabic&
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+5
View File
@@ -539,6 +539,11 @@ func Test_quit_with_arglist()
call term_wait(buf)
call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
only!
" When this test fails, swap files are left behind which breaks subsequent
" tests
call delete('.a.swp')
call delete('.b.swp')
call delete('.c.swp')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+2
View File
@@ -46,3 +46,5 @@ func Test_getchangelist()
call delete('Xfile1.txt')
call delete('Xfile2.txt')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+8 -3
View File
@@ -1992,15 +1992,20 @@ func Test_job_start_fails()
endfunc
func Test_issue_5150()
let g:job = job_start('grep foo', {})
if has('win32')
let cmd = 'cmd /c pause'
else
let cmd = 'grep foo'
endif
let g:job = job_start(cmd, {})
call job_stop(g:job)
sleep 10m
call assert_equal(-1, job_info(g:job).exitval)
let g:job = job_start('grep foo', {})
let g:job = job_start(cmd, {})
call job_stop(g:job, 'term')
sleep 10m
call assert_equal(-1, job_info(g:job).exitval)
let g:job = job_start('grep foo', {})
let g:job = job_start(cmd, {})
call job_stop(g:job, 'kill')
sleep 10m
call assert_equal(-1, job_info(g:job).exitval)
+14
View File
@@ -1,3 +1,4 @@
" Test for character search commands - t, T, f, F, ; and ,
func Test_charsearch()
enew!
@@ -60,3 +61,16 @@ func Test_search_cmds()
call assert_equal('ddd yee y', getline(6))
enew!
endfunc
" Test for character search in virtual edit mode with <Tab>
func Test_csearch_virtualedit()
new
set virtualedit=all
call setline(1, "a\tb")
normal! tb
call assert_equal([0, 1, 2, 6], getpos('.'))
set virtualedit&
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+10 -1
View File
@@ -5258,9 +5258,18 @@ func Test_cindent_case()
set cindent
norm! f:a:
call assert_equal('case x:: // x', getline(1))
set cindent&
bwipe!
endfunc
" Test for changing multiple lines (using c) with cindent
func Test_cindent_change_multline()
new
setlocal cindent
call setline(1, ['if (a)', '{', ' i = 1;', '}'])
normal! jc3jm = 2;
call assert_equal("\tm = 2;", getline(2))
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+279 -2
View File
@@ -14,6 +14,11 @@ func Test_complete_list()
" We can't see the output, but at least we check the code runs properly.
call feedkeys(":e test\<C-D>\r", "tx")
call assert_equal('test', expand('%:t'))
" If a command doesn't support completion, then CTRL-D should be literally
" used.
call feedkeys(":chistory \<C-D>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"chistory \<C-D>", @:)
endfunc
func Test_complete_wildmenu()
@@ -51,6 +56,11 @@ func Test_complete_wildmenu()
call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx')
call assert_equal('testfile1', getline(1))
" Test for canceling the wild menu by adding a character
redrawstatus
call feedkeys(":e Xdir1/\<Tab>x\<C-B>\"\<CR>", 'xt')
call assert_equal('"e Xdir1/Xdir2/x', @:)
" Completion using a relative path
cd Xdir1/Xdir2
call feedkeys(":e ../\<Tab>\<Right>\<Down>\<C-A>\<C-B>\"\<CR>", 'tx')
@@ -463,8 +473,27 @@ func Test_cmdline_paste()
endtry
call assert_equal("Xtestfile", bufname("%"))
" Use an invalid expression for <C-\>e
call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")')
" Try to paste an invalid register using <C-R>
call feedkeys(":\"one\<C-R>\<C-X>two\<CR>", 'xt')
call assert_equal('"onetwo', @:)
" Test for pasting register containing CTRL-H using CTRL-R and CTRL-R CTRL-R
let @a = "xy\<C-H>z"
call feedkeys(":\"\<C-R>a\<CR>", 'xt')
call assert_equal('"xz', @:)
call feedkeys(":\"\<C-R>\<C-R>a\<CR>", 'xt')
call assert_equal("\"xy\<C-H>z", @:)
call feedkeys(":\"\<C-R>\<C-O>a\<CR>", 'xt')
call assert_equal("\"xy\<C-H>z", @:)
" Test for pasting register containing CTRL-V using CTRL-R and CTRL-R CTRL-R
let @a = "xy\<C-V>z"
call feedkeys(":\"\<C-R>=@a\<CR>\<cr>", 'xt')
call assert_equal('"xyz', @:)
call feedkeys(":\"\<C-R>\<C-R>=@a\<CR>\<cr>", 'xt')
call assert_equal("\"xy\<C-V>z", @:)
call assert_beeps('call feedkeys(":\<C-R>=\<C-R>=\<Esc>", "xt")')
bwipe!
endfunc
@@ -540,6 +569,17 @@ func Test_cmdline_complete_user_cmd()
delcommand Foo
endfunc
func s:ScriptLocalFunction()
echo 'yes'
endfunc
func Test_cmdline_complete_user_func()
call feedkeys(":func Test_cmdline_complete_user\<Tab>\<Home>\"\<cr>", 'tx')
call assert_match('"func Test_cmdline_complete_user', @:)
call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx')
call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:)
endfunc
func Test_cmdline_complete_user_names()
if has('unix') && executable('whoami')
let whoami = systemlist('whoami')[0]
@@ -917,6 +957,10 @@ endfunc
func Test_cmdwin_feedkeys()
" This should not generate E488
call feedkeys("q:\<CR>", 'x')
" Using feedkeys with q: only should automatically close the cmd window
call feedkeys('q:', 'xt')
call assert_equal(1, winnr('$'))
call assert_equal('', getcmdwintype())
endfunc
" Tests for the issues fixed in 7.4.441.
@@ -1060,4 +1104,237 @@ func Test_cmdline_expand_home()
call delete('Xdir', 'rf')
endfunc
" Test for using CTRL-\ CTRL-G in the command line to go back to normal mode
" or insert mode (when 'insertmode' is set)
func Test_cmdline_ctrl_g()
new
call setline(1, 'abc')
call cursor(1, 3)
" If command line is entered from insert mode, using C-\ C-G should back to
" insert mode
call feedkeys("i\<C-O>:\<C-\>\<C-G>xy", 'xt')
call assert_equal('abxyc', getline(1))
call assert_equal(4, col('.'))
" If command line is entered in 'insertmode', using C-\ C-G should back to
" 'insertmode'
call feedkeys(":set im\<cr>\<C-L>:\<C-\>\<C-G>12\<C-L>:set noim\<cr>", 'xt')
call assert_equal('ab12xyc', getline(1))
close!
endfunc
" Return the 'len' characters in screen starting from (row,col)
func s:ScreenLine(row, col, len)
let s = ''
for i in range(a:len)
let s .= nr2char(screenchar(a:row, a:col + i))
endfor
return s
endfunc
" Test for 'wildmode'
func Test_wildmode()
func T(a, c, p)
return "oneA\noneB\noneC"
endfunc
command -nargs=1 -complete=custom,T MyCmd
func SaveScreenLine()
let g:Sline = s:ScreenLine(&lines - 1, 1, 20)
return ''
endfunc
cnoremap <expr> <F2> SaveScreenLine()
set nowildmenu
set wildmode=full,list
let g:Sline = ''
call feedkeys(":MyCmd \t\t\<F2>\<C-B>\"\<CR>", 'xt')
call assert_equal('oneA oneB oneC ', g:Sline)
call assert_equal('"MyCmd oneA', @:)
set wildmode=longest,full
call feedkeys(":MyCmd o\t\<C-B>\"\<CR>", 'xt')
call assert_equal('"MyCmd one', @:)
call feedkeys(":MyCmd o\t\t\t\t\<C-B>\"\<CR>", 'xt')
call assert_equal('"MyCmd oneC', @:)
set wildmode=longest
call feedkeys(":MyCmd one\t\t\<C-B>\"\<CR>", 'xt')
call assert_equal('"MyCmd one', @:)
set wildmode=list:longest
let g:Sline = ''
call feedkeys(":MyCmd \t\<F2>\<C-B>\"\<CR>", 'xt')
call assert_equal('oneA oneB oneC ', g:Sline)
call assert_equal('"MyCmd one', @:)
set wildmode=""
call feedkeys(":MyCmd \t\t\<C-B>\"\<CR>", 'xt')
call assert_equal('"MyCmd oneA', @:)
delcommand MyCmd
delfunc T
delfunc SaveScreenLine
cunmap <F2>
set wildmode&
endfunc
" Test for interrupting the command-line completion
func Test_interrupt_compl()
func F(lead, cmdl, p)
if a:lead =~ 'tw'
call interrupt()
return
endif
return "one\ntwo\nthree"
endfunc
command -nargs=1 -complete=custom,F Tcmd
set nowildmenu
set wildmode=full
let interrupted = 0
try
call feedkeys(":Tcmd tw\<Tab>\<C-B>\"\<CR>", 'xt')
catch /^Vim:Interrupt$/
let interrupted = 1
endtry
call assert_equal(1, interrupted)
delcommand Tcmd
delfunc F
set wildmode&
endfunc
" Test for moving the cursor on the : command line
func Test_cmdline_edit()
let str = ":one two\<C-U>"
let str ..= "one two\<C-W>\<C-W>"
let str ..= "four\<BS>\<C-H>\<Del>\<kDel>"
let str ..= "\<Left>five\<Right>"
let str ..= "\<Home>two "
let str ..= "\<C-Left>one "
let str ..= "\<C-Right> three"
let str ..= "\<End>\<S-Left>four "
let str ..= "\<S-Right> six"
let str ..= "\<C-B>\"\<C-E> seven\<CR>"
call feedkeys(str, 'xt')
call assert_equal("\"one two three four five six seven", @:)
endfunc
" Test for moving the cursor on the / command line in 'rightleft' mode
func Test_cmdline_edit_rightleft()
CheckFeature rightleft
set rightleft
set rightleftcmd=search
let str = "/one two\<C-U>"
let str ..= "one two\<C-W>\<C-W>"
let str ..= "four\<BS>\<C-H>\<Del>\<kDel>"
let str ..= "\<Right>five\<Left>"
let str ..= "\<Home>two "
let str ..= "\<C-Right>one "
let str ..= "\<C-Left> three"
let str ..= "\<End>\<S-Right>four "
let str ..= "\<S-Left> six"
let str ..= "\<C-B>\"\<C-E> seven\<CR>"
call assert_fails("call feedkeys(str, 'xt')", 'E486:')
call assert_equal("\"one two three four five six seven", @/)
set rightleftcmd&
set rightleft&
endfunc
" Test for using <C-\>e in the command line to evaluate an expression
func Test_cmdline_expr()
" Evaluate an expression from the beginning of a command line
call feedkeys(":abc\<C-B>\<C-\>e\"\\\"hello\"\<CR>\<CR>", 'xt')
call assert_equal('"hello', @:)
" Use an invalid expression for <C-\>e
call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")')
" Insert literal <CTRL-\> in the command line
call feedkeys(":\"e \<C-\>\<C-Y>\<CR>", 'xt')
call assert_equal("\"e \<C-\>\<C-Y>", @:)
endfunc
" Test for 'imcmdline' and 'imsearch'
" This test doesn't actually test the input method functionality.
func Test_cmdline_inputmethod()
new
call setline(1, ['', 'abc', ''])
set imcmdline
call feedkeys(":\"abc\<CR>", 'xt')
call assert_equal("\"abc", @:)
call feedkeys(":\"\<C-^>abc\<C-^>\<CR>", 'xt')
call assert_equal("\"abc", @:)
call feedkeys("/abc\<CR>", 'xt')
call assert_equal([2, 1], [line('.'), col('.')])
call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
call assert_equal([2, 1], [line('.'), col('.')])
set imsearch=2
call cursor(1, 1)
call feedkeys("/abc\<CR>", 'xt')
call assert_equal([2, 1], [line('.'), col('.')])
call cursor(1, 1)
call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
call assert_equal([2, 1], [line('.'), col('.')])
set imdisable
call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
call assert_equal([2, 1], [line('.'), col('.')])
set imdisable&
set imsearch&
set imcmdline&
%bwipe!
endfunc
" Test for opening the command-line window when too many windows are present
func Test_cmdwin_fail_to_open()
" Open as many windows as possible
for i in range(100)
try
new
catch /E36:/
break
endtry
endfor
call assert_beeps('call feedkeys("q:\<CR>", "xt")')
only
endfunc
" Test for recursively getting multiple command line inputs
func Test_cmdwin_multi_input()
call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
call assert_equal('"cyan', @:)
endfunc
" Test for using CTRL-_ in the command line with 'allowrevins'
func Test_cmdline_revins()
CheckNotMSWindows
CheckFeature rightleft
call feedkeys(":\"abc\<c-_>\<cr>", 'xt')
call assert_equal("\"abc\<c-_>", @:)
set allowrevins
call feedkeys(":\"abc\<c-_>xyz\<c-_>\<CR>", 'xt')
call assert_equal('"abcñèæ', @:)
set allowrevins&
endfunc
" Test for typing UTF-8 composing characters in the command line
func Test_cmdline_composing_chars()
call feedkeys(":\"\<C-V>u3046\<C-V>u3099\<CR>", 'xt')
call assert_equal('"ゔ', @:)
endfunc
" Test for normal mode commands not supported in the cmd window
func Test_cmdwin_blocked_commands()
call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:Q\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:Z\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:\<F1>\<CR>", "xt")', 'E11:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+6 -4
View File
@@ -451,10 +451,12 @@ endfunc
func Test_digraph_cmndline()
" Create digraph on commandline
" This is a hack, to let Vim create the digraph in commandline mode
let s = ''
exe "sil! norm! :let s.='\<c-k>Eu'\<cr>"
call assert_equal("€", s)
call feedkeys(":\"\<c-k>Eu\<cr>", 'xt')
call assert_equal('"€', @:)
" Canceling a CTRL-K on the cmdline
call feedkeys(":\"a\<c-k>\<esc>b\<cr>", 'xt')
call assert_equal('"ab', @:)
endfunc
func Test_show_digraph()
+37 -1
View File
@@ -265,6 +265,10 @@ func Test_edit_10()
call cursor(1, 4)
call feedkeys("A\<s-home>start\<esc>", 'txin')
call assert_equal(['startdef', 'ghi'], getline(1, '$'))
" start select mode again with gv
set selectmode=cmd
call feedkeys('gvabc', 'xt')
call assert_equal('abctdef', getline(1))
set selectmode= keymodel=
bw!
endfunc
@@ -277,7 +281,7 @@ func Test_edit_11()
call cursor(2, 1)
call feedkeys("i\<c-f>int c;\<esc>", 'tnix')
call cursor(3, 1)
call feedkeys("i/* comment */", 'tnix')
call feedkeys("\<Insert>/* comment */", 'tnix')
call assert_equal(['{', "\<tab>int c;", "/* comment */"], getline(1, '$'))
" added changed cindentkeys slightly
set cindent cinkeys+=*/
@@ -1536,4 +1540,36 @@ func Test_edit_noesckeys()
set esckeys
endfunc
" Test for running an invalid ex command in insert mode using CTRL-O
" Note that vim has a hard-coded sleep of 3 seconds. So this test will take
" more than 3 seconds to complete.
func Test_edit_ctrl_o_invalid_cmd()
new
set showmode showcmd
let caught_e492 = 0
try
call feedkeys("i\<C-O>:invalid\<CR>abc\<Esc>", "xt")
catch /E492:/
let caught_e492 = 1
endtry
call assert_equal(1, caught_e492)
call assert_equal('abc', getline(1))
set showmode& showcmd&
close!
endfunc
" Test for inserting text at the beginning of a line
func Test_insert_before_first_nonblank()
new
call setline(1, ' ')
normal! Ia
call assert_equal(' a', getline(1))
set cpo+=H
call setline(1, ' ')
normal! Ia
call assert_equal(' a ', getline(1))
set cpo-=H
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+50 -1
View File
@@ -49,6 +49,13 @@ func Test_ex_mode()
call assert_equal([' foo', ' foo'], Ex(" foo\<C-d>"), e)
call assert_equal(['foo', ' foo0'], Ex(" foo0\<C-d>"), e)
call assert_equal(['foo', ' foo^'], Ex(" foo^\<C-d>"), e)
call assert_equal(['foo', 'foo'],
\ Ex("\<BS>\<C-H>\<Del>\<kDel>foo"), e)
" default wildchar <Tab> interferes with this test
set wildchar=<c-e>
call assert_equal(["a\tb", "a\tb"], Ex("a\t\t\<C-H>b"), e)
call assert_equal(["\t mn", "\tm\<C-T>n"], Ex("\tm\<C-T>n"), e)
set wildchar&
endfor
set sw&
@@ -116,10 +123,52 @@ endfunc
func Test_Ex_global()
new
call setline(1, ['', 'foo', 'bar', 'foo', 'bar', 'foo'])
call feedkeys("Qg/bar/visual\<CR>$rxQ$ryQvisual\<CR>j", "xt")
call feedkeys("Q\<bs>g/bar/visual\<CR>$rxQ$ryQvisual\<CR>j", "xt")
call assert_equal('bax', getline(3))
call assert_equal('bay', getline(5))
bwipe!
endfunc
" In Ex-mode, a backslash escapes a newline
func Test_Ex_escape_enter()
call feedkeys("gQlet l = \"a\\\<kEnter>b\"\<cr>vi\<cr>", 'xt')
call assert_equal("a\rb", l)
endfunc
" Test for :append! command in Ex mode
func Test_Ex_append()
new
call setline(1, "\t abc")
call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt')
call assert_equal(["\t abc", "\t pqr", "\t xyz"], getline(1, '$'))
close!
endfunc
" In Ex-mode, backslashes at the end of a command should be halved.
func Test_Ex_echo_backslash()
" This test works only when the language is English
if v:lang != "C" && v:lang !~ '^[Ee]n'
return
endif
let bsl = '\\\\'
let bsl2 = '\\\'
call assert_fails('call feedkeys("Qecho " .. bsl .. "\nvisual\n", "xt")',
\ "E15: Invalid expression: \\\\")
call assert_fails('call feedkeys("Qecho " .. bsl2 .. "\nm\nvisual\n", "xt")',
\ "E15: Invalid expression: \\\nm")
endfunc
func Test_ex_mode_errors()
" Not allowed to enter ex mode when text is locked
au InsertCharPre <buffer> normal! gQ<CR>
let caught_e523 = 0
try
call feedkeys("ix\<esc>", 'xt')
catch /^Vim\%((\a\+)\)\=:E523/ " catch E523
let caught_e523 = 1
endtry
call assert_equal(1, caught_e523)
au! InsertCharPre
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+4
View File
@@ -57,6 +57,10 @@ func Test_copy()
1,3copy 2
call assert_equal(['L1', 'L2', 'L1', 'L2', 'L3', 'L3', 'L4'], getline(1, 7))
" Specifying a count before using : to run an ex-command
exe "normal! gg4:yank\<CR>"
call assert_equal("L1\nL2\nL1\nL2\n", @")
close!
endfunc
+14
View File
@@ -73,3 +73,17 @@ func Test_expand()
" Don't add any line above this, otherwise <slnum> will change.
quit
endfunc
" Test for 'wildignore' with expand()
func Test_expand_wildignore()
set wildignore=*.vim
call assert_equal('', expand('test_expand_func.vim'))
call assert_equal('', expand('test_expand_func.vim', 0))
call assert_equal([], expand('test_expand_func.vim', 0, 1))
call assert_equal('test_expand_func.vim', expand('test_expand_func.vim', 1))
call assert_equal(['test_expand_func.vim'],
\ expand('test_expand_func.vim', 1, 1))
set wildignore&
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+1
View File
@@ -601,6 +601,7 @@ let s:script_checks = {
\ 'haskell': [['#!/path/haskell']],
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
\ ['// -*- C++ -*-']],
\ 'yaml': [['%YAML 1.2']],
\ }
func Test_script_detection()
+26
View File
@@ -58,6 +58,19 @@ func Test_empty()
call assert_equal(0, empty(function('Test_empty')))
call assert_equal(0, empty(function('Test_empty', [0])))
call assert_fails("call empty(test_void())", 'E685:')
call assert_fails("call empty(test_unknown())", 'E685:')
endfunc
func Test_test_void()
call assert_fails('echo 1 == test_void()', 'E685:')
if has('float')
call assert_fails('echo 1.0 == test_void()', 'E685:')
endif
call assert_fails('let x = json_encode(test_void())', 'E685:')
call assert_fails('let x = copy(test_void())', 'E685:')
call assert_fails('let x = copy([test_void()])', 'E685:')
endfunc
func Test_len()
@@ -1162,6 +1175,19 @@ func Test_input_func()
\ .. "\<C-A>\<CR>", 'xt')
delfunc Tcomplete
call assert_equal('item1 item2 item3', c)
call assert_fails("call input('F:', '', 'invalid')", 'E180:')
call assert_fails("call input('F:', '', [])", 'E730:')
endfunc
" Test for the inputdialog() function
func Test_inputdialog()
CheckNotGui
call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<CR>", 'xt')
call assert_equal('xx', v)
call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<Esc>", 'xt')
call assert_equal('yy', v)
endfunc
" Test for inputlist()
+15
View File
@@ -130,5 +130,20 @@ func Test_gf_error()
call setline(1, '/doesnotexist')
call assert_fails('normal gf', 'E447:')
call assert_fails('normal gF', 'E447:')
call assert_fails('normal [f', 'E447:')
" gf is not allowed when text is locked
au InsertCharPre <buffer> normal! gF<CR>
let caught_e523 = 0
try
call feedkeys("ix\<esc>", 'xt')
catch /^Vim\%((\a\+)\)\=:E523/ " catch E523
let caught_e523 = 1
endtry
call assert_equal(1, caught_e523)
au! InsertCharPre
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+125 -44
View File
@@ -1,39 +1,137 @@
" Test :hardcopy
func Test_printoptions_parsing()
" Only test that this doesn't throw an error.
set printoptions=left:5in,right:10pt,top:8mm,bottom:2pc
set printoptions=left:2in,top:30pt,right:16mm,bottom:3pc
set printoptions=header:3,syntax:y,number:7,wrap:n
set printoptions=duplex:short,collate:n,jobsplit:y,portrait:n
set printoptions=paper:10x14
set printoptions=paper:A3
set printoptions=paper:A4
set printoptions=paper:A5
set printoptions=paper:B4
set printoptions=paper:B5
set printoptions=paper:executive
set printoptions=paper:folio
set printoptions=paper:ledger
set printoptions=paper:legal
set printoptions=paper:letter
set printoptions=paper:quarto
set printoptions=paper:statement
set printoptions=paper:tabloid
set printoptions=formfeed:y
set printoptions=
set printoptions&
func Test_printoptions()
edit test_hardcopy.vim
syn on
for opt in ['left:5in,right:10pt,top:8mm,bottom:2pc',
\ 'left:2in,top:30pt,right:16mm,bottom:3pc',
\ 'header:3,syntax:y,number:y,wrap:n',
\ 'header:3,syntax:n,number:y,wrap:y',
\ 'duplex:short,collate:n,jobsplit:y,portrait:n',
\ 'duplex:long,collate:y,jobsplit:n,portrait:y',
\ 'paper:10x14',
\ 'paper:A3',
\ 'paper:A4',
\ 'paper:A5',
\ 'paper:B4',
\ 'paper:B5',
\ 'paper:executive',
\ 'paper:folio',
\ 'paper:ledger',
\ 'paper:legal',
\ 'paper:letter',
\ 'paper:quarto',
\ 'paper:statement',
\ 'paper:tabloid',
\ 'formfeed:y',
\ '']
exe 'set printoptions=' .. opt
if has('postscript')
hardcopy > Xhardcopy_printoptions
let lines = readfile('Xhardcopy_printoptions')
call assert_true(len(lines) > 20, opt)
call assert_true(lines[0] =~ 'PS-Adobe', opt)
call delete('Xhardcopy_printoptions')
endif
endfor
call assert_fails('set printoptions=paper', 'E550:')
call assert_fails('set printoptions=shredder:on', 'E551:')
call assert_fails('set printoptions=left:no', 'E552:')
set printoptions&
bwipe
endfunc
func Test_printmbfont_parsing()
" Only test that this doesn't throw an error.
set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no
set printmbfont=
func Test_printmbfont()
" Print a small help page which contains tabs to cover code that expands tabs to spaces.
help help
syn on
for opt in [':WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no',
\ '']
exe 'set printmbfont=' .. opt
if has('postscript')
hardcopy > Xhardcopy_printmbfont
let lines = readfile('Xhardcopy_printmbfont')
call assert_true(len(lines) > 20, opt)
call assert_true(lines[0] =~ 'PS-Adobe', opt)
call delete('Xhardcopy_printmbfont')
endif
endfor
set printmbfont&
bwipe
endfunc
func Test_printexpr()
if !has('unix')
return
endif
" Not a very useful printexpr value, but enough to test
" hardcopy with 'printexpr'.
function PrintFile(fname)
call writefile(['Test printexpr: ' .. v:cmdarg],
\ 'Xhardcopy_printexpr')
call delete(a:fname)
return 0
endfunc
set printexpr=PrintFile(v:fname_in)
help help
hardcopy dummy args
call assert_equal(['Test printexpr: dummy args'],
\ readfile('Xhardcopy_printexpr'))
call delete('Xhardcopy_printexpr')
" Function return 1 to test print failure.
function PrintFails(fname)
call delete(a:fname)
return 1
endfunc
set printexpr=PrintFails(v:fname_in)
call assert_fails('hardcopy', 'E365:')
set printexpr&
bwipe
endfunc
func Test_errors()
" FIXME: Windows fails differently than Unix.
if has('unix')
edit test_hardcopy.vim
call assert_fails('hardcopy >', 'E324:')
bwipe
endif
endfunc
func Test_dark_background()
edit test_hardcopy.vim
syn on
for bg in ['dark', 'light']
exe 'set background=' .. bg
if has('postscript')
hardcopy > Xhardcopy_dark_background
let lines = readfile('Xhardcopy_dark_background')
call assert_true(len(lines) > 20)
call assert_true(lines[0] =~ 'PS-Adobe')
call delete('Xhardcopy_dark_background')
endif
endfor
set background&
bwipe
endfun
func Test_empty_buffer()
" FIXME: Unclear why this fails on Windows.
if has('unix')
new
call assert_equal("\nNo text to be printed", execute('hardcopy'))
bwipe
endif
endfunc
func Test_printheader_parsing()
@@ -46,22 +144,6 @@ func Test_printheader_parsing()
set printheader&
endfunc
" Test that :hardcopy produces a non-empty file.
" We don't check much of the contents.
func Test_with_syntax()
if has('postscript')
edit test_hardcopy.vim
set printoptions=syntax:y
syn on
hardcopy > Xhardcopy
let lines = readfile('Xhardcopy')
call assert_true(len(lines) > 20)
call assert_true(lines[0] =~ 'PS-Adobe')
call delete('Xhardcopy')
set printoptions&
endif
endfunc
func Test_fname_with_spaces()
if !has('postscript')
return
@@ -86,4 +168,3 @@ func Test_illegal_byte()
bwipe!
call delete('Xpstest')
endfunc
+76 -2
View File
@@ -70,6 +70,14 @@ function History_Tests(hist)
call assert_equal('', histget(a:hist, i))
call assert_equal('', histget(a:hist, i - 7 - 1))
endfor
" Test for freeing an entry at the beginning of the history list
for i in range(1, 4)
call histadd(a:hist, 'text_' . i)
endfor
call histdel(a:hist, 1)
call assert_equal('', histget(a:hist, 1))
call assert_equal('text_4', histget(a:hist, 4))
endfunction
function Test_History()
@@ -106,6 +114,7 @@ function Test_Search_history_window()
bwipe!
endfunc
" Test for :history command option completion
function Test_history_completion()
call feedkeys(":history \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"history / : = > ? @ all cmd debug expr input search', @:)
@@ -114,15 +123,16 @@ endfunc
" Test for increasing the 'history' option value
func Test_history_size()
let save_histsz = &history
set history=10
call histadd(':', 'ls')
call histdel(':')
set history=5
for i in range(1, 5)
call histadd(':', 'cmd' .. i)
endfor
call assert_equal(5, histnr(':'))
call assert_equal('cmd5', histget(':', -1))
set history=10
set history=15
for i in range(6, 10)
call histadd(':', 'cmd' .. i)
endfor
@@ -137,6 +147,15 @@ func Test_history_size()
call assert_equal('cmd7', histget(':', 7))
call assert_equal('abc', histget(':', -1))
" This test works only when the language is English
if v:lang == "C" || v:lang =~ '^[Ee]n'
set history=0
redir => v
call feedkeys(":history\<CR>", 'xt')
redir END
call assert_equal(["'history' option is zero"], split(v, "\n"))
endif
let &history=save_histsz
endfunc
@@ -156,6 +175,61 @@ func Test_history_search()
call assert_equal(['pat2', 'pat1', ''], g:pat)
cunmap <F2>
delfunc SavePat
" Search for a pattern that is not present in the history
call assert_beeps('call feedkeys("/a1b2\<Up>\<CR>", "xt")')
" Recall patterns with 'history' set to 0
set history=0
let @/ = 'abc'
let cmd = 'call feedkeys("/\<Up>\<Down>\<S-Up>\<S-Down>\<CR>", "xt")'
call assert_fails(cmd, 'E486:')
set history&
" Recall patterns till the end of history
set history=4
call histadd('/', 'pat')
call histdel('/')
call histadd('/', 'pat1')
call histadd('/', 'pat2')
call assert_beeps('call feedkeys("/\<Up>\<Up>\<Up>\<C-U>\<cr>", "xt")')
call assert_beeps('call feedkeys("/\<Down><cr>", "xt")')
" Test for wrapping around the history list
for i in range(3, 7)
call histadd('/', 'pat' .. i)
endfor
let upcmd = "\<up>\<up>\<up>\<up>\<up>"
let downcmd = "\<down>\<down>\<down>\<down>\<down>"
try
call feedkeys("/" .. upcmd .. "\<cr>", 'xt')
catch /E486:/
endtry
call assert_equal('pat4', @/)
try
call feedkeys("/" .. upcmd .. downcmd .. "\<cr>", 'xt')
catch /E486:/
endtry
call assert_equal('pat4', @/)
" Test for changing the search command separator in the history
call assert_fails('call feedkeys("/def/\<cr>", "xt")', 'E486:')
call assert_fails('call feedkeys("?\<up>\<cr>", "xt")', 'E486:')
call assert_equal('def?', histget('/', -1))
call assert_fails('call feedkeys("/ghi?\<cr>", "xt")', 'E486:')
call assert_fails('call feedkeys("?\<up>\<cr>", "xt")', 'E486:')
call assert_equal('ghi\?', histget('/', -1))
set history&
endfunc
" Test for making sure the key value is not stored in history
func Test_history_crypt_key()
CheckFeature cryptv
call feedkeys(":set bs=2 key=abc ts=8\<CR>", 'xt')
call assert_equal('set bs=2 key= ts=8', histget(':'))
set key& bs& ts&
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+22
View File
@@ -62,3 +62,25 @@ func Test_getimstatus()
set imactivatefunc=
set imstatusfunc=
endfunc
" Test for using an lmap in insert mode
func Test_lmap_in_insert_mode()
new
call setline(1, 'abc')
lmap { w
set iminsert=1
call feedkeys('r{', 'xt')
call assert_equal('wbc', getline(1))
set iminsert=2
call feedkeys('$r{', 'xt')
call assert_equal('wb{', getline(1))
call setline(1, 'vim web')
set iminsert=1
call feedkeys('0f{', 'xt')
call assert_equal(5, col('.'))
set iminsert&
lunmap {
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+8
View File
@@ -775,6 +775,14 @@ func Test_increment_empty_line()
call setline(1, ['0', '0', '0', '0', '0', '0', ''])
exe "normal Gvgg\<C-A>"
call assert_equal(['1', '1', '1', '1', '1', '1', ''], getline(1, 7))
" Ctrl-A/Ctrl-X should do nothing in operator pending mode
%d
call setline(1, 'one two')
exe "normal! c\<C-A>l"
exe "normal! c\<C-X>l"
call assert_equal('one two', getline(1))
bwipe!
endfunc
+143
View File
@@ -0,0 +1,143 @@
" Test for various indent options
func Test_preserveindent()
new
" Test for autoindent copying indent from the previous line
setlocal autoindent
call setline(1, [repeat(' ', 16) .. 'line1'])
call feedkeys("A\nline2", 'xt')
call assert_equal("\t\tline2", getline(2))
setlocal autoindent&
" Test for using CTRL-T with and without 'preserveindent'
set shiftwidth=4
call cursor(1, 1)
call setline(1, " \t ")
call feedkeys("Al\<C-T>", 'xt')
call assert_equal("\t\tl", getline(1))
set preserveindent
call setline(1, " \t ")
call feedkeys("Al\<C-T>", 'xt')
call assert_equal(" \t \tl", getline(1))
set pi& sw&
" Test for using CTRL-T with 'expandtab' and 'preserveindent'
call cursor(1, 1)
call setline(1, "\t \t")
set shiftwidth=4 expandtab preserveindent
call feedkeys("Al\<C-T>", 'xt')
call assert_equal("\t \t l", getline(1))
set sw& et& pi&
close!
endfunc
" Test for indent()
func Test_indent_func()
call assert_equal(-1, indent(-1))
new
call setline(1, "\tabc")
call assert_equal(8, indent(1))
call setline(1, " abc")
call assert_equal(4, indent(1))
call setline(1, " \t abc")
call assert_equal(12, indent(1))
close!
endfunc
" Test for reindenting a line using the '=' operator
func Test_reindent()
new
call setline(1, 'abc')
set nomodifiable
call assert_fails('normal ==', 'E21:')
set modifiable
call setline(1, ['foo', 'bar'])
call feedkeys('ggVG=', 'xt')
call assert_equal(['foo', 'bar'], getline(1, 2))
close!
endfunc
" Test for shifting a line with a preprocessor directive ('#')
func Test_preproc_indent()
new
set sw=4
call setline(1, '#define FOO 1')
normal >>
call assert_equal(' #define FOO 1', getline(1))
" with 'smartindent'
call setline(1, '#define FOO 1')
set smartindent
normal >>
call assert_equal('#define FOO 1', getline(1))
set smartindent&
" with 'cindent'
set cindent
normal >>
call assert_equal('#define FOO 1', getline(1))
set cindent&
close!
endfunc
" Test for 'copyindent'
func Test_copyindent()
new
set shiftwidth=4 autoindent expandtab copyindent
call setline(1, " \t abc")
call feedkeys("ol", 'xt')
call assert_equal(" \t l", getline(2))
set noexpandtab
call setline(1, " \t abc")
call feedkeys("ol", 'xt')
call assert_equal(" \t l", getline(2))
set sw& ai& et& ci&
close!
endfunc
" Test for changing multiple lines with lisp indent
func Test_lisp_indent_change_multiline()
new
setlocal lisp autoindent
call setline(1, ['(if a', ' (if b', ' (return 5)))'])
normal! jc2j(return 4))
call assert_equal(' (return 4))', getline(2))
close!
endfunc
func Test_lisp_indent()
new
setlocal lisp autoindent
call setline(1, ['(if a', ' ;; comment', ' \ abc', '', ' " str1\', ' " st\b', ' (return 5)'])
normal! jo;; comment
normal! jo\ abc
normal! jo;; ret
normal! jostr1"
normal! jostr2"
call assert_equal([' ;; comment', ' ;; comment', ' \ abc', ' \ abc', '', ' ;; ret', ' " str1\', ' str1"', ' " st\b', ' str2"'], getline(2, 11))
close!
endfunc
" Test for setting the 'indentexpr' from a modeline
func Test_modeline_indent_expr()
let modeline = &modeline
set modeline
func GetIndent()
return line('.') * 2
endfunc
call writefile(['# vim: indentexpr=GetIndent()'], 'Xfile.txt')
set modelineexpr
new Xfile.txt
call assert_equal('GetIndent()', &indentexpr)
exe "normal Oa\nb\n"
call assert_equal([' a', ' b'], getline(1, 2))
set modelineexpr&
delfunc GetIndent
let &modeline = modeline
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+3
View File
@@ -45,6 +45,7 @@ func Test_lisp_indent()
\ ])
call assert_equal(7, lispindent(2))
call assert_equal(5, 6->lispindent())
call assert_equal(-1, lispindent(-1))
set lisp
set lispwords&
@@ -83,3 +84,5 @@ func Test_lisp_indent()
let &cpoptions=save_copt
set nolisp
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+13
View File
@@ -326,3 +326,16 @@ func Test_listener_cleared_newbuf()
bwipe!
delfunc Listener
endfunc
func Test_col_after_deletion_moved_cur()
func Listener(bufnr, start, end, added, changes)
call assert_equal([#{lnum: 1, end: 2, added: 0, col: 2}], a:changes)
endfunc
new
call setline(1, ['foo'])
let lid = listener_add('Listener')
call feedkeys("lD", 'xt')
call listener_flush()
bwipe!
delfunc Listener
endfunc
+24
View File
@@ -195,6 +195,7 @@ func Test_mark_error()
call assert_fails('mark', 'E471:')
call assert_fails('mark xx', 'E488:')
call assert_fails('mark _', 'E191:')
call assert_beeps('normal! m~')
endfunc
" Test for :lockmarks when pasting content
@@ -221,4 +222,27 @@ func Test_marks_k_cmd()
close!
endfunc
" Test for file marks (A-Z)
func Test_file_mark()
new Xone
call setline(1, ['aaa', 'bbb'])
norm! G$mB
w!
new Xtwo
call setline(1, ['ccc', 'ddd'])
norm! GmD
w!
enew
normal! `B
call assert_equal('Xone', bufname())
call assert_equal([2, 3], [line('.'), col('.')])
normal! 'D
call assert_equal('Xtwo', bufname())
call assert_equal([2, 1], [line('.'), col('.')])
call delete('Xone')
call delete('Xtwo')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+344 -47
View File
@@ -54,7 +54,7 @@ func OpfuncDummy(type, ...)
let g:bufnr=bufnr('%')
endfunc
fun! Test_normal00_optrans()
func Test_normal00_optrans()
new
call append(0, ['1 This is a simple test: abcd', '2 This is the second line', '3 this is the third line'])
1
@@ -95,6 +95,12 @@ func Test_normal01_keymodel()
50
call feedkeys("\<S-Up>y", 'tx')
call assert_equal(['49', '5'], getreg(0, 0, 1))
" Use the different Shift special keys
50
call feedkeys("\<S-Right>\<S-Left>\<S-Up>\<S-Down>\<S-Home>\<S-End>y", 'tx')
call assert_equal(['50'], getline("'<", "'>"))
call assert_equal(['50', ''], getreg(0, 0, 1))
" Do not start visual mode when keymodel=
set keymodel=
50
@@ -115,8 +121,8 @@ func Test_normal01_keymodel()
bw!
endfunc
" Test for select mode
func Test_normal02_selectmode()
" some basic select mode tests
call Setup_NewWindow()
50
norm! gHy
@@ -434,13 +440,33 @@ func Test_normal11_showcmd()
bw!
endfunc
" Test for nv_error and normal command errors
func Test_normal12_nv_error()
" Test for nv_error
10new
call setline(1, range(1,5))
" should not do anything, just beep
exe "norm! <c-k>"
call assert_beeps('exe "norm! <c-k>"')
call assert_equal(map(range(1,5), 'string(v:val)'), getline(1,'$'))
call assert_beeps('normal! G2dd')
call assert_beeps("normal! g\<C-A>")
call assert_beeps("normal! g\<C-X>")
call assert_beeps("normal! g\<C-B>")
call assert_beeps("normal! vQ\<Esc>")
call assert_beeps("normal! 2[[")
call assert_beeps("normal! 2]]")
call assert_beeps("normal! 2[]")
call assert_beeps("normal! 2][")
call assert_beeps("normal! 4[z")
call assert_beeps("normal! 4]z")
call assert_beeps("normal! 4[c")
call assert_beeps("normal! 4]c")
call assert_beeps("normal! 200%")
call assert_beeps("normal! %")
call assert_beeps("normal! 2{")
call assert_beeps("normal! 2}")
call assert_beeps("normal! r\<Right>")
call assert_beeps("normal! 8ry")
call assert_beeps('normal! "@')
bw!
endfunc
@@ -496,6 +522,12 @@ func Test_normal14_page_eol()
bw!
endfunc
" Test for errors with z command
func Test_normal_z_error()
call assert_beeps('normal! z2p')
call assert_beeps('normal! zp')
endfunc
func Test_normal15_z_scroll_vert()
" basic test for z commands that scroll the window
call Setup_NewWindow()
@@ -596,6 +628,13 @@ func Test_normal16_z_scroll_hor()
$put =lineB
1d
" Test for zl and zh with a count
norm! 0z10l
call assert_equal([11, 1], [col('.'), wincol()])
norm! z4h
call assert_equal([11, 5], [col('.'), wincol()])
normal! 2gg
" Test for zl
1
norm! 5zl
@@ -718,6 +757,27 @@ func Test_normal17_z_scroll_hor2()
bw!
endfunc
" Test for H, M and L commands with folds
func Test_scroll_cmds()
15new
call setline(1, range(1, 100))
exe "normal! 30ggz\<CR>"
set foldenable
33,36fold
40,43fold
46,49fold
let h = winheight(0)
" Top of the screen = 30
" Folded lines = 9
" Bottom of the screen = 30 + h + 9 - 1
normal! 4L
call assert_equal(35 + h, line('.'))
normal! 4H
call assert_equal(33, line('.'))
set foldenable&
close!
endfunc
func Test_normal18_z_fold()
" basic tests for foldopen/folddelete
if !has("folding")
@@ -727,6 +787,9 @@ func Test_normal18_z_fold()
50
setl foldenable fdm=marker foldlevel=5
call assert_beeps('normal! zj')
call assert_beeps('normal! zk')
" Test for zF
" First fold
norm! 4zF
@@ -1153,6 +1216,9 @@ func Test_normal22_zet()
let a = readfile('Xfile')
call assert_equal(['1', '2'], a)
" Unsupported Z command
call assert_beeps('normal! ZW')
" clean up
for file in ['Xfile']
call delete(file)
@@ -1221,6 +1287,15 @@ func Test_normal23_K()
call assert_match("man --pager=cat 'man'", a)
endif
" Error cases
call setline(1, '#$#')
call assert_fails('normal! ggK', 'E349:')
call setline(1, '---')
call assert_fails('normal! ggv2lK', 'E349:')
call setline(1, ['abc', 'xyz'])
call assert_fails("normal! gg2lv2h\<C-]>", 'E426:')
call assert_beeps("normal! ggVjK")
" clean up
let &keywordprg = k
bw!
@@ -1379,8 +1454,8 @@ func Test_normal27_bracket()
bw!
endfunc
" Test for ( and ) sentence movements
func Test_normal28_parenthesis()
" basic testing for ( and )
new
call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here'])
@@ -1398,12 +1473,27 @@ func Test_normal28_parenthesis()
norm! $d(
call assert_equal(['With some sentences!', '', ' ', '', 'This is a long sentence', ''], getline(1, '$'))
" It is an error if a next sentence is not found
%d
call setline(1, '.SH')
call assert_beeps('normal )')
" Jumping to a fold should open the fold
call setline(1, ['', '', 'one', 'two', 'three'])
set foldenable
2,$fold
call feedkeys(')', 'xt')
call assert_equal(3, line('.'))
call assert_equal(1, foldlevel('.'))
call assert_equal(-1, foldclosed('.'))
set foldenable&
" clean up
bw!
endfunc
fun! Test_normal29_brace()
" basic test for { and } movements
" Test for { and } paragraph movements
func Test_normal29_brace()
let text =<< trim [DATA]
A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs'
@@ -1557,12 +1647,24 @@ fun! Test_normal29_brace()
[DATA]
call assert_equal(expected, getline(1, '$'))
" Jumping to a fold should open the fold
%d
call setline(1, ['', 'one', 'two', ''])
set foldenable
2,$fold
call feedkeys('}', 'xt')
call assert_equal(4, line('.'))
call assert_equal(1, foldlevel('.'))
call assert_equal(-1, foldclosed('.'))
set foldenable&
" clean up
set cpo-={
bw!
endfunc
fun! Test_normal30_changecase()
" Test for ~ command
func Test_normal30_changecase()
new
call append(0, 'This is a simple test: äüöß')
norm! 1ggVu
@@ -1582,8 +1684,23 @@ fun! Test_normal30_changecase()
norm! V~
call assert_equal('THIS IS A simple test: äüöss', getline('.'))
" Turkish ASCII turns to multi-byte. On some systems Turkish locale
" is available but toupper()/tolower() don't do the right thing.
" Test for changing case across lines using 'whichwrap'
call setline(1, ['aaaaaa', 'aaaaaa'])
normal! gg10~
call assert_equal(['AAAAAA', 'aaaaaa'], getline(1, 2))
set whichwrap+=~
normal! gg10~
call assert_equal(['aaaaaa', 'AAAAaa'], getline(1, 2))
set whichwrap&
" clean up
bw!
endfunc
" Turkish ASCII turns to multi-byte. On some systems Turkish locale
" is available but toupper()/tolower() don't do the right thing.
func Test_normal_changecase_turkish()
new
try
lang tr_TR.UTF-8
set casemap=
@@ -1627,13 +1744,11 @@ fun! Test_normal30_changecase()
" can't use Turkish locale
throw 'Skipped: Turkish locale not available'
endtry
" clean up
bw!
close!
endfunc
fun! Test_normal31_r_cmd()
" Test for r command
" Test for r (replace) command
func Test_normal31_r_cmd()
new
call append(0, 'This is a simple test: abcd')
exe "norm! 1gg$r\<cr>"
@@ -1652,13 +1767,29 @@ fun! Test_normal31_r_cmd()
exe "norm! 1gg05rf"
call assert_equal('fffffis a', getline(1))
" When replacing characters, copy characters from above and below lines
" using CTRL-Y and CTRL-E.
" Different code paths are used for utf-8 and latin1 encodings
set showmatch
for enc in ['latin1', 'utf-8']
enew!
let &encoding = enc
call setline(1, [' {a}', 'xxxxxxxxxx', ' [b]'])
exe "norm! 2gg5r\<C-Y>l5r\<C-E>"
call assert_equal(' {a}x [b]x', getline(2))
endfor
set showmatch&
" r command should fail in operator pending mode
call assert_beeps('normal! cr')
" clean up
set noautoindent
bw!
endfunc
" Test for g*, g#
func Test_normal32_g_cmd1()
" Test for g*, g#
new
call append(0, ['abc.x_foo', 'x_foobar.abc'])
1
@@ -1673,11 +1804,12 @@ func Test_normal32_g_cmd1()
bw!
endfunc
fun! Test_normal33_g_cmd2()
" Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G,
" gi and gI commands
func Test_normal33_g_cmd2()
if !has("jumplist")
return
endif
" Tests for g cmds
call Setup_NewWindow()
" Test for g`
clearjumps
@@ -1689,6 +1821,10 @@ fun! Test_normal33_g_cmd2()
call assert_equal('>', a[-1:])
call assert_equal(1, line('.'))
call assert_equal('1', getline('.'))
call cursor(10, 1)
norm! g'a
call assert_equal('>', a[-1:])
call assert_equal(1, line('.'))
" Test for g; and g,
norm! g;
@@ -1719,6 +1855,16 @@ fun! Test_normal33_g_cmd2()
norm! g&
call assert_equal(['11', '22', '33', '44', '55', '66', '77', '88', '9', '110', 'a', 'b', 'c', 'dd'], getline(1, '$'))
" Jumping to a fold using gg should open the fold
set foldenable
set foldopen+=jump
5,8fold
call feedkeys('6gg', 'xt')
call assert_equal(1, foldlevel('.'))
call assert_equal(-1, foldclosed('.'))
set foldopen-=jump
set foldenable&
" Test for gv
%d
call append('$', repeat(['abcdefgh'], 8))
@@ -1730,6 +1876,12 @@ fun! Test_normal33_g_cmd2()
exe "norm! G0\<c-v>4k4ly"
exe "norm! gvood"
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$'))
" gv cannot be used in operator pending mode
call assert_beeps('normal! cgv')
" gv should beep without a previously selected visual area
new
call assert_beeps('normal! gv')
close
" Test for gk/gj
%d
@@ -1770,8 +1922,17 @@ fun! Test_normal33_g_cmd2()
norm! g^yl
call assert_equal(15, col('.'))
call assert_equal('l', getreg(0))
call assert_beeps('normal 5g$')
norm! 2ggdd
" Test for g_
call assert_beeps('normal! 100g_')
call setline(2, [' foo ', ' foobar '])
normal! 2ggg_
call assert_equal(5, col('.'))
normal! 2g_
call assert_equal(8, col('.'))
norm! 2ggdG
$put =lineC
" Test for gM
@@ -1805,17 +1966,37 @@ fun! Test_normal33_g_cmd2()
$put ='third line'
norm! gi another word
call assert_equal(['foobar next word another word', 'new line', 'third line'], getline(1,'$'))
call setline(1, 'foobar')
normal! Ggifirst line
call assert_equal('foobarfirst line', getline(1))
" Test gi in 'virtualedit' mode with cursor after the end of the line
set virtualedit=all
call setline(1, 'foo')
exe "normal! Abar\<Right>\<Right>\<Right>\<Right>"
call setline(1, 'foo')
normal! Ggifirst line
call assert_equal('foo first line', getline(1))
set virtualedit&
" Test for aboring a g command using CTRL-\ CTRL-G
exe "normal! g\<C-\>\<C-G>"
call assert_equal('foo first line', getline('.'))
" clean up
bw!
endfunc
" Test for g CTRL-G
func Test_g_ctrl_g()
new
let a = execute(":norm! g\<c-g>")
call assert_equal("\n--No lines in buffer--", a)
" Test for CTRL-G (same as :file)
let a = execute(":norm! \<c-g>")
call assert_equal("\n\n\"[No Name]\" --No lines in buffer--", a)
call setline(1, ['first line', 'second line'])
" Test g CTRL-g with dos, mac and unix file type.
@@ -1883,8 +2064,8 @@ func Test_g_ctrl_g()
bwipe!
endfunc
fun! Test_normal34_g_cmd3()
" Test for g8
" Test for g8
func Test_normal34_g_cmd3()
new
let a=execute(':norm! 1G0g8')
call assert_equal("\nNUL", a)
@@ -1901,11 +2082,10 @@ fun! Test_normal34_g_cmd3()
bw!
endfunc
" Test 8g8 which finds invalid utf8 at or after the cursor.
func Test_normal_8g8()
new
" Test 8g8 which finds invalid utf8 at or after the cursor.
" With invalid byte.
call setline(1, "___\xff___")
norm! 1G08g8g
@@ -1934,8 +2114,8 @@ func Test_normal_8g8()
bw!
endfunc
fun! Test_normal35_g_cmd4()
" Test for g<
" Test for g<
func Test_normal35_g_cmd4()
" Cannot capture its output,
" probably a bug, therefore, test disabled:
throw "Skipped: output of g< can't be tested currently"
@@ -1944,7 +2124,8 @@ fun! Test_normal35_g_cmd4()
call assert_true(!empty(b), 'failed `execute(g<)`')
endfunc
fun! Test_normal36_g_cmd5()
" Test for gp gP go
func Test_normal36_g_cmd5()
new
call append(0, 'abcdefghijklmnopqrstuvwxyz')
set ff=unix
@@ -1982,8 +2163,8 @@ fun! Test_normal36_g_cmd5()
bw!
endfunc
fun! Test_normal37_g_cmd6()
" basic test for gt and gT
" Test for gt and gT
func Test_normal37_g_cmd6()
tabnew 1.txt
tabnew 2.txt
tabnew 3.txt
@@ -2009,8 +2190,8 @@ fun! Test_normal37_g_cmd6()
call assert_fails(':tabclose', 'E784:')
endfunc
fun! Test_normal38_nvhome()
" Test for <Home> and <C-Home> key
" Test for <Home> and <C-Home> key
func Test_normal38_nvhome()
new
call setline(1, range(10))
$
@@ -2025,12 +2206,28 @@ fun! Test_normal38_nvhome()
call assert_equal([0, 5, 1, 0, 1], getcurpos())
exe "norm! \<c-home>"
call assert_equal([0, 1, 1, 0, 1], getcurpos())
exe "norm! G\<c-kHome>"
call assert_equal([0, 1, 1, 0, 1], getcurpos())
" clean up
bw!
endfunc
fun! Test_normal39_cw()
" Test for <End> and <C-End> keys
func Test_normal_nvend()
new
call setline(1, map(range(1, 10), '"line" .. v:val'))
exe "normal! \<End>"
call assert_equal(5, col('.'))
exe "normal! 4\<End>"
call assert_equal([4, 5], [line('.'), col('.')])
exe "normal! \<C-End>"
call assert_equal([10, 6], [line('.'), col('.')])
close!
endfunc
" Test for cw cW ce
func Test_normal39_cw()
" Test for cw and cW on whitespace
" and cpo+=w setting
new
@@ -2050,12 +2247,27 @@ fun! Test_normal39_cw()
norm! 2gg0cwfoo
call assert_equal('foo', getline('.'))
call setline(1, 'one; two')
call cursor(1, 1)
call feedkeys('cwvim', 'xt')
call assert_equal('vim; two', getline(1))
call feedkeys('0cWone', 'xt')
call assert_equal('one two', getline(1))
"When cursor is at the end of a word 'ce' will change until the end of the
"next word, but 'cw' will change only one character
call setline(1, 'one two')
call feedkeys('0ecwce', 'xt')
call assert_equal('once two', getline(1))
call setline(1, 'one two')
call feedkeys('0ecely', 'xt')
call assert_equal('only', getline(1))
" clean up
bw!
endfunc
fun! Test_normal40_ctrl_bsl()
" Basic test for CTRL-\ commands
" Test for CTRL-\ commands
func Test_normal40_ctrl_bsl()
new
call append(0, 'here are some words')
exe "norm! 1gg0a\<C-\>\<C-N>"
@@ -2074,14 +2286,18 @@ fun! Test_normal40_ctrl_bsl()
set noim
call assert_equal('are some words', getline(1))
call assert_false(&insertmode)
call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
" Using CTRL-\ CTRL-N in cmd window should close the window
call feedkeys("q:\<C-\>\<C-N>", 'xt')
call assert_equal('', getcmdwintype())
" clean up
bw!
endfunc
fun! Test_normal41_insert_reg()
" Test for <c-r>=, <c-r><c-r>= and <c-r><c-o>=
" in insert mode
" Test for <c-r>=, <c-r><c-r>= and <c-r><c-o>= in insert mode
func Test_normal41_insert_reg()
new
set sts=2 sw=2 ts=8 tw=0
call append(0, ["aaa\tbbb\tccc", '', '', ''])
@@ -2099,8 +2315,8 @@ fun! Test_normal41_insert_reg()
bw!
endfunc
" Test for Ctrl-D and Ctrl-U
func Test_normal42_halfpage()
" basic test for Ctrl-D and Ctrl-U
call Setup_NewWindow()
call assert_equal(5, &scroll)
exe "norm! \<c-d>"
@@ -2136,8 +2352,8 @@ func Test_normal42_halfpage()
bw!
endfunc
fun! Test_normal43_textobject1()
" basic tests for text object aw
" Tests for text object aw
func Test_normal43_textobject1()
new
call append(0, ['foobar,eins,foobar', 'foo,zwei,foo '])
" diw
@@ -2167,8 +2383,8 @@ fun! Test_normal43_textobject1()
bw!
endfunc
" Test for is and as text objects
func Test_normal44_textobjects2()
" basic testing for is and as text objects
new
call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here'])
" Test for dis - does not remove trailing whitespace
@@ -2373,6 +2589,8 @@ func Test_normal52_rl()
call assert_equal(19, col('.'))
call feedkeys("\<right>", 'tx')
call assert_equal(18, col('.'))
call feedkeys("\<left>", 'tx')
call assert_equal(19, col('.'))
call feedkeys("\<s-right>", 'tx')
call assert_equal(13, col('.'))
call feedkeys("\<c-right>", 'tx')
@@ -2462,6 +2680,18 @@ func Test_gr_command()
normal 4gro
call assert_equal('ooooecond line', getline(2))
let &cpo = save_cpo
normal! ggvegrx
call assert_equal('xxxxx line', getline(1))
exe "normal! gggr\<C-V>122"
call assert_equal('zxxxx line', getline(1))
set virtualedit=all
normal! 15|grl
call assert_equal('zxxxx line l', getline(1))
set virtualedit&
set nomodifiable
call assert_fails('normal! grx', 'E21:')
call assert_fails('normal! gRx', 'E21:')
set modifiable&
enew!
endfunc
@@ -2484,6 +2714,8 @@ func Test_changelist()
normal g;
call assert_equal([2, 2], [line('.'), col('.')])
call assert_fails('normal g;', 'E662:')
new
call assert_fails('normal g;', 'E664:')
%bwipe!
let &ul = save_ul
endfunc
@@ -2530,6 +2762,10 @@ endfunc
" Jumping to beginning and end of methods in Java-like languages
func Test_java_motion()
new
call assert_beeps('normal! [m')
call assert_beeps('normal! ]m')
call assert_beeps('normal! [M')
call assert_beeps('normal! ]M')
a
Piece of Java
{
@@ -2604,7 +2840,7 @@ Piece of Java
close!
endfunc
fun! Test_normal_gdollar_cmd()
func Test_normal_gdollar_cmd()
if !has("jumplist")
return
endif
@@ -2659,10 +2895,11 @@ fun! Test_normal_gdollar_cmd()
bw!
endfunc
func Test_normal_gk()
func Test_normal_gk_gj()
" needs 80 column new window
new
vert 80new
call assert_beeps('normal gk')
put =[repeat('x',90)..' {{{1', 'x {{{1']
norm! gk
" In a 80 column wide terminal the window will be only 78 char
@@ -2677,12 +2914,12 @@ func Test_normal_gk()
norm! gk
call assert_equal(95, col('.'))
call assert_equal(95, virtcol('.'))
bw!
bw!
%bw!
" needs 80 column new window
new
vert 80new
call assert_beeps('normal gj')
set number
set numberwidth=10
set cpoptions+=n
@@ -2701,9 +2938,14 @@ func Test_normal_gk()
call assert_equal(1, col('.'))
norm! gj
call assert_equal(76, col('.'))
bw!
bw!
set cpoptions& number& numberwidth&
" When 'nowrap' is set, gk and gj behave like k and j
set nowrap
normal! gk
call assert_equal([2, 76], [line('.'), col('.')])
normal! gj
call assert_equal([3, 76], [line('.'), col('.')])
%bw!
set cpoptions& number& numberwidth& wrap&
endfunc
" Test for cursor movement with '-' in 'cpoptions'
@@ -2731,3 +2973,58 @@ func Test_normal_yank_with_excmd()
call assert_equal('f', @a)
close!
endfunc
" Test for supplying a count to a normal-mode command across a cursorhold call
func Test_normal_cursorhold_with_count()
func s:cHold()
let g:cHold_Called += 1
endfunc
new
augroup normalcHoldTest
au!
au CursorHold <buffer> call s:cHold()
augroup END
let g:cHold_Called = 0
call feedkeys("3\<CursorHold>2ix", 'xt')
call assert_equal(1, g:cHold_Called)
call assert_equal(repeat('x', 32), getline(1))
augroup normalcHoldTest
au!
augroup END
au! normalcHoldTest
close!
delfunc s:cHold
endfunc
" Test for using a count and a command with CTRL-W
func Test_wincmd_with_count()
call feedkeys("\<C-W>12n", 'xt')
call assert_equal(12, winheight(0))
endfunc
" Test for 'b', 'B' 'ge' and 'gE' commands
func Test_horiz_motion()
new
normal! gg
call assert_beeps('normal! b')
call assert_beeps('normal! B')
call assert_beeps('normal! gE')
call assert_beeps('normal! ge')
" <S-Backspace> moves one word left and <C-Backspace> moves one WORD left
call setline(1, 'one ,two ,three')
exe "normal! $\<S-BS>"
call assert_equal(11, col('.'))
exe "normal! $\<C-BS>"
call assert_equal(10, col('.'))
close!
endfunc
" Test for using a : command in operator pending mode
func Test_normal_colon_op()
new
call setline(1, ['one', 'two'])
call assert_beeps("normal! Gc:d\<CR>")
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+23
View File
@@ -672,4 +672,27 @@ func Test_shellquote()
call assert_match(': "#echo Hello#"', v)
endfunc
" Test for the 'rightleftcmd' option
func Test_rightleftcmd()
CheckFeature rightleft
set rightleft
set rightleftcmd
let g:l = []
func AddPos()
call add(g:l, screencol())
return ''
endfunc
cmap <expr> <F2> AddPos()
call feedkeys("/\<F2>abc\<Left>\<F2>\<Right>\<Right>\<F2>" ..
\ "\<Left>\<F2>\<Esc>", 'xt')
call assert_equal([&co - 1, &co - 4, &co - 2, &co - 3], g:l)
cunmap <F2>
unlet g:l
set rightleftcmd&
set rightleft&
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+39 -3
View File
@@ -926,6 +926,7 @@ func Test_win_execute_not_allowed()
call assert_fails('call win_execute(winid, "tabnext")', 'E994:')
call assert_fails('call win_execute(winid, "next")', 'E994:')
call assert_fails('call win_execute(winid, "rewind")', 'E994:')
call assert_fails('call win_execute(winid, "pedit filename")', 'E994:')
call assert_fails('call win_execute(winid, "buf")', 'E994:')
call assert_fails('call win_execute(winid, "bnext")', 'E994:')
call assert_fails('call win_execute(winid, "bprev")', 'E994:')
@@ -1409,8 +1410,8 @@ func Test_popup_filter()
call setline(1, 'some text')
func MyPopupFilter(winid, c)
if a:c == 'e'
let g:eaten = 'e'
if a:c == 'e' || a:c == "\<F9>"
let g:eaten = a:c
return 1
endif
if a:c == '0'
@@ -1430,6 +1431,8 @@ func Test_popup_filter()
" e is consumed by the filter
call feedkeys('e', 'xt')
call assert_equal('e', g:eaten)
call feedkeys("\<F9>", 'xt')
call assert_equal("\<F9>", g:eaten)
" 0 is ignored by the filter
normal $
@@ -1440,7 +1443,7 @@ func Test_popup_filter()
" x closes the popup
call feedkeys('x', 'xt')
call assert_equal('e', g:eaten)
call assert_equal("\<F9>", g:eaten)
call assert_equal(-1, winbufnr(winid))
delfunc MyPopupFilter
@@ -3271,4 +3274,37 @@ func Test_popupwin_bufnr()
bwipe!
endfunc
func Test_popupwin_filter_input_multibyte()
func MyPopupFilter(winid, c)
let g:bytes = range(a:c->strlen())->map({i -> char2nr(a:c[i])})
return 0
endfunc
let winid = popup_create('', #{mapping: 0, filter: 'MyPopupFilter'})
" UTF-8: E3 80 80, including K_SPECIAL(0x80)
call feedkeys("\u3000", 'xt')
call assert_equal([0xe3, 0x80, 0x80], g:bytes)
" UTF-8: E3 80 9B, including CSI(0x9B)
call feedkeys("\u301b", 'xt')
call assert_equal([0xe3, 0x80, 0x9b], g:bytes)
call popup_clear()
delfunc MyPopupFilter
unlet g:bytes
endfunc
func Test_popupwin_atcursor_far_right()
new
" this was getting stuck
set signcolumn=yes
call setline(1, repeat('=', &columns))
normal! ggg$
call popup_atcursor(repeat('x', 500), #{moved: 'any', border: []})
bwipe!
set signcolumn&
endfunc
" vim: shiftwidth=2 sts=2
+22
View File
@@ -124,3 +124,25 @@ func Test_prompt_garbage_collect()
delfunc MyPromptCallback
bwipe!
endfunc
" Test for editing the prompt buffer
func Test_prompt_buffer_edit()
new
set buftype=prompt
normal! i
call assert_beeps('normal! dd')
call assert_beeps('normal! ~')
call assert_beeps('normal! o')
call assert_beeps('normal! O')
call assert_beeps('normal! p')
call assert_beeps('normal! P')
call assert_beeps('normal! u')
call assert_beeps('normal! ra')
call assert_beeps('normal! s')
call assert_beeps('normal! S')
call assert_beeps("normal! \<C-A>")
call assert_beeps("normal! \<C-X>")
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+12
View File
@@ -113,3 +113,15 @@ func Test_put_p_indent_visual()
call assert_equal('select that text', getline(2))
bwipe!
endfunc
" Test for deleting all the contents of a buffer with a put
func Test_put_visual_delete_all_lines()
new
call setline(1, ['one', 'two', 'three'])
let @r = ''
normal! VG"rgp
call assert_equal(1, line('$'))
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+8
View File
@@ -3684,6 +3684,14 @@ func Test_lvimgrep_crash()
enew | only
endfunc
func Test_lvimgrep_crash2()
au BufNewFile x sfind
call assert_fails('lvimgrep x x', 'E480:')
call assert_fails('lvimgrep x x x', 'E480:')
au! BufNewFile
endfunc
" Test for the position of the quickfix and location list window
func Test_qfwin_pos()
" Open two windows
+3
View File
@@ -395,6 +395,9 @@ func Test_execute_register()
@q
@
call assert_equal(3, i)
" cannot execute a register in operator pending mode
call assert_beeps('normal! c@r')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+23
View File
@@ -38,4 +38,27 @@ func Test_smartindent_has_no_effect()
bwipe!
endfunc
" Test for inserting '{' and '} with smartindent
func Test_smartindent_braces()
new
set smartindent shiftwidth=4
call setline(1, [' if (a)', "\tif (b)", "\t return 1"])
normal 2ggO{
normal 3ggA {
normal 4ggo}
normal o}
normal 4ggO#define FOO 1
call assert_equal([
\ ' if (a)',
\ ' {',
\ "\tif (b) {",
\ '#define FOO 1',
\ "\t return 1",
\ "\t}",
\ ' }'
\ ], getline(1, '$'))
set si& sw& ai&
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+13 -16
View File
@@ -3,8 +3,6 @@ source check.vim
func Test_source_utf8()
" check that sourcing a script with 0x80 as second byte works
" does not work correctly on BSD
CheckNotBSD
new
call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g'])
write! Xscript
@@ -34,25 +32,24 @@ endfunc
" Test for sourcing a file with CTRL-V's at the end of the line
func Test_source_ctrl_v()
CheckNotBSD
call writefile(['map __1 afirst',
\ 'map __2 asecond',
\ 'map __3 athird',
\ 'map __4 afourth',
\ 'map __5 afifth',
\ "map __1 asd\<C-V>",
\ "map __2 asd\<C-V>\<C-V>",
\ "map __3 asd\<C-V>\<C-V>",
\ "map __4 asd\<C-V>\<C-V>\<C-V>",
\ "map __5 asd\<C-V>\<C-V>\<C-V>",
\ ], 'Xtestfile')
call writefile(['map __1 afirst',
\ 'map __2 asecond',
\ 'map __3 athird',
\ 'map __4 afourth',
\ 'map __5 afifth',
\ "map __1 asd\<C-V>",
\ "map __2 asd\<C-V>\<C-V>",
\ "map __3 asd\<C-V>\<C-V>",
\ "map __4 asd\<C-V>\<C-V>\<C-V>",
\ "map __5 asd\<C-V>\<C-V>\<C-V>",
\ ], 'Xtestfile')
source Xtestfile
enew!
exe "normal __1\<Esc>\<Esc>__2\<Esc>__3\<Esc>\<Esc>__4\<Esc>__5\<Esc>"
exe "%s/\<C-J>/0/g"
call assert_equal(['sd',
\ "map __2 asd\<Esc>secondsd\<Esc>sd0map __5 asd0fifth"],
\ getline(1, 2))
\ "map __2 asd\<Esc>secondsd\<Esc>sd0map __5 asd0fifth"],
\ getline(1, 2))
enew!
call delete('Xtestfile')
+32 -1
View File
@@ -1140,7 +1140,7 @@ endfunc
" Test for :dsearch, :dlist, :djump and :dsplit commands
" Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands
func Test_def_search()
func Test_macro_search()
new
call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3',
\ '#define FOO 4', '#define FOO 5'])
@@ -1236,4 +1236,35 @@ func Test_def_search()
close!
endfunc
" Test for [*, [/, ]* and ]/
func Test_comment_search()
new
call setline(1, ['', '/*', ' *', ' *', ' */'])
normal! 4gg[/
call assert_equal([2, 1], [line('.'), col('.')])
normal! 3gg[*
call assert_equal([2, 1], [line('.'), col('.')])
normal! 3gg]/
call assert_equal([5, 3], [line('.'), col('.')])
normal! 3gg]*
call assert_equal([5, 3], [line('.'), col('.')])
%d
call setline(1, ['', '/*', ' *', ' *'])
call assert_beeps('normal! 3gg]/')
%d
call setline(1, ['', ' *', ' *', ' */'])
call assert_beeps('normal! 4gg[/')
%d
call setline(1, ' /* comment */')
normal! 15|[/
call assert_equal(9, col('.'))
normal! 15|]/
call assert_equal(21, col('.'))
call setline(1, ' comment */')
call assert_beeps('normal! 15|[/')
call setline(1, ' /* comment')
call assert_beeps('normal! 15|]/')
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+11 -6
View File
@@ -7,6 +7,7 @@ func Test_taglist()
\ "BFoo\tXbar\t1",
\ "BBar\tXbar\t2",
\ "Kindly\tXbar\t3;\"\tv\tfile:",
\ "Lambda\tXbar\t3;\"\tλ\tfile:",
\ "Command\tXbar\tcall cursor(3, 4)|;\"\td",
\ ], 'Xtags')
set tags=Xtags
@@ -17,12 +18,16 @@ func Test_taglist()
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))
let kind = taglist("Kindly")
call assert_equal(1, len(kind))
call assert_equal('v', kind[0]['kind'])
call assert_equal('3', kind[0]['cmd'])
call assert_equal(1, kind[0]['static'])
call assert_equal('Xbar', kind[0]['filename'])
let kindly = taglist("Kindly")
call assert_equal(1, len(kindly))
call assert_equal('v', kindly[0]['kind'])
call assert_equal('3', kindly[0]['cmd'])
call assert_equal(1, kindly[0]['static'])
call assert_equal('Xbar', kindly[0]['filename'])
let lambda = taglist("Lambda")
call assert_equal(1, len(lambda))
call assert_equal('λ', lambda[0]['kind'])
let cmd = taglist("Command")
call assert_equal(1, len(cmd))
+94 -10
View File
@@ -368,7 +368,11 @@ func Test_terminal_postponed_scrollback()
call term_wait(buf)
call term_sendkeys(buf, "exit\<CR>")
call term_wait(buf)
call term_sendkeys(buf, ":q\<CR>")
let tsk_ret = term_sendkeys(buf, ":q\<CR>")
" check type of term_sendkeys() return value
echo type(tsk_ret)
call StopVimInTerminal(buf)
call delete('XTest_postponed')
call delete('Xtext')
@@ -2344,29 +2348,29 @@ func Test_terminal_in_popup()
\ 'hi PopTerm ctermbg=grey',
\ 'func OpenTerm(setColor)',
\ " let s:buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})",
\ ' let s:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
\ ' let g:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
\ ' if a:setColor',
\ ' call win_execute(s:winid, "set wincolor=PopTerm")',
\ ' call win_execute(g:winid, "set wincolor=PopTerm")',
\ ' endif',
\ 'endfunc',
\ 'call OpenTerm(0)',
\ 'func HidePopup()',
\ ' call popup_hide(s:winid)',
\ ' call popup_hide(g:winid)',
\ 'endfunc',
\ 'func ClosePopup()',
\ ' call popup_close(s:winid)',
\ ' call popup_close(g:winid)',
\ 'endfunc',
\ 'func ReopenPopup()',
\ ' call popup_create(s:buf, #{minwidth: 40, minheight: 6, border: []})',
\ 'endfunc',
\ 'sleep 10m',
\ 'redraw',
\ 'echo getwinvar(s:winid, "&buftype") win_gettype(s:winid)',
\ ]
call writefile(lines, 'XtermPopup')
let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
call term_wait(buf, 100)
call term_sendkeys(buf, "\<C-L>")
call term_sendkeys(buf, ":call OpenTerm(0)\<CR>")
call term_wait(buf, 100)
call term_sendkeys(buf, ":\<CR>")
call term_sendkeys(buf, "\<C-W>:echo getwinvar(g:winid, \"&buftype\") win_gettype(g:winid)\<CR>")
call VerifyScreenDump(buf, 'Test_terminal_popup_1', {})
call term_sendkeys(buf, ":q\<CR>")
@@ -2387,15 +2391,71 @@ func Test_terminal_in_popup()
call term_sendkeys(buf, "\<C-W>:call ReopenPopup()\<CR>")
call VerifyScreenDump(buf, 'Test_terminal_popup_6', {})
call term_wait(buf, 100)
" Go to terminal-Normal mode and visually select text.
call term_sendkeys(buf, "\<C-W>Ngg/in\<CR>vww")
call VerifyScreenDump(buf, 'Test_terminal_popup_7', {})
" Back to job mode, redraws
call term_sendkeys(buf, "A")
call VerifyScreenDump(buf, 'Test_terminal_popup_8', {})
call term_wait(buf, 100)
call term_sendkeys(buf, ":q\<CR>")
call term_wait(buf, 100) " wait for terminal to vanish
call StopVimInTerminal(buf)
call delete('Xtext')
call delete('XtermPopup')
endfunc
" Check a terminal in popup window uses the default mininum size.
func Test_terminal_in_popup_min_size()
CheckRunVimInTerminal
let text =<< trim END
another text
to show
in a popup window
END
call writefile(text, 'Xtext')
let lines = [
\ 'set t_u7=',
\ 'call setline(1, range(20))',
\ 'hi PopTerm ctermbg=grey',
\ 'func OpenTerm()',
\ " let s:buf = term_start('cat Xtext', #{hidden: 1})",
\ ' let g:winid = popup_create(s:buf, #{ border: []})',
\ 'endfunc',
\ ]
call writefile(lines, 'XtermPopup')
let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
call term_wait(buf, 100)
call term_sendkeys(buf, "\<C-L>")
call term_sendkeys(buf, ":call OpenTerm()\<CR>")
call term_wait(buf, 100)
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_terminal_popup_m1', {})
call term_wait(buf, 100)
call term_sendkeys(buf, ":q\<CR>")
call term_wait(buf, 100) " wait for terminal to vanish
call StopVimInTerminal(buf)
call delete('Xtext')
call delete('XtermPopup')
endfunc
func Test_double_popup_terminal()
let buf1 = term_start(&shell, #{hidden: 1})
let win1 = popup_create(buf1, {})
let buf2 = term_start(&shell, #{hidden: 1})
let win2 = popup_create(buf2, {})
call popup_close(win1)
call popup_close(win2)
exe buf1 .. 'bwipe!'
exe buf2 .. 'bwipe!'
endfunc
func Test_issue_5607()
let wincount = winnr('$')
exe 'terminal' &shell &shellcmdflag 'exit'
@@ -2416,3 +2476,27 @@ func Test_hidden_terminal()
call assert_equal('', bufname('^$'))
call StopShellInTerminal(buf)
endfunc
func Test_term_nasty_callback()
func OpenTerms()
set hidden
let g:buf0 = term_start('sh', #{hidden: 1})
call popup_create(g:buf0, {})
let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
call popup_create(g:buf1, {})
let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
sleep 100m
call popup_close(win_getid())
endfunc
func TermExit(...)
call term_sendkeys(bufnr('#'), "exit\<CR>")
call popup_close(win_getid())
endfu
call OpenTerms()
call term_sendkeys(g:buf0, "exit\<CR>")
sleep 100m
exe g:buf0 .. 'bwipe'
set hidden&
endfunc
+64 -4
View File
@@ -6,8 +6,6 @@ CheckFeature textprop
source screendump.vim
" test length zero
func Test_proptype_global()
call prop_type_add('comment', {'highlight': 'Directory', 'priority': 123, 'start_incl': 1, 'end_incl': 1})
let proptypes = prop_type_list()
@@ -215,6 +213,17 @@ func Test_prop_find()
call prop_type_delete('prop_name')
endfunc
func Test_prop_find_smaller_len_than_match_col()
new
call prop_type_add('test', {'highlight': 'ErrorMsg'})
call setline(1, ['xxxx', 'x'])
call prop_add(1, 4, {'type': 'test'})
call assert_equal({'id': 0, 'lnum': 1, 'col': 4, 'type': 'test', 'length': 0, 'start': 1, 'end': 1},
\ prop_find({'type': 'test', 'lnum': 2, 'col': 1}, 'b'))
bwipe!
call prop_type_delete('test')
endfunc
func Test_prop_add()
new
call AddPropTypes()
@@ -233,13 +242,20 @@ func Test_prop_add()
" Prop without length or end column is zero length
call prop_clear(1)
call prop_add(1, 5, {'type': 'two'})
let expected = [{'col': 5, 'length': 0, 'type': 'two', 'id': 0, 'start': 1, 'end': 1}]
call prop_type_add('included', {'start_incl': 1, 'end_incl': 1})
call prop_add(1, 5, #{type: 'included'})
let expected = [#{col: 5, length: 0, type: 'included', id: 0, start: 1, end: 1}]
call assert_equal(expected, prop_list(1))
" Inserting text makes the prop bigger.
exe "normal 5|ixx\<Esc>"
let expected = [#{col: 5, length: 2, type: 'included', id: 0, start: 1, end: 1}]
call assert_equal(expected, prop_list(1))
call assert_fails("call prop_add(1, 5, {'type': 'two', 'bufnr': 234343})", 'E158:')
call DeletePropTypes()
call prop_type_delete('included')
bwipe!
endfunc
@@ -265,6 +281,23 @@ func Test_prop_remove()
call DeletePropTypes()
bwipe!
new
call AddPropTypes()
call SetupPropsInFirstLine()
call prop_add(1, 6, {'length': 2, 'id': 11, 'type': 'three'})
let props = Get_expected_props()
call insert(props, {'col': 6, 'length': 2, 'id': 11, 'type': 'three', 'start': 1, 'end': 1}, 3)
call assert_equal(props, prop_list(1))
call assert_equal(1, prop_remove({'type': 'three', 'id': 11, 'both': 1, 'all': 1}, 1))
unlet props[3]
call assert_equal(props, prop_list(1))
call assert_fails("call prop_remove({'id': 11, 'both': 1})", 'E860')
call assert_fails("call prop_remove({'type': 'three', 'both': 1})", 'E860')
call DeletePropTypes()
bwipe!
endfunc
func SetupOneLine()
@@ -1144,3 +1177,30 @@ func Test_textprop_ins_str()
call prop_remove({'type': 'test'})
call prop_type_delete('test')
endfunc
func Test_find_prop_later_in_line()
new
call prop_type_add('test', {'highlight': 'ErrorMsg'})
call setline(1, 'just some text')
call prop_add(1, 1, {'length': 4, 'type': 'test'})
call prop_add(1, 10, {'length': 3, 'type': 'test'})
call assert_equal({'id': 0, 'lnum': 1, 'col': 10, 'end': 1, 'type': 'test', 'length': 3, 'start': 1},
\ prop_find(#{type: 'test', lnum: 1, col: 6}))
bwipe!
call prop_type_delete('test')
endfunc
func Test_find_zerowidth_prop_sol()
new
call prop_type_add('test', {'highlight': 'ErrorMsg'})
call setline(1, 'just some text')
call prop_add(1, 1, {'length': 0, 'type': 'test'})
call assert_equal({'id': 0, 'lnum': 1, 'col': 1, 'end': 1, 'type': 'test', 'length': 0, 'start': 1},
\ prop_find(#{type: 'test', lnum: 1}))
bwipe!
call prop_type_delete('test')
endfunc
+4
View File
@@ -422,4 +422,8 @@ func Test_timer_garbage_collect()
call timer_stop(timer)
endfunc
func Test_timer_invalid_callback()
call assert_fails('call timer_start(0, "0")', 'E921')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+42
View File
@@ -91,6 +91,18 @@ func Test_vartabs()
let expect = "l\<tab> l\<tab>l l\<tab> l\<tab> l"
call assert_equal(expect, getline(1))
" Test for 'retab' with vts
set ts=8 sts=0 vts=5,3,6,2 vsts=
exe "norm! S l"
.retab!
call assert_equal("\t\t\t\tl", getline(1))
" Test for 'retab' with same vlaues as vts
set ts=8 sts=0 vts=5,3,6,2 vsts=
exe "norm! S l"
.retab! 5,3,6,2
call assert_equal("\t\t\t\tl", getline(1))
" Check that global and local values are set.
set ts=4 vts=6 sts=8 vsts=10
call assert_equal(&ts, 4)
@@ -378,3 +390,33 @@ func Test_vartabs_reset()
set all&
call assert_equal('', &vts)
endfunc
func s:SaveCol(l)
call add(a:l, [col('.'), virtcol('.')])
return ''
endfunc
" Test for 'varsofttabstop'
func Test_varsofttabstop()
new
inoremap <expr> <F2> s:SaveCol(g:cols)
set backspace=indent,eol,start
set varsofttabstop=6,2,5,3
let g:cols = []
call feedkeys("a\t\<F2>\t\<F2>\t\<F2>\t\<F2> ", 'xt')
call assert_equal("\t\t ", getline(1))
call assert_equal([[7, 7], [2, 9], [7, 14], [3, 17]], g:cols)
let g:cols = []
call feedkeys("a\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>\<bs>\<F2>", 'xt')
call assert_equal('', getline(1))
call assert_equal([[3, 17], [7, 14], [2, 9], [7, 7], [1, 1]], g:cols)
set varsofttabstop&
set backspace&
iunmap <F2>
close!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+156
View File
@@ -1,5 +1,7 @@
" Test the :disassemble command, and compilation as a side effect
source check.vim
func NotCompiled()
echo "not"
endfunc
@@ -222,6 +224,38 @@ def Test_disassemble_call()
enddef
def FuncWithForwardCall(): string
return DefinedLater("yes")
enddef
def DefinedLater(arg: string): string
return arg
enddef
def Test_disassemble_update_instr()
let res = execute('disass FuncWithForwardCall')
assert_match('FuncWithForwardCall.*'
\ .. 'return DefinedLater("yes").*'
\ .. '\d PUSHS "yes".*'
\ .. '\d UCALL DefinedLater(argc 1).*'
\ .. '\d CHECKTYPE string stack\[-1].*'
\ .. '\d RETURN.*'
\, res)
" Calling the function will change UCALL into the faster DCALL
assert_equal('yes', FuncWithForwardCall())
res = execute('disass FuncWithForwardCall')
assert_match('FuncWithForwardCall.*'
\ .. 'return DefinedLater("yes").*'
\ .. '\d PUSHS "yes".*'
\ .. '\d DCALL DefinedLater(argc 1).*'
\ .. '\d CHECKTYPE string stack\[-1].*'
\ .. '\d RETURN.*'
\, res)
enddef
def FuncWithDefault(arg: string = 'default'): string
return arg
enddef
@@ -300,6 +334,63 @@ def Test_disassemble_const_expr()
assert_notmatch('JUMP', instr)
enddef
def WithFunc()
let funky1: func
let funky2: func = function("len")
let party1: partial
let party2: partial = funcref("UserFunc")
enddef
def Test_disassemble_function()
let instr = execute('disassemble WithFunc')
assert_match('WithFunc.*'
\ .. 'let funky1: func.*'
\ .. '0 PUSHFUNC "\[none]".*'
\ .. '1 STORE $0.*'
\ .. 'let funky2: func = function("len").*'
\ .. '2 PUSHS "len".*'
\ .. '3 BCALL function(argc 1).*'
\ .. '4 STORE $1.*'
\ .. 'let party1: partial.*'
\ .. '5 PUSHPARTIAL "\[none]".*'
\ .. '6 STORE $2.*'
\ .. 'let party2: partial = funcref("UserFunc").*'
\ .. '7 PUSHS "UserFunc".*'
\ .. '8 BCALL funcref(argc 1).*'
\ .. '9 STORE $3.*'
\ .. '10 PUSHNR 0.*'
\ .. '11 RETURN.*'
\, instr)
enddef
if has('channel')
def WithChannel()
let job1: job
let job2: job = job_start("donothing")
let chan1: channel
enddef
endif
def Test_disassemble_channel()
CheckFeature channel
let instr = execute('disassemble WithChannel')
assert_match('WithChannel.*'
\ .. 'let job1: job.*'
\ .. '\d PUSHJOB "no process".*'
\ .. '\d STORE $0.*'
\ .. 'let job2: job = job_start("donothing").*'
\ .. '\d PUSHS "donothing".*'
\ .. '\d BCALL job_start(argc 1).*'
\ .. '\d STORE $1.*'
\ .. 'let chan1: channel.*'
\ .. '\d PUSHCHANNEL 0.*'
\ .. '\d STORE $2.*'
\ .. '\d PUSHNR 0.*'
\ .. '\d RETURN.*'
\, instr)
enddef
def WithLambda(): string
let F = {a -> "X" .. a .. "X"}
return F("x")
@@ -690,4 +781,69 @@ def Test_disassemble_compare()
" delete('Xdisassemble')
enddef
def s:Execute()
execute 'help vim9.txt'
let cmd = 'help vim9.txt'
execute cmd
let tag = 'vim9.txt'
execute 'help ' .. tag
enddef
def Test_disassemble_execute()
let res = execute('disass s:Execute')
assert_match('\<SNR>\d*_Execute.*'
\ .. "execute 'help vim9.txt'.*"
\ .. '\d PUSHS "help vim9.txt".*'
\ .. '\d EXECUTE 1.*'
\ .. "let cmd = 'help vim9.txt'.*"
\ .. '\d PUSHS "help vim9.txt".*'
\ .. '\d STORE $0.*'
\ .. 'execute cmd.*'
\ .. '\d LOAD $0.*'
\ .. '\d EXECUTE 1.*'
\ .. "let tag = 'vim9.txt'.*"
\ .. '\d PUSHS "vim9.txt".*'
\ .. '\d STORE $1.*'
\ .. "execute 'help ' .. tag.*"
\ .. '\d PUSHS "help ".*'
\ .. '\d LOAD $1.*'
\ .. '\d CONCAT.*'
\ .. '\d EXECUTE 1.*'
\ .. '\d PUSHNR 0.*'
\ .. '\d RETURN'
\, res)
enddef
def SomeStringArg(arg: string)
echo arg
enddef
def SomeAnyArg(arg: any)
echo arg
enddef
def SomeStringArgAndReturn(arg: string): string
return arg
enddef
def Test_display_func()
let res1 = execute('function SomeStringArg')
assert_match('.* def SomeStringArg(arg: string).*'
\ .. ' echo arg.*'
\ .. ' enddef'
\, res1)
let res2 = execute('function SomeAnyArg')
assert_match('.* def SomeAnyArg(arg: any).*'
\ .. ' echo arg.*'
\ .. ' enddef'
\, res2)
let res3 = execute('function SomeStringArgAndReturn')
assert_match('.* def SomeStringArgAndReturn(arg: string): string.*'
\ .. ' return arg.*'
\ .. ' enddef'
\, res3)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
+17 -4
View File
@@ -9,6 +9,12 @@ func CheckDefFailure(line, error)
call delete('Xdef')
endfunc
func CheckDefFailureMult(lines, error)
call writefile(['def! Func()'] + a:lines + ['enddef'], 'Xdef')
call assert_fails('so Xdef', a:error, join(a:lines, ' | '))
call delete('Xdef')
endfunc
" Check that "line" inside ":def" results in an "error" message when executed.
func CheckDefExecFailure(line, error)
call writefile(['def! Func()', a:line, 'enddef'], 'Xdef')
@@ -31,9 +37,9 @@ def Test_expr1()
assert_equal('one', 0.1 ? 'one' : 'two')
endif
assert_equal('one', 'x' ? 'one' : 'two')
" assert_equal('one', 0z1234 ? 'one' : 'two')
assert_equal('one', 0z1234 ? 'one' : 'two')
assert_equal('one', [0] ? 'one' : 'two')
" assert_equal('one', #{x: 0} ? 'one' : 'two')
assert_equal('one', #{x: 0} ? 'one' : 'two')
let var = 1
assert_equal('one', var ? 'one' : 'two')
@@ -43,9 +49,9 @@ def Test_expr1()
assert_equal('two', 0.0 ? 'one' : 'two')
endif
assert_equal('two', '' ? 'one' : 'two')
" assert_equal('one', 0z ? 'one' : 'two')
assert_equal('two', 0z ? 'one' : 'two')
assert_equal('two', [] ? 'one' : 'two')
" assert_equal('two', {} ? 'one' : 'two')
assert_equal('two', {} ? 'one' : 'two')
var = 0
assert_equal('two', var ? 'one' : 'two')
enddef
@@ -441,6 +447,11 @@ func Test_expr4_fails()
call CheckDefFailure("let x = [13] <= [88]", 'Cannot compare list with list')
call CheckDefFailure("let x = [13] =~ [88]", 'Cannot compare list with list')
call CheckDefFailure("let x = [13] !~ [88]", 'Cannot compare list with list')
call CheckDefFailureMult(['let j: job', 'let chan: channel', 'let r = j == chan'], 'Cannot compare job with channel')
call CheckDefFailureMult(['let j: job', 'let x: list<any>', 'let r = j == x'], 'Cannot compare job with list')
call CheckDefFailureMult(['let j: job', 'let x: func', 'let r = j == x'], 'Cannot compare job with func')
call CheckDefFailureMult(['let j: job', 'let x: partial', 'let r = j == x'], 'Cannot compare job with partial')
endfunc
" test addition, subtraction, concatenation
@@ -805,6 +816,8 @@ func Test_expr7_fails()
call CheckDefExecFailure("let x = +g:ablob", 'E974:')
call CheckDefExecFailure("let x = +g:alist", 'E745:')
call CheckDefExecFailure("let x = +g:adict", 'E728:')
call CheckDefFailureMult(["let x = ''", "let y = x.memb"], 'E715:')
endfunc
let g:Funcrefs = [function('add')]
+281 -10
View File
@@ -1,6 +1,7 @@
" Test various aspects of the Vim9 script language.
source check.vim
source view_util.vim
" Check that "lines" inside ":def" results in an "error" message.
func CheckDefFailure(lines, error)
@@ -52,6 +53,24 @@ def Test_assignment()
let dict4: dict<any> = #{one: 1, two: '2'}
let dict5: dict<blob> = #{one: 0z01, tw: 0z02}
if has('channel')
let chan1: channel
let job1: job
let job2: job = job_start('willfail')
endif
if has('float')
let float1: float = 3.4
endif
let funky1: func
let funky2: func = function('len')
let party1: partial
let party2: partial = funcref('Test_syntax')
" type becomes list<any>
let somelist = rand() > 0 ? [1, 2, 3] : ['a', 'b', 'c']
" type becomes dict<any>
let somedict = rand() > 0 ? #{a: 1, b: 2} : #{a: 'a', b: 'b'}
g:newvar = 'new'
assert_equal('new', g:newvar)
@@ -90,6 +109,21 @@ func Test_assignment_failure()
call CheckDefFailure(['let var = feedkeys("0")'], 'E1031:')
call CheckDefFailure(['let var: number = feedkeys("0")'], 'expected number but got void')
call CheckDefFailure(['let var: dict <number>'], 'E1007:')
call CheckDefFailure(['let var: dict<number'], 'E1009:')
call CheckDefFailure(['let var: ally'], 'E1010:')
call CheckDefFailure(['let var: bram'], 'E1010:')
call CheckDefFailure(['let var: cathy'], 'E1010:')
call CheckDefFailure(['let var: dom'], 'E1010:')
call CheckDefFailure(['let var: freddy'], 'E1010:')
call CheckDefFailure(['let var: john'], 'E1010:')
call CheckDefFailure(['let var: larry'], 'E1010:')
call CheckDefFailure(['let var: ned'], 'E1010:')
call CheckDefFailure(['let var: pam'], 'E1010:')
call CheckDefFailure(['let var: sam'], 'E1010:')
call CheckDefFailure(['let var: vim'], 'E1010:')
endfunc
func Test_const()
@@ -177,6 +211,15 @@ func Test_call_default_args_from_func()
call assert_fails('call MyDefaultArgs("one", "two")', 'E118:')
endfunc
func TakesOneArg(arg)
echo a:arg
endfunc
def Test_call_wrong_arg_count()
call CheckDefFailure(['TakesOneArg()'], 'E119:')
call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:')
enddef
" Default arg and varargs
def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string
let res = one .. ',' .. two
@@ -193,16 +236,34 @@ def Test_call_def_varargs()
assert_equal('one,two,three', MyDefVarargs('one', 'two', 'three'))
enddef
def Test_using_var_as_arg()
call writefile(['def Func(x: number)', 'let x = 234', 'enddef'], 'Xdef')
call assert_fails('so Xdef', 'E1006:')
call delete('Xdef')
enddef
"def Test_call_func_defined_later()
" call assert_equal('one', DefineLater('one'))
" call assert_fails('call NotDefined("one")', 'E99:')
"enddef
def Test_call_func_defined_later()
call assert_equal('one', DefinedLater('one'))
call assert_fails('call NotDefined("one")', 'E117:')
enddef
func DefineLater(arg)
func DefinedLater(arg)
return a:arg
endfunc
def FuncWithForwardCall()
return DefinedEvenLater("yes")
enddef
def DefinedEvenLater(arg: string): string
return arg
enddef
def Test_error_in_nested_function()
" Error in called function requires unwinding the call stack.
assert_fails('call FuncWithForwardCall()', 'E1029')
enddef
def Test_return_type_wrong()
CheckScriptFailure(['def Func(): number', 'return "a"', 'enddef'], 'expected number but got string')
CheckScriptFailure(['def Func(): string', 'return 1', 'enddef'], 'expected string but got number')
@@ -301,7 +362,7 @@ let s:export_script_lines =<< trim END
enddef
END
def Test_vim9script()
def Test_vim9_import_export()
let import_script_lines =<< trim END
vim9script
import {exported, Exported} from './Xexport.vim'
@@ -314,6 +375,7 @@ def Test_vim9script()
g:imported_name = exp_name
exp_name ..= ' Doe'
g:imported_name_appended = exp_name
g:imported_later = exported
END
writefile(import_script_lines, 'Ximport.vim')
@@ -325,6 +387,7 @@ def Test_vim9script()
assert_equal('bob', g:localname)
assert_equal(9876, g:imported)
assert_equal(9879, g:imported_added)
assert_equal(9879, g:imported_later)
assert_equal('Exported', g:imported_func)
assert_equal('John', g:imported_name)
assert_equal('John Doe', g:imported_name_appended)
@@ -334,10 +397,30 @@ def Test_vim9script()
unlet g:localname
unlet g:imported
unlet g:imported_added
unlet g:imported_later
unlet g:imported_func
unlet g:imported_name g:imported_name_appended
delete('Ximport.vim')
let import_in_def_lines =<< trim END
vim9script
def ImportInDef()
import exported from './Xexport.vim'
g:imported = exported
exported += 7
g:imported_added = exported
enddef
ImportInDef()
END
writefile(import_in_def_lines, 'Ximport2.vim')
source Ximport2.vim
" TODO: this should be 9879
assert_equal(9876, g:imported)
assert_equal(9883, g:imported_added)
unlet g:imported
unlet g:imported_added
delete('Ximport2.vim')
let import_star_as_lines =<< trim END
vim9script
import * as Export from './Xexport.vim'
@@ -348,7 +431,7 @@ def Test_vim9script()
END
writefile(import_star_as_lines, 'Ximport.vim')
source Ximport.vim
assert_equal(9876, g:imported)
assert_equal(9883, g:imported)
let import_star_lines =<< trim END
vim9script
@@ -366,6 +449,33 @@ def Test_vim9script()
writefile(import_not_exported_lines, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1049:')
" try to import something that is already defined
let import_already_defined =<< trim END
vim9script
let exported = 'something'
import exported from './Xexport.vim'
END
writefile(import_already_defined, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1073:')
" try to import something that is already defined
import_already_defined =<< trim END
vim9script
let exported = 'something'
import * as exported from './Xexport.vim'
END
writefile(import_already_defined, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1073:')
" try to import something that is already defined
import_already_defined =<< trim END
vim9script
let exported = 'something'
import {exported} from './Xexport.vim'
END
writefile(import_already_defined, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1073:')
" import a very long name, requires making a copy
let import_long_name_lines =<< trim END
vim9script
@@ -399,10 +509,11 @@ def Test_vim9script()
vim9script
import {exported name} from './Xexport.vim'
END
writefile(import_missing_comma_lines, 'Ximport.vim')
assert_fails('source Ximport.vim', 'E1046:')
writefile(import_missing_comma_lines, 'Ximport3.vim')
assert_fails('source Ximport3.vim', 'E1046:')
delete('Ximport.vim')
delete('Ximport3.vim')
delete('Xexport.vim')
" Check that in a Vim9 script 'cpo' is set to the Vim default.
@@ -649,6 +760,108 @@ def Test_if_elseif_else()
assert_equal('three', IfElse(3))
enddef
let g:bool_true = v:true
let g:bool_false = v:false
def Test_if_const_expr()
let res = false
if true ? true : false
res = true
endif
assert_equal(true, res)
res = false
if g:bool_true ? true : false
res = true
endif
assert_equal(true, res)
res = false
if true ? g:bool_true : false
res = true
endif
assert_equal(true, res)
res = false
if true ? true : g:bool_false
res = true
endif
assert_equal(true, res)
res = false
if true ? false : true
res = true
endif
assert_equal(false, res)
res = false
if false ? false : true
res = true
endif
assert_equal(true, res)
res = false
if false ? true : false
res = true
endif
assert_equal(false, res)
res = false
if true && true
res = true
endif
assert_equal(true, res)
res = false
if true && false
res = true
endif
assert_equal(false, res)
res = false
if g:bool_true && false
res = true
endif
assert_equal(false, res)
res = false
if true && g:bool_false
res = true
endif
assert_equal(false, res)
res = false
if false && false
res = true
endif
assert_equal(false, res)
res = false
if true || false
res = true
endif
assert_equal(true, res)
res = false
if g:bool_true || false
res = true
endif
assert_equal(true, res)
res = false
if true || g:bool_false
res = true
endif
assert_equal(true, res)
res = false
if false || false
res = true
endif
assert_equal(false, res)
enddef
def Test_delfunc()
let lines =<< trim END
vim9script
@@ -670,6 +883,65 @@ def Test_delfunc()
delete('XToDelFunc')
enddef
def Test_execute_cmd()
new
setline(1, 'default')
execute 'call setline(1, "execute-string")'
assert_equal('execute-string', getline(1))
let cmd1 = 'call setline(1,'
let cmd2 = '"execute-var")'
execute cmd1 cmd2
assert_equal('execute-var', getline(1))
execute cmd1 cmd2 '|call setline(1, "execute-var-string")'
assert_equal('execute-var-string', getline(1))
let cmd_first = 'call '
let cmd_last = 'setline(1, "execute-var-var")'
execute cmd_first .. cmd_last
assert_equal('execute-var-var', getline(1))
bwipe!
enddef
def Test_echo_cmd()
echo 'something'
assert_match('^something$', Screenline(&lines))
let str1 = 'some'
let str2 = 'more'
echo str1 str2
assert_match('^some more$', Screenline(&lines))
enddef
def Test_for_outside_of_function()
let lines =<< trim END
vim9script
new
for var in range(0, 3)
append(line('$'), var)
endfor
assert_equal(['', '0', '1', '2', '3'], getline(1, '$'))
bwipe!
END
writefile(lines, 'Xvim9for.vim')
source Xvim9for.vim
delete('Xvim9for.vim')
enddef
def Test_while_loop()
let result = ''
let cnt = 0
while cnt < 555
if cnt == 3
break
endif
cnt += 1
if cnt == 2
continue
endif
result ..= cnt .. '_'
endwhile
assert_equal('1_3_', result)
enddef
def Test_substitute_cmd()
new
setline(1, 'something')
@@ -692,5 +964,4 @@ def Test_substitute_cmd()
delete('Xvim9lines')
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

Some files were not shown because too many files have changed in this diff Show More