Compare commits

...

21 Commits

Author SHA1 Message Date
Bram Moolenaar
18dc355395 patch 8.2.2031: some tests fail when run under valgrind
Problem:    Some tests fail when run under valgrind.
Solution:   Avoid timing problems.
2020-11-22 14:24:00 +01:00
Bram Moolenaar
4b2ce1297e patch 8.2.2030: some tests fail on Mac
Problem:    Some tests fail on Mac.
Solution:   Avoid Mac test failures.  Add additional test for wildmenu.
            (Yegappan Lakshmanan, closes #7341)
2020-11-21 21:41:41 +01:00
Bram Moolenaar
5546688fb6 patch 8.2.2029: Coverity warns for not checking return value
Problem:    Coverity warns for not checking return value.
Solution:   Check that u_save_cursor() returns OK.
2020-11-21 14:16:22 +01:00
Bram Moolenaar
896ad2c33e patch 8.2.2028: Coverity warns for using an uninitialized variable
Problem:    Coverity warns for using an uninitialized variable.
Solution:   Initialize to NULL.
2020-11-21 14:03:43 +01:00
Bram Moolenaar
9681f71392 patch 8.2.2027: Coverity warnts for uninitialized field
Problem:    Coverity warnts for uninitialized field.
Solution:   Set "v_lock".
2020-11-21 13:58:50 +01:00
Bram Moolenaar
e79cdb69a4 patch 8.2.2026: Coverity warns for possibly using not NUL terminated string
Problem:    Coverity warns for possibly using not NUL terminated string.
Solution:   Put a NUL in b0_hname just in case.
2020-11-21 13:51:16 +01:00
Bram Moolenaar
4466ad6baa Update runtime files 2020-11-21 13:16:30 +01:00
Bram Moolenaar
2d718267f4 patch 8.2.2025: Amiga: Not all colors are used on OS4
Problem:    Amiga: Not all colors are used on OS4.
Solution:   Adjust the #ifdef to include __amigaos4__. (Ola Söder,
            closes #7328)
2020-11-21 12:44:56 +01:00
Bram Moolenaar
d91467f830 patch 8.2.2024: flicker when redrawing a popup with a title and border
Problem:    Flicker when redrawing a popup with a title and border.
Solution:   Do not redraw the border where the title is displayed. (Naruhiko
            Nishino, closes #7334)
2020-11-21 12:42:09 +01:00
Bram Moolenaar
c71ee829ef patch 8.2.2023: Vim: memory leak when :execute fails
Problem:    Vim: memory leak when :execute fails.
Solution:   Clear the growarray.
2020-11-21 11:45:50 +01:00
Bram Moolenaar
95388e3179 patch 8.2.2022: Vim9: star command recognized errornously
Problem:    Vim9: star command recognized errornously.
Solution:   Give an error for missing colon. (issue #7335)
2020-11-20 21:07:00 +01:00
Bram Moolenaar
eeece9e488 patch 8.2.2021: Vim9: get E1099 when autocommand resets did_emsg
Problem:    Vim9: get E1099 when autocommand resets did_emsg.
Solution:   Add did_emsg_cumul. (closes #7336)
2020-11-20 19:26:48 +01:00
Bram Moolenaar
bebaa0d5c0 patch 8.2.2020: some compilers do not like the "namespace" argument
Problem:    Some compilers do not like the "namespace" argument.
Solution:   Rename to "use_namespace". (closes #7332)
2020-11-20 18:59:19 +01:00
Bram Moolenaar
80d868ec25 patch 8.2.2019: swap file test fails on MS-Windows
Problem:    Swap file test fails on MS-Windows.
Solution:   Add four to the process ID. (Ken Takata, closes #7333)
2020-11-20 09:10:15 +01:00
Bram Moolenaar
2ea95b61f4 patch 8.2.2018: Vim9: script variable not found from lambda
Problem:    Vim9: script variable not found from lambda.
Solution:   In a lambda also check the script hashtab for a variable without a
            scope. (closes #7329)
2020-11-19 21:47:56 +01:00
Bram Moolenaar
67d1c68f09 patch 8.2.2017: missing part of the dict change
Problem:    Missing part of the dict change.
Solution:   Also change the script level dict.
2020-11-19 19:01:43 +01:00
Bram Moolenaar
c6ca9f3a29 patch 8.2.2016: swap file test is a little flaky
Problem:    Swap file test is a little flaky.
Solution:   Don't set a byte to a fixed value, increment it.
2020-11-19 18:57:23 +01:00
Bram Moolenaar
2bede173a1 patch 8.2.2015: Vim9: literal dict #{} is not like any other language
Problem:    Vim9: literal dict #{} is not like any other language.
Solution:   Support the JavaScript syntax.
2020-11-19 18:53:18 +01:00
Bram Moolenaar
ee8b787bcd patch 8.2.2014: using CTRL-O in a prompt buffer moves cursor to start
Problem:    Using CTRL-O in a prompt buffer moves cursor to start of the line.
Solution:   Do not move the cursor when restarting edit. (closes #7330)
2020-11-19 18:46:25 +01:00
Bram Moolenaar
79cdf80bed patch 8.2.2013: Vim9: not skipping white space after unary minus
Problem:    Vim9: not skipping white space after unary minus.
Solution:   Skip whitespace. (closes #7324)
2020-11-18 17:39:05 +01:00
Bram Moolenaar
d92cc130fb patch 8.2.2012: Vim9: confusing error message when using bool wrongly
Problem:    Vim9: confusing error message when using bool wrongly.
Solution:   Mention "Bool" instead of "Special". (closes #7323)
2020-11-18 17:17:15 +01:00
53 changed files with 609 additions and 205 deletions

View File

@@ -159,18 +159,18 @@ thing I have been thinking of is assignments without ":let". I often
make that mistake (after writing JavaScript especially). I think it is
possible, if we make local variables shadow commands. That should be OK,
if you shadow a command you want to use, just rename the variable.
Using "let" and "const" to declare a variable, like in JavaScript and
Using "var" and "const" to declare a variable, like in JavaScript and
TypeScript, can work:
``` vim
def MyFunction(arg: number): number
let local = 1
let todo = arg
var local = 1
var todo = arg
const ADD = 88
while todo > 0
local += ADD
--todo
todo -= 1
endwhile
return local
enddef
@@ -192,7 +192,7 @@ function and export it:
``` vim
vim9script " Vim9 script syntax used here
let local = 'local variable is not exported, script-local'
var local = 'local variable is not exported, script-local'
export def MyFunction() " exported function
...
@@ -248,10 +248,10 @@ END
return luaeval('sum')
endfunc
def VimNew()
let sum = 0
def VimNew(): number
var sum = 0
for i in range(1, 2999999)
let sum += i
sum += i
endfor
return sum
enddef
@@ -277,7 +277,7 @@ echo 'Vim new: ' .. reltimestr(reltime(start))
``` vim
def VimNew(): number
let totallen = 0
var totallen = 0
for i in range(1, 100000)
setline(i, ' ' .. getline(i))
totallen += len(getline(i))

View File

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

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.2. Last change: 2020 Oct 26
*autocmd.txt* For Vim version 8.2. Last change: 2020 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -70,6 +70,10 @@ effects. Be careful not to destroy your text.
The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
See |autocmd-buflocal|.
If the `:autocmd` is in Vim9 script then {cmd} will be executed as in Vim9
script. Thus this depends on where the autocmd is defined, not where it is
triggered.
Note: The ":autocmd" command can only be followed by another command when the
'|' appears before {cmd}. This works: >
:augroup mine | au! BufRead | augroup END

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 8.2. Last change: 2020 Nov 03
*change.txt* For Vim version 8.2. Last change: 2020 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1852,6 +1852,8 @@ found here: |sort()|, |uniq()|.
When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that
you sort on what comes after the match.
'ignorecase' applies to the pattern, but 'smartcase'
is not used.
Instead of the slash any non-letter can be used.
For example, to sort on the second comma-separated
field: >

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Nov 04
*eval.txt* For Vim version 8.2. Last change: 2020 Nov 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3473,8 +3473,8 @@ byteidx({expr}, {nr}) *byteidx()*
Return byte index of the {nr}'th character in the string
{expr}. Use zero for the first character, it then returns
zero.
This function is only useful when there are multibyte
characters, otherwise the returned value is equal to {nr}.
If there are no multibyte characters the returned value is
equal to {nr}.
Composing characters are not counted separately, their byte
length is added to the preceding base character. See
|byteidxcomp()| below for counting composing characters
@@ -7433,7 +7433,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
Same as |matchfuzzy()|, but returns the list of matched
strings and the list of character positions where characters
in {str} matches.
in {str} matches. You can use |byteidx()|to convert a
character position to a byte position.
If {str} matches multiple times in a string, then only the
positions for the best match is returned.
@@ -8728,11 +8730,16 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
'ignorecase', 'smartcase' and 'magic' are used.
When the 'z' flag is not given, searching always starts in
column zero and then matches before the cursor are skipped.
When the 'c' flag is present in 'cpo' the next search starts
after the match. Without the 'c' flag the next search starts
one column further.
When the 'z' flag is not given, forward searching always
starts in column zero and then matches before the cursor are
skipped. When the 'c' flag is present in 'cpo' the next
search starts after the match. Without the 'c' flag the next
search starts one column further. This matters for
overlapping matches.
When searching backwards and the 'z' flag is given then the
search starts in column zero, thus no match in the current
line will be found (unless wrapping around the end of the
file).
When the {stopline} argument is given then the search stops
after searching this line. This is useful to restrict the

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.2. Last change: 2020 Nov 12
*map.txt* For Vim version 8.2. Last change: 2020 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -319,13 +319,16 @@ Example of using <Cmd> halfway Insert mode: >
nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
command: it is executed as if an (unrestricted) |autocmd| was invoked.
command: it is executed as if an (unrestricted) |autocommand| was invoked.
Note:
- Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and
|CmdlineLeave| events, because no user interaction is expected.
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys.
- The command is not echo'ed, no need for <silent>.
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
- In Select mode, |:map| and |:vmap| command mappings are executed in
Visual mode. Use |:smap| to handle Select mode differently.
@@ -1238,9 +1241,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can
use this function: >
function s:SID()
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfun
func s:ScriptNumber()
return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
endfunc
The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to.

View File

@@ -1,4 +1,4 @@
*popup.txt* For Vim version 8.2. Last change: 2020 Oct 17
*popup.txt* For Vim version 8.2. Last change: 2020 Nov 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -101,7 +101,7 @@ CLOSING THE POPUP WINDOW *popup-close*
Normally the plugin that created the popup window is also in charge of closing
it. If somehow a popup hangs around, you can close all of them with: >
call popup_clear()
call popup_clear(1)
Some popups, such as notifications, close after a specified time. This can be
set with the "time" property on `popup_create()`.
Otherwise, a popup can be closed by clicking on the X in the top-right corner

View File

@@ -3006,7 +3006,7 @@ vimrc file: >
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
*ft-posix-synax* *ft-dash-syntax*
*ft-posix-syntax* *ft-dash-syntax*
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
This covers syntax highlighting for the older Unix (Bourne) sh, and newer

View File

@@ -2125,6 +2125,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:bad windows.txt /*:bad*
:badd windows.txt /*:badd*
:ball windows.txt /*:ball*
:balt windows.txt /*:balt*
:bar cmdline.txt /*:bar*
:bd windows.txt /*:bd*
:bdel windows.txt /*:bdel*
@@ -2724,6 +2725,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:map-<unique> map.txt /*:map-<unique>*
:map-alt-keys map.txt /*:map-alt-keys*
:map-arguments map.txt /*:map-arguments*
:map-cmd map.txt /*:map-cmd*
:map-commands map.txt /*:map-commands*
:map-expression map.txt /*:map-expression*
:map-local map.txt /*:map-local*
@@ -3506,6 +3508,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<CSI> intro.txt /*<CSI>*
<Char-> map.txt /*<Char->*
<Char> map.txt /*<Char>*
<Cmd> map.txt /*<Cmd>*
<CursorHold> autocmd.txt /*<CursorHold>*
<D- intro.txt /*<D-*
<D-c> os_mac.txt /*<D-c>*
@@ -3923,6 +3926,9 @@ E1112 eval.txt /*E1112*
E1113 eval.txt /*E1113*
E112 eval.txt /*E112*
E113 eval.txt /*E113*
E1135 map.txt /*E1135*
E1136 map.txt /*E1136*
E1137 map.txt /*E1137*
E114 eval.txt /*E114*
E115 eval.txt /*E115*
E116 eval.txt /*E116*
@@ -6549,7 +6555,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
ft-php3-syntax syntax.txt /*ft-php3-syntax*
ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
ft-posix-synax syntax.txt /*ft-posix-synax*
ft-posix-syntax syntax.txt /*ft-posix-syntax*
ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
ft-printcap-syntax syntax.txt /*ft-printcap-syntax*
@@ -7745,6 +7751,7 @@ mapmode-s map.txt /*mapmode-s*
mapmode-t map.txt /*mapmode-t*
mapmode-v map.txt /*mapmode-v*
mapmode-x map.txt /*mapmode-x*
mapnew() eval.txt /*mapnew()*
mapping map.txt /*mapping*
mapping-functions usr_41.txt /*mapping-functions*
mapset() eval.txt /*mapset()*

View File

@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.2. Last change: 2020 Sep 04
*terminal.txt* For Vim version 8.2. Last change: 2020 Nov 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -503,6 +503,8 @@ term_dumpdiff({filename}, {filename} [, {options}])
a different attribute
+ missing position in first file
- missing position in second file
> cursor position in first file, not in second
< cursor position in secone file, not in first
Using the "s" key the top and bottom parts are swapped. This
makes it easy to spot a difference.
@@ -1411,16 +1413,18 @@ If you don't want this then disable it with: >
Vim window width *termdebug_wide*
To change the width of the Vim window when debugging starts, and use a
vertical split: >
let g:termdebug_wide = 163
This will set &columns to 163 when `:Termdebug` is used. The value is restored
when quitting the debugger.
If g:termdebug_wide is set and &columns is already larger than
g:termdebug_wide then a vertical split will be used without changing &columns.
Set it to 1 to get a vertical split without every changing &columns (useful
for when the terminal can't be resized by Vim).
To change the width of the Vim window when debugging starts and use a vertical
split: >
let g:termdebug_wide = 163
This will set 'columns' to 163 when `:Termdebug` is used. The value is
restored when quitting the debugger.
If g:termdebug_wide is set and 'columns' is already a greater value, then a
vertical split will be used without modifying 'columns'.
Set g:termdebug_wide to 1 to use a vertical split without ever changing
'columns'. This is useful when the terminal can't be resized by Vim.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 04
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,21 +38,18 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
test_vim9_func fails: type from default value not used.
Coverity errors in October and November.
Without extra sleeps netbeans test has valgrind errors.
PR #7248 from Yegappan - test doesn't fail without code changes
Making everything work:
- Closure argument call should not always set varargs, like any function call?
- Invoke user command in a :def function
- Make map() give an error if the resulting type is wrong.
Add mapnew() or mapcopy() to create a new List/Dict for the result, which
can have a different value type.
- Error message for "'yes && 0" is "using String as a Number", should be "using
String as a Bool".
Vim9 - Change
- Drop support for #{} early December. Close #7310
-> Does it work to recognize lambda?
{x: int -> x + 5}
var int = 5
{x: int, y: int}
Vim9 - Making everything work:
- Make map() give an error if the resulting type of the first argument is
wrong. Only works if the type is known?
- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
- In autocmd: use legacy syntax, not whatever the current script uses?
- need to check type when a declaration specifies a type: #6507
let nr: number = 'asdf'
- Check many more builtin function arguments at compile time.
@@ -60,7 +57,7 @@ Making everything work:
the script-local function, not a global one.
- Make sure that where a callback is expected a function can be used (without
quotes). E.g. sort() and map(). Also at the script level.
- assignment to more complex lval: list[1][2][3] = 8
- assignment to more complex lval: list[1][2][3] = 8 #7309
Also "list[0] += value". test in Test_assign_dict_unknown_type().
- ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
Add command to parse range at runtime?
@@ -91,11 +88,13 @@ Making everything work:
- Check that when using a user function name without prefix, it does not find
a global function. Prefixing g: is required.
- Compile: for [key, value] in items(map)
- Assignment to dict doesn't work:
let ret: dict<string> = #{}
ret[i] = string(i)
- Appending to dict item doesn't work:
let d[i] ..= value
- Need the equivalent of get_lval() and set_var_lval() to implement assignment
to nested list and dict members.
- Assignment to dict doesn't work:
let ret: dict<string> = #{}
ret[i] = string(i)
- Appending to dict item doesn't work:
let d[i] ..= value
- Using ".." at script level doesn't convert arguments to a string.
- Compile replacement of :s command: s/pat/\=expr/
- Compile redir to local variable: var_redir_start().
@@ -114,8 +113,6 @@ Making everything work:
- expandcmd() with `=expr` in filename uses legacy expression.
- eval_expr() in ex_cexpr()
- eval_expr() call in dbg_parsearg() and debuggy_find()
- has() is compiled as a constant, but some checks are dynamic.
Check for dynamic values, such as "gui_running".
New syntax and functionality:
Improve error checking:
- "echo Func()" is an error if Func() does not return anything.
@@ -138,7 +135,7 @@ Also:
- implement enum
- Make accessing varargs faster: arg[expr]
EVAL expr
LOADVARARG (varags idx)
LOADVARARG (varargs idx)
- Make debugging work - at least per function. Need to recompile a function
to step through it line-by-line? Evaluate the stack and variables on the
stack?
@@ -348,6 +345,8 @@ Patch to make :q work with local arglist. (Christian Brabandt, #6286)
Why does Test_invalid_sid() not work in the GUI?
":pedit" ignores the local working directory when 'pvp' is set (#7267)
Lua: updating wrong buffer when using newly created, unloaded buffer.
(#6539)
@@ -417,9 +416,6 @@ Another spurious BufDelete. (Dani Dickstein, #5701)
Wrong error when using local arglist. (Harm te Hennepe, #6133)
Request to support <Cmd> in mappings, similar to how Neovim does this.
(Daniel Hahler, #4784)
Test loose_clipboard() by selecting text before suspending.
Undo puts cursor in wrong line after "cG<Esc>" undo.
@@ -441,9 +437,6 @@ Also put :argadd commands at the start for all buffers, so that their order
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
Also #5326: netrw buffers are not restored.
Alternate file is not set in the session file. Use setwintabvar("@#") ?
(#6714)
When 'backupdir' has a path ending in double slash (meaning: use full path of
the file) combined with 'patchmode' the file name is wrong. (#5791)
@@ -1067,7 +1060,7 @@ neovim #7431)
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
Nov 21)
When t_Co is changed from termresponse, the OptionSet autocmmand event isn't
When t_Co is changed from termresponse, the OptionSet autocommand event isn't
triggered. Use the code from the end of set_num_option() in
set_color_count().
@@ -1352,6 +1345,9 @@ no longer support.
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
4#1038)
sort() does not use 'smartcase' for the skip pattern, even though 'ignorecase'
is used. (Filipe Brandenburger, #7322)
+channel:
- Add a in_cb, invoked when the write buffer has become empty. (Matteo Landi)
- Add ch_readlines(): for a channel in NL mode, reads as many lines as are
@@ -2297,7 +2293,7 @@ Additional info by Dominique Pelle. (also on 2010 Apr 10)
CreateFile and CreateFileW are used without sharing, filewritable() fails when
the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ|
FILE_SHARE_WRITE in mch_access()? (Phillippe Vaucher, 2010 Nov 2)
FILE_SHARE_WRITE in mch_access()? (Philippe Vaucher, 2010 Nov 2)
Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29)
Looks like only bash can do it. (Yakov Lerner)
@@ -5933,7 +5929,7 @@ Writing files:
losing the original when writing twice. (Slootman)
7 On non-Unix machines, also overwrite the original file in some situations
(file system full, it's a link on an NFS partition).
7 When editing a file, check that it has been change outside of Vim more
7 When editing a file, check that it has been changed outside of Vim more
often, not only when writing over it. E.g., at the time the swap file is
flushed. Or every ten seconds or so (use the time of day, check it before
waiting for a character to be typed).

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.2. Last change: 2020 Aug 30
*usr_41.txt* For Vim version 8.2. Last change: 2020 Nov 09
VIM USER MANUAL - by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2020 Aug 20
*various.txt* For Vim version 8.2. Last change: 2020 Nov 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -142,15 +142,17 @@ g8 Print the hex values of the bytes used in the
quit
<
*:z* *E144*
:{range}z[+-^.=]{count} Display several lines of text surrounding the line
specified with {range}, or around the current line
if there is no {range}. If there is a {count}, that's
how many lines you'll see; if there is no {count} and
only one window then twice the value of the 'scroll'
option is used, otherwise the current window height
minus 3 is used.
:[range]z[+-^.=][count] Display several lines of text surrounding the line
specified with [range], or around the current line
if there is no [range].
If there is a {count} the 'window' option is set to
If there is a [count], that's how many lines you'll
see; if there is no [count] and only one window then
twice the value of the 'scroll' option is used,
otherwise the current window height minus 3 is used.
This is the value of "scr" in the table below.
If there is a [count] the 'window' option is set to
its value.
:z can be used either alone or followed by any of
@@ -168,7 +170,7 @@ g8 Print the hex values of the bytes used in the
If the mark is "=", a line of dashes is printed
around the current line.
:{range}z#[+-^.=]{count} *:z#*
:[range]z#[+-^.=][count] *:z#*
Like ":z", but number the lines.
*:=*

View File

@@ -1331,7 +1331,7 @@ eventhandler() Returns 1 when inside an event handler and interactive
executable() Checks if a program or batch script can be executed.
filewritable() Checks if a file can be written. (Ron Aaron)
foldclosed() Find out if there is a closed fold. (Johannes Zellner).
foldcloseend() Find the end of a closed fold.
foldclosedend() Find the end of a closed fold.
foldlevel() Find out the foldlevel. (Johannes Zellner)
foreground() Move the GUI window to the foreground.
getchar() Get one character from the user. Can be used to define a

View File

@@ -42557,7 +42557,7 @@ Files: src/buffer.c, src/testdir/test_statusline.vim,
src/testdir/dumps/Test_statusline_1.dump
Patch 8.2.0236
Problem: MS-Windows uninstall doesn't delete vimtutur.bat.
Problem: MS-Windows uninstall doesn't delete vimtutor.bat.
Solution: Change directory before deletion. (Ken Takata, closes #5603)
Files: src/uninstall.c

View File

@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Oct 17
*vim9.txt* For Vim version 8.2. Last change: 2020 Nov 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -112,8 +112,7 @@ In Vi # is a command to list text with numbers. In Vim9 script you can use
101 number
To improve readability there must be a space between a command and the #
that starts a comment. Note that #{ is the start of a dictionary, therefore
it does not start a comment.
that starts a comment.
Vim9 functions ~
@@ -303,8 +302,7 @@ identifier or can't be an Ex command. Examples: >
myList->add(123)
g:myList->add(123)
[1, 2, 3]->Process()
#{a: 1, b: 2}->Process()
{'a': 1, 'b': 2}->Process()
{a: 1, b: 2}->Process()
"foobar"->Process()
("foobar")->Process()
'foobar'->Process()
@@ -346,7 +344,7 @@ those cases there is no need to prefix the line with a backslash
'two',
]
And when a dict spans multiple lines: >
var mydict = #{
var mydict = {
one: 1,
two: 2,
}
@@ -430,6 +428,27 @@ No curly braces expansion ~
|curly-braces-names| cannot be used.
Dictionary literals ~
Traditionally Vim has supported dictionary literals with a {} syntax: >
let dict = {'key': value}
Later it became clear that using a simple key name is very common, thus
literally dictionaries were introduced in a backwards compatible way: >
let dict = #{key: value}
However, this #{} syntax is unlike any existing language. As it appears that
using a literal key is much more common than using an expression, and
considering that JavaScript uses this syntax, using the {} form for dictionary
literals was considered a much more useful syntax. In Vim9 script the {} form
uses literal keys: >
let dict = {key: value}
In case an expression needs to be used for the key, square brackets can be
used, just like in JavaScript: >
let dict = {["key" .. nr]: value}
No :xit, :t, :append, :change or :insert ~
These commands are too easily confused with local variable names.

View File

@@ -0,0 +1,21 @@
" Vim filetype plugin file
" Language: Protobuf Text Format
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
" Last Change: 2020 Nov 17
" Homepage: https://github.com/lakshayg/vim-pbtxt
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal commentstring=#\ %s
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@@ -404,6 +404,7 @@ an 50.90.120 &Syntax.PQ.Pam\ config :cal SetSyn("pamconf")<CR>
an 50.90.130 &Syntax.PQ.PApp :cal SetSyn("papp")<CR>
an 50.90.140 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR>
an 50.90.150 &Syntax.PQ.Password\ file :cal SetSyn("passwd")<CR>
an 50.90.490 &Syntax.PQ.Pbtxt :cal SetSyn("pbtxt")<CR>
an 50.90.160 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR>
an 50.90.170 &Syntax.PQ.PDF :cal SetSyn("pdf")<CR>
an 50.90.180 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR>

44
runtime/syntax/pbtxt.vim Normal file
View File

@@ -0,0 +1,44 @@
" Vim syntax file
" Language: Protobuf Text Format
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
" Last Change: 2020 Nov 17
" Homepage: https://github.com/lakshayg/vim-pbtxt
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
syn keyword pbtxtTodo TODO FIXME contained
syn keyword pbtxtBool true false contained
syn match pbtxtInt display "\<\(0\|[1-9]\d*\)\>"
syn match pbtxtHex display "\<0[xX]\x\+\>"
syn match pbtxtFloat display "\(0\|[1-9]\d*\)\=\.\d*"
syn match pbtxtMessage display "^\s*\w\+\s*{"me=e-1
syn match pbtxtField display "^\s*\w\+:"me=e-1
syn match pbtxtEnum display ":\s*\a\w\+"ms=s+1 contains=pbtxtBool
syn region pbtxtString start=+"+ skip=+\\"+ end=+"+ contains=@Spell
syn region pbtxtComment start="#" end="$" keepend contains=pbtxtTodo,@Spell
hi def link pbtxtTodo Todo
hi def link pbtxtBool Boolean
hi def link pbtxtInt Number
hi def link pbtxtHex Number
hi def link pbtxtFloat Float
hi def link pbtxtMessage Structure
hi def link pbtxtField Identifier
hi def link pbtxtEnum Define
hi def link pbtxtString String
hi def link pbtxtComment Comment
let b:current_syntax = "pbtxt"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
---> 6) Sugar is sweet
---> 7) And so are you.
Doubling to operate on a line also works for operators mentioned below
Doubling to operate on a line also works for operators mentioned below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 2.7: THE UNDO COMMAND
@@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
---> This line has a few words that need changing using the change operator.
Notice that ce deletes the word and places you in Insert mode.
cc does the same for the whole line
cc does the same for the whole line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
b)
NOTE: You can also use y as an operator: yw yanks one word,
yy yanks the whole line, then p puts that line
yy yanks the whole line, then p puts that line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 6.5: SET OPTION

View File

@@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
---> 6) Sugar is sweet
---> 7) And so are you.
Doubling to operate on a line also works for operators mentioned below
Doubling to operate on a line also works for operators mentioned below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 2.7: THE UNDO COMMAND
@@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
---> This line has a few words that need changing using the change operator.
Notice that ce deletes the word and places you in Insert mode.
cc does the same for the whole line
cc does the same for the whole line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
b)
NOTE: You can also use y as an operator: yw yanks one word,
yy yanks the whole line, then p puts that line
yy yanks the whole line, then p puts that line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 6.5: SET OPTION

View File

@@ -111,6 +111,7 @@ dict_free_contents(dict_T *d)
/*
* Clear hashtab "ht" and dict items it contains.
* If "ht" is not freed then you should call hash_init() next!
*/
void
hashtab_free_contents(hashtab_T *ht)
@@ -850,10 +851,32 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
while (**arg != '}' && **arg != NUL)
{
if ((literal
? get_literal_key(arg, &tvkey)
: eval1(arg, &tvkey, evalarg)) == FAIL) // recursive!
goto failret;
char_u *p = to_name_end(*arg, FALSE);
if (literal || (vim9script && *p == ':'))
{
if (get_literal_key(arg, &tvkey) == FAIL)
goto failret;
}
else
{
int has_bracket = vim9script && **arg == '[';
if (has_bracket)
*arg = skipwhite(*arg + 1);
if (eval1(arg, &tvkey, evalarg) == FAIL) // recursive!
goto failret;
if (has_bracket)
{
*arg = skipwhite(*arg);
if (**arg != ']')
{
emsg(_(e_missing_matching_bracket_after_dict_key));
return FAIL;
}
++*arg;
}
}
// the colon should come right after the key, but this wasn't checked
// previously, so only require it in Vim9 script.

View File

@@ -301,3 +301,7 @@ EXTERN char e_cmd_mapping_must_end_with_cr_before_second_cmd[]
INIT(=N_("E1136: <Cmd> mapping must end with <CR> before second <Cmd>"));
EXTERN char e_cmd_maping_must_not_include_str_key[]
INIT(= N_("E1137: <Cmd> mapping must not include %s key"));
EXTERN char e_using_bool_as_number[]
INIT(= N_("E1138: Using a Bool as a Number"));
EXTERN char e_missing_matching_bracket_after_dict_key[]
INIT(= N_("E1139: Missing matching bracket after dict key"));

View File

@@ -791,7 +791,7 @@ get_lval(
listitem_T *ni;
char_u *key = NULL;
int len;
hashtab_T *ht;
hashtab_T *ht = NULL;
int quiet = flags & GLV_QUIET;
// Clear everything in "lp".

View File

@@ -2628,7 +2628,28 @@ find_var(char_u *name, hashtab_T **htp, int no_autoload)
return ret;
// Search in parent scope for lambda
return find_var_in_scoped_ht(name, no_autoload || htp != NULL);
ret = find_var_in_scoped_ht(name, no_autoload || htp != NULL);
if (ret != NULL)
return ret;
// in Vim9 script items without a scope can be script-local
if (in_vim9script() && name[0] != NUL && name[1] != ':')
{
ht = get_script_local_ht();
if (ht != NULL)
{
ret = find_var_in_ht(ht, *name, varname,
no_autoload || htp != NULL);
if (ret != NULL)
{
if (htp != NULL)
*htp = ht;
return ret;
}
}
}
return NULL;
}
/*

View File

@@ -747,6 +747,9 @@ do_cmdline(
* cancel the whole command line, and any if/endif or loop.
* If force_abort is set, we cancel everything.
*/
#ifdef FEAT_EVAL
did_emsg_cumul += did_emsg;
#endif
did_emsg = FALSE;
/*
@@ -778,7 +781,12 @@ do_cmdline(
&& !(getline_is_func && func_has_abort(real_cookie))
#endif
)
{
#ifdef FEAT_EVAL
did_emsg_cumul += did_emsg;
#endif
did_emsg = FALSE;
}
/*
* 1. If repeating a line in a loop, get a line from lines_ga.
@@ -1026,7 +1034,10 @@ do_cmdline(
if (did_emsg && !force_abort
&& getline_equal(fgetline, cookie, get_func_line)
&& !func_has_abort(real_cookie))
{
// did_emsg_cumul is not set here
did_emsg = FALSE;
}
if (cstack.cs_looplevel > 0)
{
@@ -3471,6 +3482,11 @@ find_ex_command(
break;
}
// Not not recognize ":*" as the star command unless '*' is in
// 'cpoptions'.
if (eap->cmdidx == CMD_star && vim_strchr(p_cpo, CPO_STAR) == NULL)
p = eap->cmd;
// Look for a user defined command as a last resort. Let ":Print" be
// overruled by a user defined command.
if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)

View File

@@ -230,6 +230,8 @@ EXTERN int did_endif INIT(= FALSE); // just had ":endif"
EXTERN int did_emsg; // set by emsg() when the message
// is displayed or thrown
#ifdef FEAT_EVAL
EXTERN int did_emsg_cumul; // cumulative did_emsg, increased
// when did_emsg is reset.
EXTERN int called_vim_beep; // set if vim_beep() is called
EXTERN int did_uncaught_emsg; // emsg() was called and did not
// cause an exception

View File

@@ -1628,7 +1628,7 @@ init_prompt(int cmdchar_todo)
if (cmdchar_todo == 'A')
coladvance((colnr_T)MAXCOL);
if (cmdchar_todo == 'I' || curwin->w_cursor.col <= (int)STRLEN(prompt))
if (curwin->w_cursor.col < (int)STRLEN(prompt))
curwin->w_cursor.col = (int)STRLEN(prompt);
// Make sure the cursor is in a valid position.
check_cursor();

View File

@@ -867,6 +867,7 @@ list_concat(list_T *l1, list_T *l2, typval_T *tv)
if (l == NULL)
return FAIL;
tv->v_type = VAR_LIST;
tv->v_lock = 0;
tv->vval.v_list = l;
if (l1 == NULL)
++l->lv_refcount;

View File

@@ -2252,6 +2252,7 @@ swapfile_unchanged(char_u *fname)
mch_get_host_name(hostname, B0_HNAME_SIZE);
hostname[B0_HNAME_SIZE - 1] = NUL;
b0.b0_hname[B0_HNAME_SIZE - 1] = NUL; // in case of corruption
if (STRICMP(b0.b0_hname, hostname) != 0)
ret = FALSE;
}

View File

@@ -3871,9 +3871,10 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
else
{
(void)op_delete(oap);
if (oap->motion_type == MLINE && has_format_option(FO_AUTO))
u_save_cursor(); // cursor line wasn't saved yet
auto_format(FALSE, TRUE);
// save cursor line for undo if it wasn't saved yet
if (oap->motion_type == MLINE && has_format_option(FO_AUTO)
&& u_save_cursor() == OK)
auto_format(FALSE, TRUE);
}
break;

View File

@@ -3692,7 +3692,7 @@ update_popups(void (*win_update)(win_T *wp))
int row;
int wincol;
int padcol = 0;
int padwidth = 0;
int padendcol = 0;
int i;
int sb_thumb_top = 0;
int sb_thumb_height = 0;
@@ -3705,6 +3705,9 @@ update_popups(void (*win_update)(win_T *wp))
popup_reset_handled(POPUP_HANDLED_5);
while ((wp = find_next_popup(TRUE, POPUP_HANDLED_5)) != NULL)
{
int title_len = 0;
int title_wincol;
// This drawing uses the zindex of the popup window, so that it's on
// top of the text but doesn't draw when another popup with higher
// zindex is on top of the character.
@@ -3798,16 +3801,47 @@ update_popups(void (*win_update)(win_T *wp))
border_attr[i] = syn_name2attr(wp->w_border_highlight[i]);
}
// Title goes on top of border or padding.
title_wincol = wp->w_wincol + 1;
if (wp->w_popup_title != NULL)
{
char_u *title_text;
title_len = (int)STRLEN(wp->w_popup_title);
title_text = alloc(title_len + 1);
trunc_string(wp->w_popup_title, title_text,
total_width - 2, title_len + 1);
screen_puts(title_text, wp->w_winrow, title_wincol,
wp->w_popup_border[0] > 0 ? border_attr[0] : popup_attr);
vim_free(title_text);
if (title_len > total_width - 2)
title_len = total_width - 2;
}
wincol = wp->w_wincol - wp->w_popup_leftoff;
top_padding = wp->w_popup_padding[0];
if (wp->w_popup_border[0] > 0)
{
// top border
screen_fill(wp->w_winrow, wp->w_winrow + 1,
wincol < 0 ? 0 : wincol, wincol + total_width,
wp->w_popup_border[3] != 0 && wp->w_popup_leftoff == 0
// top border; do not draw over the title
if (title_len > 0)
{
screen_fill(wp->w_winrow, wp->w_winrow + 1,
wincol < 0 ? 0 : wincol, title_wincol,
wp->w_popup_border[3] != 0 && wp->w_popup_leftoff == 0
? border_char[4] : border_char[0],
border_char[0], border_attr[0]);
border_char[0], border_attr[0]);
screen_fill(wp->w_winrow, wp->w_winrow + 1,
title_wincol + title_len, wincol + total_width,
border_char[0], border_char[0], border_attr[0]);
}
else
{
screen_fill(wp->w_winrow, wp->w_winrow + 1,
wincol < 0 ? 0 : wincol, wincol + total_width,
wp->w_popup_border[3] != 0 && wp->w_popup_leftoff == 0
? border_char[4] : border_char[0],
border_char[0], border_attr[0]);
}
if (wp->w_popup_border[1] > 0 && wp->w_popup_rightoff == 0)
{
buf[mb_char2bytes(border_char[5], buf)] = NUL;
@@ -3821,32 +3855,30 @@ update_popups(void (*win_update)(win_T *wp))
if (top_padding > 0 || wp->w_popup_padding[2] > 0)
{
padcol = wincol + wp->w_popup_border[3];
padwidth = wp->w_wincol + total_width - wp->w_popup_border[1]
padendcol = wp->w_wincol + total_width - wp->w_popup_border[1]
- wp->w_has_scrollbar;
if (padcol < 0)
{
padwidth += padcol;
padendcol += padcol;
padcol = 0;
}
}
if (top_padding > 0)
{
// top padding
// top padding; do not draw over the title
row = wp->w_winrow + wp->w_popup_border[0];
screen_fill(row, row + top_padding, padcol, padwidth,
if (title_len > 0)
{
screen_fill(row, row + top_padding, padcol, title_wincol,
' ', ' ', popup_attr);
}
// Title goes on top of border or padding.
if (wp->w_popup_title != NULL)
{
int len = (int)STRLEN(wp->w_popup_title) + 1;
char_u *title = alloc(len);
trunc_string(wp->w_popup_title, title, total_width - 2, len);
screen_puts(title, wp->w_winrow, wp->w_wincol + 1,
wp->w_popup_border[0] > 0 ? border_attr[0] : popup_attr);
vim_free(title);
screen_fill(row, row + top_padding, title_wincol + title_len,
padendcol, ' ', ' ', popup_attr);
}
else
{
screen_fill(row, row + top_padding, padcol, padendcol,
' ', ' ', popup_attr);
}
}
// Compute scrollbar thumb position and size.
@@ -3948,7 +3980,7 @@ update_popups(void (*win_update)(win_T *wp))
row = wp->w_winrow + wp->w_popup_border[0]
+ wp->w_popup_padding[0] + wp->w_height;
screen_fill(row, row + wp->w_popup_padding[2],
padcol, padwidth, ' ', ' ', popup_attr);
padcol, padendcol, ' ', ' ', popup_attr);
}
if (wp->w_popup_border[2] > 0)

View File

@@ -8,6 +8,7 @@ imported_T *find_imported_in_script(char_u *name, size_t len, int sid);
int vim9_comment_start(char_u *p);
char_u *peek_next_line_from_context(cctx_T *cctx);
char_u *next_line_from_context(cctx_T *cctx, int skip_comment);
char_u *to_name_end(char_u *arg, int use_namespace);
char_u *to_name_const_end(char_u *arg);
exptype_T get_compare_type(char_u *p, int *len, int *type_is);
void error_white_both(char_u *op, int len);

View File

@@ -297,7 +297,7 @@ static struct builtin_term builtin_termcaps[] =
{(int)KS_UE, "\033[0m"},
{(int)KS_CZH, "\033[3m"},
{(int)KS_CZR, "\033[0m"},
#if defined(__MORPHOS__) || defined(__AROS__)
#if defined(__amigaos4__) || defined(__MORPHOS__) || defined(__AROS__)
{(int)KS_CCO, "8"}, // allow 8 colors
# ifdef TERMINFO
{(int)KS_CAB, "\033[4%p1%dm"},// set background color

View File

@@ -136,6 +136,13 @@ else
let s:t_normal = &t_me
endif
if has('mac')
" In MacOS, when starting a shell in a terminal, a bash deprecation warning
" message is displayed. This breaks the terminal test. Disable the warning
" message.
let $BASH_SILENCE_DEPRECATION_WARNING = 1
endif
" Prepare for calling test_garbagecollect_now().
let v:testing = 1

View File

@@ -2181,18 +2181,21 @@ func Test_issue_5150()
else
let cmd = 'grep foo'
endif
let g:job = job_start(cmd, {})
sleep 50m " give the job time to start
call job_stop(g:job)
sleep 50m
call assert_equal(-1, job_info(g:job).exitval)
call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
let g:job = job_start(cmd, {})
sleep 50m
call job_stop(g:job, 'term')
sleep 50m
call assert_equal(-1, job_info(g:job).exitval)
call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
let g:job = job_start(cmd, {})
call job_stop(g:job, 'kill')
sleep 50m
call assert_equal(-1, job_info(g:job).exitval)
call job_stop(g:job, 'kill')
call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
endfunc
func Test_issue_5485()

View File

@@ -63,8 +63,9 @@ func Test_client_server()
call remote_send(name, ":gui -f\<CR>")
endif
" Wait for the server to be up and answering requests.
sleep 100m
call WaitForAssert({-> assert_true(name->remote_expr("v:version", "", 1) != "")})
" When using valgrind this can be very, very slow.
sleep 1
call WaitForAssert({-> assert_match('\d', name->remote_expr("v:version", "", 1))}, 10000)
call remote_send(name, ":let testvar = 'maybe'\<CR>")
call WaitForAssert({-> assert_equal('maybe', remote_expr(name, "testvar", "", 2))})

View File

@@ -84,7 +84,7 @@ func Test_complete_wildmenu()
call delete('Xdir1', 'd')
set nowildmenu
endfunc
f
func Test_wildmenu_screendump()
CheckScreendump
@@ -112,7 +112,6 @@ func Test_wildmenu_screendump()
call delete('XTest_wildmenu')
endfunc
func Test_map_completion()
CheckFeature cmdline_compl
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
@@ -1631,4 +1630,34 @@ func Test_read_shellcmd()
endif
endfunc
" Test for going up and down the directory tree using 'wildmenu'
func Test_wildmenu_dirstack()
CheckUnix
%bw!
call mkdir('Xdir1/dir2/dir3', 'p')
call writefile([], 'Xdir1/file1_1.txt')
call writefile([], 'Xdir1/file1_2.txt')
call writefile([], 'Xdir1/dir2/file2_1.txt')
call writefile([], 'Xdir1/dir2/file2_2.txt')
call writefile([], 'Xdir1/dir2/dir3/file3_1.txt')
call writefile([], 'Xdir1/dir2/dir3/file3_2.txt')
cd Xdir1/dir2/dir3
set wildmenu
call feedkeys(":e \<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e file3_1.txt', @:)
call feedkeys(":e \<Tab>\<Up>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e ../dir3/', @:)
call feedkeys(":e \<Tab>\<Up>\<Up>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e ../../dir2/', @:)
call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e ../../dir2/dir3/', @:)
call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", 'xt')
call assert_equal('"e ../../dir2/dir3/file3_1.txt', @:)
cd -
call delete('Xdir1', 'rf')
set wildmenu&
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -17,14 +17,18 @@ func CheckCWD()
endfunc
command! -nargs=0 -bar CheckCWD call CheckCWD()
" "options" argument can contain:
" 'msec' - time to wait for a match
" 'match' - "pattern" to use "lines" as pattern instead of text
func CheckDbgOutput(buf, lines, options = {})
" Verify the expected output
let lnum = 20 - len(a:lines)
let msec = get(a:options, 'msec', 1000)
for l in a:lines
if get(a:options, 'match', 'equal') ==# 'pattern'
call WaitForAssert({-> assert_match(l, term_getline(a:buf, lnum))}, 200)
call WaitForAssert({-> assert_match(l, term_getline(a:buf, lnum))}, msec)
else
call WaitForAssert({-> assert_equal(l, term_getline(a:buf, lnum))}, 200)
call WaitForAssert({-> assert_equal(l, term_getline(a:buf, lnum))}, msec)
endif
let lnum += 1
endfor
@@ -198,7 +202,7 @@ func Test_Debugger()
" Start a debug session, so that reading the last line from the terminal
" works properly.
call RunDbgCmd(buf, ':debug echo Foo()')
call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()'])
" No breakpoints
call RunDbgCmd(buf, 'breakl', ['No breakpoints defined'])
@@ -809,9 +813,10 @@ func Test_Backtrace_CmdLine()
\ '-S Xtest1.vim -c "debug call GlobalFunction()"',
\ {'wait_for_ruler': 0})
" Need to wait for the vim-in-terminal to be ready
" Need to wait for the vim-in-terminal to be ready.
" With valgrind this can take quite long.
call CheckDbgOutput(buf, ['command line',
\ 'cmd: call GlobalFunction()'])
\ 'cmd: call GlobalFunction()'], #{msec: 5000})
" At this point the ontly thing in the stack is the cmdline
call RunDbgCmd(buf, 'backtrace', [
@@ -960,14 +965,14 @@ func Test_debug_backtrace_level()
" set a breakpoint and source file1.vim
let buf = RunVimInTerminal(
\ '-c "breakadd file 1 Xtest1.vim" -S Xtest1.vim',
\ #{ wait_for_ruler: 0 } )
\ #{wait_for_ruler: 0})
call CheckDbgOutput(buf, [
\ 'Breakpoint in "' .. file1 .. '" line 1',
\ 'Entering Debug mode. Type "cont" to continue.',
\ 'command line..script ' .. file1,
\ 'line 1: let s:file1_var = ''file1'''
\ ])
\ ], #{msec: 5000})
" step throught the initial declarations
call RunDbgCmd(buf, 'step', [ 'line 2: let g:global_var = ''global''' ] )

View File

@@ -815,7 +815,13 @@ func Test_shell()
CheckUnix
let save_shell = &shell
set shell=
call assert_fails('shell', 'E91:')
let caught_e91 = 0
try
shell
catch /E91:/
let caught_e91 = 1
endtry
call assert_equal(1, caught_e91)
let &shell = save_shell
endfunc

View File

@@ -605,6 +605,7 @@ func Test_popup_drag_termwin()
endfor
%foldclose
set shell=/bin/sh noruler
unlet $PROMPT_COMMAND
let $PS1 = 'vim> '
terminal ++rows=4
$wincmd w

View File

@@ -85,9 +85,12 @@ func Test_prompt_editing()
call term_sendkeys(buf, left . left . left . bs . '-')
call WaitForAssert({-> assert_equal('cmd: -hel', term_getline(buf, 1))})
call term_sendkeys(buf, "\<C-O>lz")
call WaitForAssert({-> assert_equal('cmd: -hzel', term_getline(buf, 1))})
let end = "\<End>"
call term_sendkeys(buf, end . "x")
call WaitForAssert({-> assert_equal('cmd: -helx', term_getline(buf, 1))})
call WaitForAssert({-> assert_equal('cmd: -hzelx', term_getline(buf, 1))})
call term_sendkeys(buf, "\<C-U>exit\<CR>")
call WaitForAssert({-> assert_equal('other buffer', term_getline(buf, 1))})

View File

@@ -98,8 +98,6 @@ func Do_test_quotestar_for_x11()
" Running in a terminal and the GUI is available: Tell the server to open
" the GUI and check that the remote command still works.
" Need to wait for the GUI to start up, otherwise the send hangs in trying
" to send to the terminal window.
if has('gui_athena') || has('gui_motif')
" For those GUIs, ignore the 'failed to create input context' error.
call remote_send(name, ":call test_ignore_error('E285') | gui -f\<CR>")
@@ -107,7 +105,10 @@ func Do_test_quotestar_for_x11()
call remote_send(name, ":gui -f\<CR>")
endif
" Wait for the server in the GUI to be up and answering requests.
" First need to wait for the GUI to start up, otherwise the send hangs in
" trying to send to the terminal window.
" On some systems and with valgrind this can be very slow.
sleep 1
call WaitForAssert({-> assert_match("1", remote_expr(name, "has('gui_running')", "", 1))}, 10000)
call remote_send(name, ":let @* = 'maybe'\<CR>")

View File

@@ -416,8 +416,9 @@ func Test_swap_auto_delete()
" Forget about the file, recreate the swap file, then edit it again. The
" swap file should be automatically deleted.
bwipe!
" change the process ID to avoid the "still running" warning
let swapfile_bytes[24] = 0x99
" Change the process ID to avoid the "still running" warning. Must add four
" for MS-Windows to see it as a different one.
let swapfile_bytes[24] = swapfile_bytes[24] + 4
call writefile(swapfile_bytes, swapfile_name)
edit Xtest.scr
" will end up using the same swap file after deleting the existing one
@@ -433,7 +434,7 @@ func Test_swap_auto_delete()
augroup END
" change the host name
let swapfile_bytes[28 + 40] = 0x89
let swapfile_bytes[28 + 40] = swapfile_bytes[28 + 40] + 2
call writefile(swapfile_bytes, swapfile_name)
edit Xtest.scr
call assert_equal(1, filereadable(swapfile_name))

View File

@@ -226,7 +226,7 @@ enddef
def Wrong_dict_key_type(items: list<number>): list<number>
return filter(items, {_, val -> get({val: 1}, 'x')})
return filter(items, {_, val -> get({[val]: 1}, 'x')})
enddef
def Test_filter_wrong_dict_key_type()

View File

@@ -634,5 +634,19 @@ def Test_f_args()
CheckScriptSuccess(lines)
enddef
def Test_star_command()
var lines =<< trim END
vim9script
@s = 'g:success = 8'
set cpo+=*
exe '*s'
assert_equal(8, g:success)
unlet g:success
set cpo-=*
assert_fails("exe '*s'", 'E1050:')
END
CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -1292,6 +1292,13 @@ func Test_expr5_fails()
call CheckDefFailure(["var x = 'a' .. 0z32"], 'E1105:', 1)
call CheckDefFailure(["var x = 'a' .. function('len')"], 'E1105:', 1)
call CheckDefFailure(["var x = 'a' .. function('len', ['a'])"], 'E1105:', 1)
call CheckScriptFailure(['vim9script', 'var x = 1 + v:none'], 'E611:', 2)
call CheckScriptFailure(['vim9script', 'var x = 1 + v:null'], 'E611:', 2)
call CheckScriptFailure(['vim9script', 'var x = 1 + v:true'], 'E1138:', 2)
call CheckScriptFailure(['vim9script', 'var x = 1 + v:false'], 'E1138:', 2)
call CheckScriptFailure(['vim9script', 'var x = 1 + true'], 'E1138:', 2)
call CheckScriptFailure(['vim9script', 'var x = 1 + false'], 'E1138:', 2)
endfunc
func Test_expr5_fails_channel()
@@ -1876,6 +1883,9 @@ def Test_epxr7_funcref()
CheckDefAndScriptSuccess(lines)
enddef
let g:test_space_dict = {'': 'empty', ' ': 'space'}
let g:test_hash_dict = #{one: 1, two: 2}
def Test_expr7_dict()
# dictionary
var lines =<< trim END
@@ -1884,17 +1894,17 @@ def Test_expr7_dict()
assert_equal(g:dict_one, {'one': 1})
var key = 'one'
var val = 1
assert_equal(g:dict_one, {key: val})
assert_equal(g:dict_one, {[key]: val})
var numbers: dict<number> = #{a: 1, b: 2, c: 3}
var numbers: dict<number> = {a: 1, b: 2, c: 3}
numbers = #{a: 1}
numbers = #{}
var strings: dict<string> = #{a: 'a', b: 'b', c: 'c'}
var strings: dict<string> = {a: 'a', b: 'b', c: 'c'}
strings = #{a: 'x'}
strings = #{}
var mixed: dict<any> = #{a: 'a', b: 42}
var mixed: dict<any> = {a: 'a', b: 42}
mixed = #{a: 'x'}
mixed = #{a: 234}
mixed = #{}
@@ -1908,6 +1918,9 @@ def Test_expr7_dict()
dictdict = #{one: #{}, two: #{}}
assert_equal({'': 0}, {matchstr('string', 'wont match'): 0})
assert_equal(g:test_space_dict, {['']: 'empty', [' ']: 'space'})
assert_equal(g:test_hash_dict, {one: 1, two: 2})
END
CheckDefAndScriptSuccess(lines)
@@ -1922,7 +1935,7 @@ def Test_expr7_dict()
CheckDefFailure(["var x = #{xxx: 1", "var y = 2"], 'E722:', 2)
CheckDefFailure(["var x = #{xxx: 1,"], 'E723:', 2)
CheckDefFailure(["var x = {'a': xxx}"], 'E1001:', 1)
CheckDefFailure(["var x = {xxx: 8}"], 'E1001:', 1)
CheckDefFailure(["var x = {xx-x: 8}"], 'E1001:', 1)
CheckDefFailure(["var x = #{a: 1, a: 2}"], 'E721:', 1)
CheckDefFailure(["var x = #"], 'E1015:', 1)
CheckDefExecFailure(["var x = g:anint.member"], 'E715:', 1)
@@ -2293,12 +2306,29 @@ def Test_expr7_parens_vim9script()
CheckScriptSuccess(lines)
enddef
def Test_expr7_negate()
def Test_expr7_negate_add()
assert_equal(-99, -99)
assert_equal(-99, - 99)
assert_equal(99, --99)
assert_equal(99, -- 99)
assert_equal(99, - - 99)
assert_equal(99, +99)
assert_equal(-99, -+99)
assert_equal(-99, -+ 99)
assert_equal(-99, - +99)
assert_equal(-99, - + 99)
assert_equal(-99, +-99)
assert_equal(-99, + -99)
assert_equal(-99, + - 99)
var nr = 88
assert_equal(-88, -nr)
assert_equal(88, --nr)
assert_equal(-88, - nr)
assert_equal(-88, - +nr)
assert_equal(88, -- nr)
assert_equal(88, + nr)
assert_equal(88, --+ nr)
assert_equal(88, - - nr)
enddef
def Echo(arg: any): string

View File

@@ -37,7 +37,7 @@ def TestCompilingError()
for i in range(1, 9)
text ..= term_getline(buf, i)
endfor
if text =~ 'Error detected'
if text =~ 'Variable not found: nothing'
break
endif
sleep 20m
@@ -1476,6 +1476,15 @@ def Test_line_continuation_in_def()
Line_continuation_in_def('.')->assert_equal('full')
enddef
def Test_script_var_in_lambda()
var lines =<< trim END
vim9script
var script = 'test'
assert_equal(['test'], map(['one'], {-> script}))
END
CheckScriptSuccess(lines)
enddef
def Line_continuation_in_lambda(): list<string>
var x = range(97, 100)
->map({_, v -> nr2char(v)
@@ -1569,7 +1578,7 @@ enddef
def TreeWalk(dir: string): list<any>
return readdir(dir)->map({_, val ->
fnamemodify(dir .. '/' .. val, ':p')->isdirectory()
? {val: TreeWalk(dir .. '/' .. val)}
? {[val]: TreeWalk(dir .. '/' .. val)}
: val
})
enddef
@@ -1695,5 +1704,19 @@ def Test_block_scoped_var()
CheckScriptSuccess(lines)
enddef
def Test_reset_did_emsg()
var lines =<< trim END
@s = 'blah'
au BufWinLeave * #
def Func()
var winid = popup_create('popup', {})
exe '*s'
popup_close(winid)
enddef
Func()
END
CheckScriptFailure(lines, 'E492:', 8)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -416,7 +416,7 @@ def Test_try_catch()
var nd: dict<any>
try
nd = {g:anumber: 1}
nd = {[g:anumber]: 1}
catch /E1012:/
n = 266
endtry
@@ -459,7 +459,7 @@ def Test_try_catch()
assert_equal(322, n)
try
d = {'text': 1, g:astring: 2}
d = {text: 1, [g:astring]: 2}
catch /E721:/
n = 333
endtry

View File

@@ -213,7 +213,10 @@ tv_get_bool_or_number_chk(typval_T *varp, int *denote, int want_bool)
case VAR_SPECIAL:
if (!want_bool && in_vim9script())
{
emsg(_("E611: Using a Special as a Number"));
if (varp->v_type == VAR_BOOL)
emsg(_(e_using_bool_as_number));
else
emsg(_("E611: Using a Special as a Number"));
break;
}
return varp->vval.v_number == VVAL_TRUE ? 1 : 0;

View File

@@ -750,6 +750,46 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2031,
/**/
2030,
/**/
2029,
/**/
2028,
/**/
2027,
/**/
2026,
/**/
2025,
/**/
2024,
/**/
2023,
/**/
2022,
/**/
2021,
/**/
2020,
/**/
2019,
/**/
2018,
/**/
2017,
/**/
2016,
/**/
2015,
/**/
2014,
/**/
2013,
/**/
2012,
/**/
2011,
/**/

View File

@@ -2767,12 +2767,12 @@ theend:
/*
* Find the end of a variable or function name. Unlike find_name_end() this
* does not recognize magic braces.
* When "namespace" is TRUE recognize "b:", "s:", etc.
* When "use_namespace" is TRUE recognize "b:", "s:", etc.
* Return a pointer to just after the name. Equal to "arg" if there is no
* valid name.
*/
static char_u *
to_name_end(char_u *arg, int namespace)
char_u *
to_name_end(char_u *arg, int use_namespace)
{
char_u *p;
@@ -2784,7 +2784,7 @@ to_name_end(char_u *arg, int namespace)
// Include a namespace such as "s:var" and "v:var". But "n:" is not
// and can be used in slice "[n:]".
if (*p == ':' && (p != arg + 1
|| !namespace
|| !use_namespace
|| vim_strchr(VIM9_NAMESPACE_CHAR, *arg) == NULL))
break;
return p;
@@ -2988,7 +2988,8 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal, ppconst_T *ppconst)
*arg = skipwhite(*arg + 1);
for (;;)
{
char_u *key = NULL;
char_u *key = NULL;
char_u *end;
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{
@@ -2999,10 +3000,14 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal, ppconst_T *ppconst)
if (**arg == '}')
break;
if (literal)
// Eventually {name: value} will use "name" as a literal key and
// {[expr]: value} for an evaluated key.
// Temporarily: if "name" is indeed a valid key, or "[expr]" is
// used, use the new method, like JavaScript. Otherwise fall back
// to the old method.
end = to_name_end(*arg, FALSE);
if (literal || *end == ':')
{
char_u *end = to_name_end(*arg, !literal);
if (end == *arg)
{
semsg(_(e_invalid_key_str), *arg);
@@ -3015,8 +3020,11 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal, ppconst_T *ppconst)
}
else
{
isn_T *isn;
isn_T *isn;
int has_bracket = **arg == '[';
if (has_bracket)
*arg = skipwhite(*arg + 1);
if (compile_expr0(arg, cctx) == FAIL)
return FAIL;
isn = ((isn_T *)instr->ga_data) + instr->ga_len - 1;
@@ -3025,11 +3033,21 @@ compile_dict(char_u **arg, cctx_T *cctx, int literal, ppconst_T *ppconst)
else
{
type_T *keytype = ((type_T **)stack->ga_data)
[stack->ga_len - 1];
[stack->ga_len - 1];
if (need_type(keytype, &t_string, -1, cctx,
FALSE, FALSE) == FAIL)
FALSE, FALSE) == FAIL)
return FAIL;
}
if (has_bracket)
{
*arg = skipwhite(*arg);
if (**arg != ']')
{
emsg(_(e_missing_matching_bracket_after_dict_key));
return FAIL;
}
++*arg;
}
}
// Check for duplicate keys, if using string keys.
@@ -3362,6 +3380,8 @@ compile_leader(cctx_T *cctx, int numeric_only, char_u *start, char_u **end)
while (p > start)
{
--p;
while (VIM_ISWHITE(*p))
--p;
if (*p == '-' || *p == '+')
{
int negate = *p == '-';

View File

@@ -833,7 +833,7 @@ call_def_function(
int defcount = ufunc->uf_args.ga_len - argc;
sctx_T save_current_sctx = current_sctx;
int breakcheck_count = 0;
int did_emsg_before = did_emsg;
int did_emsg_before = did_emsg_cumul + did_emsg;
int save_suppress_errthrow = suppress_errthrow;
msglist_T **saved_msg_list = NULL;
msglist_T *private_msg_list = NULL;
@@ -859,7 +859,7 @@ call_def_function(
|| (ufunc->uf_def_status == UF_TO_BE_COMPILED
&& compile_def_function(ufunc, FALSE, NULL) == FAIL))
{
if (did_emsg == did_emsg_before)
if (did_emsg_cumul + did_emsg == did_emsg_before)
semsg(_(e_function_is_not_compiled_str),
printable_func_name(ufunc));
return FAIL;
@@ -1086,13 +1086,10 @@ call_def_function(
// execute Ex command line
case ISN_EXEC:
{
int save_did_emsg = did_emsg;
SOURCING_LNUM = iptr->isn_lnum;
do_cmdline_cmd(iptr->isn_arg.string);
// do_cmdline_cmd() will reset did_emsg, but we want to
// keep track of the count to compare with did_emsg_before.
did_emsg += save_did_emsg;
if (did_emsg)
goto on_error;
}
break;
@@ -1203,7 +1200,10 @@ call_def_function(
}
ectx.ec_stack.ga_len -= count;
if (failed)
{
ga_clear(&ga);
goto on_error;
}
if (ga.ga_data != NULL)
{
@@ -1211,6 +1211,11 @@ call_def_function(
{
SOURCING_LNUM = iptr->isn_lnum;
do_cmdline_cmd((char_u *)ga.ga_data);
if (did_emsg)
{
ga_clear(&ga);
goto on_error;
}
}
else
{
@@ -2894,7 +2899,7 @@ func_return:
on_error:
// If "emsg_silent" is set then ignore the error.
if (did_emsg == did_emsg_before && emsg_silent)
if (did_emsg_cumul + did_emsg == did_emsg_before && emsg_silent)
continue;
// If we are not inside a try-catch started here, abort execution.
@@ -2952,7 +2957,7 @@ failed_early:
// Not sure if this is necessary.
suppress_errthrow = save_suppress_errthrow;
if (ret != OK && did_emsg == did_emsg_before)
if (ret != OK && did_emsg_cumul + did_emsg == did_emsg_before)
semsg(_(e_unknown_error_while_executing_str),
printable_func_name(ufunc));
funcdepth_restore(orig_funcdepth);