Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2022-11-09 13:56:35 -08:00
71 changed files with 522 additions and 302 deletions
+1
View File
@@ -363,6 +363,7 @@ runtime/syntax/haml.vim @tpope
runtime/syntax/hare.vim @rsaihe
runtime/syntax/haskell.vim @coot
runtime/syntax/hgcommit.vim @k-takata
runtime/syntax/hollywood.vim @sodero
runtime/syntax/html.vim @dkearns
runtime/syntax/i3config.vim @hiqua
runtime/syntax/icon.vim @dkearns
+21 -12
View File
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.0. Last change: 2022 Oct 21
*builtin.txt* For Vim version 9.0. Last change: 2022 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -808,8 +808,10 @@ append({lnum}, {text}) *append()*
{lnum} can be zero to insert a line before the first one.
{lnum} is used like with |getline()|.
Returns 1 for failure ({lnum} out of range or out of memory),
0 for success. In |Vim9| script an invalid argument or
negative number results in an error. Example: >
0 for success. When {text} is an empty list zero is returned,
no matter the value of {lnum}.
In |Vim9| script an invalid argument or negative number
results in an error. Example: >
:let failed = append(line('$'), "# THE END")
:let failed = append(0, ["Chapter 1", "the beginning"])
@@ -837,7 +839,9 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
If {buf} is not a valid buffer or {lnum} is not valid, an
error message is given. Example: >
:let failed = appendbufline(13, 0, "# THE START")
<
< However, when {text} is an empty list then no error is given
for an invalid {lnum}, since {lnum} isn't actually used.
Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->appendbufline(buf, lnum)
@@ -983,7 +987,7 @@ autocmd_add({acmds}) *autocmd_add()*
let acmd.bufnr = 5
let acmd.cmd = 'call BufEnterFunc()'
call autocmd_add([acmd])
<
Can also be used as a |method|: >
GetAutocmdList()->autocmd_add()
<
@@ -1319,7 +1323,8 @@ bufwinid({buf}) *bufwinid()*
echo "A window containing buffer 1 is " .. (bufwinid(1))
<
Only deals with the current tab page.
Only deals with the current tab page. See |win_findbuf()| for
finding more.
Can also be used as a |method|: >
FindBuffer()->bufwinid()
@@ -1587,7 +1592,7 @@ col({expr}) The result is a Number, which is the byte index of the column
column is one higher if the cursor is after the end of the
line. Also, when using a <Cmd> mapping the cursor isn't
moved, this can be used to obtain the column in Insert mode: >
:imap <F2> <Cmd>echo col(".")<CR>
:imap <F2> <Cmd>echowin col(".")<CR>
< Can also be used as a |method|: >
GetPos()->col()
@@ -2771,7 +2776,7 @@ flattennew({list} [, {maxdepth}]) *flattennew()*
float2nr({expr}) *float2nr()*
Convert {expr} to a Number by omitting the part after the
decimal point.
{expr} must evaluate to a |Float| or a Number.
{expr} must evaluate to a |Float| or a |Number|.
Returns 0 if {expr} is not a |Float| or a |Number|.
When the value of {expr} is out of range for a |Number| the
result is truncated to 0x7fffffff or -0x7fffffff (or when
@@ -7875,9 +7880,10 @@ setbufline({buf}, {lnum}, {text}) *setbufline()*
To insert lines use |appendbufline()|.
Any text properties in {lnum} are cleared.
{text} can be a string to set one line, or a list of strings
to set multiple lines. If the list extends below the last
line then those lines are added.
{text} can be a string to set one line, or a List of strings
to set multiple lines. If the List extends below the last
line then those lines are added. If the List is empty then
nothing is changed and zero is returned.
For the use of {buf}, see |bufname()| above.
@@ -8062,7 +8068,8 @@ setline({lnum}, {text}) *setline()*
When {lnum} is just below the last line the {text} will be
added below the last line.
{text} can be any type or a List of any type, each item is
converted to a String.
converted to a String. When {text} is an empty List then
nothing is changed and FALSE is returned.
If this succeeds, FALSE is returned. If this fails (most likely
because {lnum} is invalid) TRUE is returned.
@@ -10222,6 +10229,7 @@ win_move_separator({nr}, {offset}) *win_move_separator()*
FALSE otherwise.
This will fail for the rightmost window and a full-width
window, since it has no separator on the right.
Only works for the current tab page. *E1308*
Can also be used as a |method|: >
GetWinnr()->win_move_separator(offset)
@@ -10236,6 +10244,7 @@ win_move_statusline({nr}, {offset}) *win_move_statusline()*
movement may be smaller than specified (e.g., as a consequence
of maintaining 'winminheight'). Returns TRUE if the window can
be found and FALSE otherwise.
Only works for the current tab page.
Can also be used as a |method|: >
GetWinnr()->win_move_statusline(offset)
+1 -1
View File
@@ -465,7 +465,7 @@ a close callback to the channel.
To read all normal output from a RAW channel that is available: >
let output = ch_readraw(channel)
To read all error output from a RAW channel that is available:: >
To read all error output from a RAW channel that is available: >
let output = ch_readraw(channel, {"part": "err"})
Note that if the channel is in NL mode, ch_readraw() will only return one line
for each call.
+1 -1
View File
@@ -804,7 +804,7 @@ always be swapped then.
Count and Range *N:*
When giving a count before entering ":", this is translated into:
When giving a count before entering ":", this is translated into: >
:.,.+(count - 1)
In words: The "count" lines at and after the cursor. Example: To delete
three lines: >
+2 -2
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 9.0. Last change: 2022 Apr 16
*editing.txt* For Vim version 9.0. Last change: 2022 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -583,7 +583,7 @@ END OF LINE AND END OF FILE *eol-and-eof*
Vim has several options to control the file format:
'fileformat' the <EOL> style: Unix, DOS, Mac
'endofline' whether the last line ends with a <EOL>
'endooffile' whether the file ends with a CTRL-Z
'endoffile' whether the file ends with a CTRL-Z
'fixendofline' whether to fix eol and eof
The first three values are normally detected automatically when reading the
+2 -2
View File
@@ -1965,7 +1965,7 @@ v:collate The current locale setting for collation order of the runtime
command.
See |multi-lang|.
*v:colornames*
*v:colornames*
v:colornames A dictionary that maps color names to hex color strings. These
color names can be used with the |highlight-guifg|,
|highlight-guibg|, and |highlight-guisp| parameters. Updating
@@ -3610,7 +3610,7 @@ this pending exception or command is discarded.
For examples see |throw-catch| and |try-finally|.
NESTING OF TRY CONDITIONALS *try-nesting*
NESTING OF TRY CONDITIONALS *try-nesting*
Try conditionals can be nested arbitrarily. That is, a complete try
conditional can be put into the try block, a catch clause, or the finally
+1 -1
View File
@@ -571,7 +571,7 @@ used.
For example, to set the dialect to a default of "fblite" but still allow for
any #lang directive overrides, use the following command: >
let g:freebasic_lang = "fblite"
let g:freebasic_lang = "fblite"
GIT COMMIT *ft-gitcommit-plugin*
+2
View File
@@ -161,6 +161,8 @@ Programming language support ~
|filetype.txt| settings done specifically for a type of file
|quickfix.txt| commands for a quick edit-compile-fix cycle
|ft_ada.txt| Ada (the programming language) support
|ft_context.txt| Filetype plugin for ConTeXt
|ft_mp.txt| Filetype plugin for METAFONT and MetaPost
|ft_ps1.txt| Filetype plugin for Windows PowerShell
|ft_raku.txt| Filetype plugin for Raku
|ft_rust.txt| Filetype plugin for Rust
+1 -1
View File
@@ -56,7 +56,7 @@ additionally installed over the GUI version. Typical build commands are:
./configure --prefix=`finddir B_SYSTEM_NONPACKAGED_DIRECTORY` \
--datarootdir=`finddir B_SYSTEM_NONPACKAGED_DATA_DIRECTORY` \
--mandir=`finddir B_SYSTEM_NONPACKAGED_DIRECTORY`/documentation/man \
--with-tlib=ncurses \
--with-tlib=ncurses
make clean
make install
+2 -2
View File
@@ -82,7 +82,7 @@ Copyright 2005-2017: *tar-copyright*
<.vimrc> file.
Default
Variable Value Explanation
*g:tar_browseoptions* "Ptf" used to get a list of contents
*g:tar_browseoptions* "Ptf" used to get a list of contents
*g:tar_readoptions* "OPxf" used to extract a file from a tarball
*g:tar_cmd* "tar" the name of the tar program
*g:tar_nomax* 0 if true, file window will not be maximized
@@ -98,7 +98,7 @@ Copyright 2005-2017: *tar-copyright*
"-"
Not all tar's support the "--" which is why
it isn't default.
*g:tar_writeoptions* "uf" used to update/replace a file
*g:tar_writeoptions* "uf" used to update/replace a file
==============================================================================
+2 -2
View File
@@ -1008,8 +1008,8 @@ Note: even when using "num" or "long" the number of flags available to
compounding and prefixes is limited to about 250.
AFFIXES
*spell-PFX* *spell-SFX*
AFFIXES *spell-PFX* *spell-SFX*
The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell
documentation or the Aspell manual:
http://aspell.net/man-html/Affix-Compression.html).
+5 -5
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.0. Last change: 2022 Oct 17
*syntax.txt* For Vim version 9.0. Last change: 2022 Nov 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2416,7 +2416,7 @@ you set the variable: >
:let papp_include_html=1
in your startup file it will try to syntax-hilight html code inside phtml
in your startup file it will try to syntax-highlight html code inside phtml
sections, but this is relatively slow and much too colourful to be able to
edit sensibly. ;)
@@ -4943,7 +4943,7 @@ Change a couple more colors: >
augroup my_colorschemes
au!
au Colorscheme pablo hi Normal ctermbg=NONE
\ | higlight Special ctermfg=63
\ | highlight Special ctermfg=63
\ | highlight Identifier ctermfg=44
augroup END
@@ -5386,10 +5386,10 @@ LineNrBelow Line number for when the 'relativenumber'
*hl-CursorLineNr*
CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt'
contains "number" or is "both", for the cursor line.
*hl-CursorLineSign*
CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
*hl-CursorLineFold*
CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
*hl-CursorLineSign*
CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
*hl-MatchParen*
MatchParen Character under the cursor or just before it, if it
is a paired bracket, and its match. |pi_paren.txt|
+2
View File
@@ -4408,6 +4408,7 @@ E1304 vim9.txt /*E1304*
E1305 textprop.txt /*E1305*
E1306 vim9.txt /*E1306*
E1307 vim9.txt /*E1307*
E1308 builtin.txt /*E1308*
E131 userfunc.txt /*E131*
E132 userfunc.txt /*E132*
E133 userfunc.txt /*E133*
@@ -6750,6 +6751,7 @@ end intro.txt /*end*
end-of-file pattern.txt /*end-of-file*
enlightened-terminal syntax.txt /*enlightened-terminal*
environ() builtin.txt /*environ()*
eol-and-eof editing.txt /*eol-and-eof*
erlang.vim syntax.txt /*erlang.vim*
err_buf channel.txt /*err_buf*
err_cb channel.txt /*err_cb*
+22 -1
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.0. Last change: 2022 Oct 28
*todo.txt* For Vim version 9.0. Last change: 2022 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,8 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Add test for what 9.0.0827 fixes - '@' in termcap key code
'smoothscroll':
- CTRL-E and gj in long line with 'scrolloff' 5 not working well yet.
- computing 'scrolloff' position row use w_skipcol
@@ -176,6 +178,8 @@ reduced?
Add BufDeletePost. #11041
Add winid arg to col() and charcol() #11466 (request #11461)
Test property disappears when using CR twice in a row. OK when some text was
entered. (#11151)
@@ -183,6 +187,10 @@ NFA regexp does not handle composing characters well: #10286
[ɔ̃] matches both ɔ and ɔ̃
\(ɔ\|ɔ̃\) matches ɔ and not ɔ̃
Is there a way to make 'autowriteall' make a clean exit when the xterm is
closed? (Dennis Nazic says files are preserved, okt 28). Perhaps handle TERM
like HUP?
Improvement in terminal configuration mess: Request the terminfo entry from
the terminal itself. The $TERM value then is only relevant for whether this
feature is supported or not. Replaces the xterm mechanism to request each
@@ -191,6 +199,16 @@ Multiplexers (screen, tmux) can request it to the underlying terminal, and
pass it on with modifications.
How to get all the text quickly (also over ssh)? Can we use a side channel?
Horizontal mouse scroll only works when compiled with GUI? #11374
In the libvterm fork properly implement:
- modifyOtherKeys 2 - follow xterm implementation as close as possible, that
is the reference.
- Kitty key protocol - just like the latest Kitty
So that in TermDebug the key handling can be stepped through (instead of
having to log messages all over the place to see what happens).
Ask Leonerd about location of code, he might want to take over some of it.
Using "A" and "o" in manually created fold (in empty buffer) does not behave
consistenly (James McCoy, #10698)
@@ -301,6 +319,9 @@ when redirecting to a local variable (function or script) storing the value
won't work. At least give an error. Is there a way to make it work?
#10616
Completion for ":runtime" should show valid values, not what's in the current
directory. (#11447)
Add an option to start_timer() to return from the input loop with K_IGNORE.
This is useful e.g. when a popup was created that disables mappings, we need
to return from vgetc() to make this happen. #7011
+1 -1
View File
@@ -405,7 +405,7 @@ function to abort. `:defer` can be used to avoid that: >
call Handle('Outfile')
endfunc
Note that deleting "Outfile" is scheduled before calling system(), since it
Note that deleting "Outfile" is scheduled before calling `system()`, since it
can be created even when `system()` fails.
The deferred functions are called in reverse order, the last one added is
+2 -2
View File
@@ -1,4 +1,4 @@
*usr_03.txt* For Vim version 9.0. Last change: 2020 Sep 03
*usr_03.txt* For Vim version 9.0. Last change: 2022 Oct 30
VIM USER MANUAL - by Bram Moolenaar
@@ -223,7 +223,7 @@ you can see? This figure shows the three commands you can use:
+---------------------------+
Hints: "H" stands for Home, "M" for Middle and "L" for Last. Alternatively,
"H" for high, "M" for Middle and "L" for low.
"H" for High, "M" for Middle and "L" for Low.
==============================================================================
*03.6* Telling where you are
+2 -2
View File
@@ -139,7 +139,7 @@ FOUR KINDS OF NUMBERS
Numbers can be decimal, hexadecimal, octal and binary.
A hexadecimal number starts with "0x" or "0X". For example "0x1f" is decimal
31 and 0x1234 is decimal 4660.
31 and "0x1234" is decimal 4660.
An octal number starts with "0o", "0O". "0o17" is decimal 15.
@@ -687,7 +687,7 @@ search() function uses its first argument as a search pattern and the second
one as flags. The "W" flag means the search doesn't wrap around the end of
the file.
Using the `call` command is optional in |Vim9| script. It is required in
Using the `call` command is optional in |Vim9| script. It is required in
legacy script and on the command line: >
call search("Date: ", "W")
+3 -2
View File
@@ -1,4 +1,4 @@
*various.txt* For Vim version 9.0. Last change: 2022 Oct 17
*various.txt* For Vim version 9.0. Last change: 2022 Nov 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -298,7 +298,8 @@ g8 Print the hex values of the bytes used in the
:silent !{cmd}
< The screen is not redrawn then, thus you have to use
CTRL-L or ":redraw!" if the command did display
something.
something. However, this depends on what the |t_ti|
and |t_te| termcap entries are set to.
Also see |shell-window|.
*:!!*
+6 -6
View File
@@ -1,4 +1,4 @@
*version5.txt* For Vim version 9.0. Last change: 2022 Apr 06
*version5.txt* For Vim version 9.0. Last change: 2022 Nov 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -118,7 +118,7 @@ Added |added-5.8|
Fixed |fixed-5.8|
==============================================================================
INCOMPATIBLE *incompatible-5*
INCOMPATIBLE *incompatible-5*
Default value for 'compatible' changed *cp-default*
--------------------------------------
@@ -360,7 +360,7 @@ CTRL-_ key for this |i_CTRL-_|. >
:imap <C-B> <C-O>:set revins!<CR>
==============================================================================
NEW FEATURES *new-5*
NEW FEATURES *new-5*
Syntax highlighting *new-highlighting*
-------------------
@@ -635,7 +635,7 @@ Included support for the Farsi language (Shiran). Only when enabled at
compile time. See |farsi|.
==============================================================================
IMPROVEMENTS *improvements-5*
IMPROVEMENTS *improvements-5*
Performance:
- When 'showcmd' was set, mappings would execute much more slowly because the
@@ -929,7 +929,7 @@ Some versions of Motif require "-lXpm". Added check for this in configure.
Don't add "-L/usr/lib" to the link line, causes problems on a few systems.
==============================================================================
COMPILE TIME CHANGES *compile-changes-5*
COMPILE TIME CHANGES *compile-changes-5*
When compiling, allow a choice for minimal, normal or maximal features in an
easy way, by changing a single line in src/feature.h.
@@ -975,7 +975,7 @@ Don't use HPUX digraphs by default, but only when HPUX_DIGRAPHS is defined.
|digraphs-default|
==============================================================================
BUG FIXES *bug-fixes-5*
BUG FIXES *bug-fixes-5*
Note: Some of these fixes may only apply to test versions which were
created after version 4.6, but before 5.0.
+7 -7
View File
@@ -259,7 +259,7 @@ Support for evaluating Vim expressions in a heredoc. |:let-heredoc|
Support for fuzzy matching:
- a string in a List of strings. |fuzzy-matching|
- completion support for command line completion using 'wildoptions'
- completion support for command line completion using 'wildoptions'.
- for |:vimgrep|.
Added support for the |Haiku| OS.
@@ -398,22 +398,22 @@ Update xdiff to version 2.33. Update libvterm to revision 789.
Support 'trim' for Python/Lua/Perl/Tcl/Ruby/MzScheme interface heredoc.
Add the |t_AU| and |t_8u| termap codes for underline and undercurl. Add the
Add the |t_AU| and |t_8u| termcap codes for underline and undercurl. Add the
t_fd and t_fe termcap codes for detecting focus events.
Support for indenting C pragmas like normal code. (|cino-P|)
Add support for defining the syntax fold level (|:syn-foldlevel|)
Add support for defining the syntax fold level. (|:syn-foldlevel|)
Add support for using \<*xxx> in a string to prepend a modifier to a
character. (|expr-quote|).
character. (|expr-quote|)
Add support trimming characters at the beginning or end of a string using
|trim()|.
Make ":verbose pwd" show the scope of the directory. |:pwd-verbose|
Add the "0o" notation for specifying octal numbers |scriptversion-4|
Add the "0o" notation for specifying octal numbers. |scriptversion-4|
Support for changing to the previous tab-local and window-local directories
using the "tcd -" and "lcd -" commands. (|:tcd-| and |:lcd-|)
@@ -428,7 +428,7 @@ Add support for executing (|:@|) a register containing line continuation.
Lua support:
- Call Vim functions from Lua (vim.call() and vim.fn()).
- Convert a Lua function and a closure to a Vim funcref so that it can be
accessed in a Vimscript (|lua-funcref|).
accessed in a Vim script (|lua-funcref|).
- Not backwards compatible: Make Lua arrays one based.
- Add support for using table.insert() and table.remove() functions with Vim
lists.
@@ -27366,7 +27366,7 @@ Files: src/evalfunc.c, src/testdir/test_vim9_builtin.vim
Patch 8.2.4460
Problem: Vim9: wrong error for defining dict function.
Solution: Explicitly check for trying to define a dict function.
(closes 9827)
(closes #9827)
Files: src/errors.h, src/userfunc.c, src/vim9compile.c,
src/testdir/test_vim9_func.vim
+1 -1
View File
@@ -1039,7 +1039,7 @@ In Vim9 script one can use the following predefined values: >
`true` is the same as `v:true`, `false` the same as `v:false`, `null` the same
as `v:null`.
While `null` has the type "special", the other "null_" types have the type
While `null` has the type "special", the other "null_" values have the type
indicated by their name. Quite often a null value is handled the same as an
empty value, but not always. The values can be useful to clear a script-local
variable, since they cannot be deleted with `:unlet`. E.g.: >
+3 -3
View File
@@ -116,7 +116,7 @@ gn Search forward for the last used search pattern, like
E.g., "dgn" deletes the text of the next match.
If Visual mode is active, extends the selection
until the end of the next match.
'wrapscan' applies
'wrapscan' applies.
Note: Unlike `n` the search direction does not depend
on the previous search command.
@@ -510,11 +510,11 @@ mode Vim automatically switches to Visual mode, so that the same behavior as
in Visual mode is effective. If you don't want this use |:xmap| or |:smap|.
One particular edge case: >
:vnoremap <C-K> <Esc>
:vnoremap <C-K> <Esc>
This ends Visual mode when in Visual mode, but in Select mode it does not
work, because Select mode is restored after executing the mapped keys. You
need to use: >
:snoremap <C-K> <Esc>
:snoremap <C-K> <Esc>
<
Users will expect printable characters to replace the selected area.
Therefore avoid mapping printable characters in Select mode. Or use
+2 -2
View File
@@ -561,9 +561,9 @@ CTRL-W = Make all windows (almost) equally high and wide, but use
Windows with 'winfixheight' set keep their height and windows
with 'winfixwidth' set keep their width.
To equalize only vertically (make window equally high) use
`vertical wincmd =`
`vertical wincmd =`.
To equalize only horizontally (make window equally wide) use
`horizontal wincmd =`
`horizontal wincmd =`.
:res[ize] -N *:res* *:resize* *CTRL-W_-*
CTRL-W - Decrease current window height by N (default 1).
+6 -1
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2022 Oct 12
" Last Change: 2022 Nov 07
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -2181,6 +2181,11 @@ au BufNewFile,BufRead *.va,*.vams setf verilogams
" SystemVerilog
au BufNewFile,BufRead *.sv,*.svh setf systemverilog
" VHS tape
" .tape is also used by TapeCalc, which we do not support ATM. If TapeCalc
" support is needed the contents of the file needs to be inspected.
au BufNewFile,BufRead *.tape setf vhs
" VHDL
au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho setf vhdl
+18 -3
View File
@@ -4,7 +4,9 @@
" Maintainer: Marcin Szamotulski <profunctor@pm.me>
" Previous Maintainer: Vincent Berthoux <twinside@gmail.com>
" File Types: .cabal
" Last Change: 21 Nov 2020
" Last Change: 22 Oct 2022
" v1.6: Added support for foreign-libraries
" Added highlighting for various fields
" v1.5: Incorporated changes from
" https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim
" Use `syn keyword` instead of `syn match`.
@@ -61,13 +63,14 @@ syn keyword cabalCategory contained
\ test-suite
\ source-repository
\ flag
\ foreign-library
\ custom-setup
\ common
syn match cabalCategoryTitle contained /[^{]*\ze{\?/
syn match cabalCategoryRegion
\ contains=cabalCategory,cabalCategoryTitle
\ nextgroup=cabalCategory skipwhite
\ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\|common\)\+\s*\%(.*$\|$\)/
\ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|foreign-library\|custom-setup\|common\)\+\s*\%(.*$\|$\)/
syn keyword cabalTruth true false
" cabalStatementRegion which limits the scope of cabalStatement keywords, this
@@ -77,6 +80,7 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ default-language
\ default-extensions
\ author
\ autogen-includes
\ autogen-modules
\ asm-sources
\ asm-options
@@ -84,7 +88,7 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ bug-reports
\ build-depends
\ build-tools
\ build-tools-depends
\ build-tool-depends
\ build-type
\ buildable
\ c-sources
@@ -95,6 +99,7 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ cmm-sources
\ cmm-options
\ cpp-options
\ cxx-options
\ cxx-sources
\ data-dir
\ data-files
@@ -111,7 +116,9 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ extra-framework-dirs
\ extra-ghci-libraries
\ extra-lib-dirs
\ extra-lib-dirs-static
\ extra-libraries
\ extra-libraries-static
\ extra-library-flavours
\ extra-source-files
\ extra-tmp-files
@@ -133,6 +140,8 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ install-includes
\ js-sources
\ ld-options
\ lib-version-info
\ lib-version-linux
\ license
\ license-file
\ location
@@ -141,20 +150,26 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ manual
\ mixins
\ module
\ mod-def-file
\ name
\ nhc98-options
\ options
\ other-extensions
\ other-language
\ other-languages
\ other-modules
\ package-url
\ pkgconfig-depends
\ scope
\ setup-depends
\ signatures
\ stability
\ subdir
\ synopsis
\ reexported-modules
\ tag
\ tested-with
\ test-module
\ type
\ version
\ virtual-modules
+3 -3
View File
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2022 Jul 25
" Last Change: 2022 Oct 29
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim
" Standard syntax initialization
@@ -21,9 +21,9 @@ let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
\ 'buster', 'bullseye', 'bookworm', 'trixie',
\ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky',
\
\ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic',
\ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar',
\ 'devel'
\ ]
let s:unsupported = [
+3 -3
View File
@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
" Last Change: 2022 Jul 25
" Last Change: 2022 Oct 29
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
" Standard syntax initialization
@@ -23,9 +23,9 @@ let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
\ 'buster', 'bullseye', 'bookworm', 'trixie',
\ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky',
\
\ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic',
\ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar',
\ 'devel'
\ ]
let s:unsupported = [
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Bram Moolenaar (Bram@vim.org)
" Last Change: 2022 Oct 17
" Last Change: 2022 Nov 09
" 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 .()_]*?\=\ze\(\s\+\*\|$\)"
syn match helpHeadline "^[A-Z.][-A-Z0-9 .,()_]*?\=\ze\(\s\+\*\|$\)"
syn match helpSectionDelim "^===.*===$"
syn match helpSectionDelim "^---.*--$"
if has("conceal")
File diff suppressed because one or more lines are too long
+3 -3
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 Oct 16
" Last Change: 2022 Nov 06
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -45,11 +45,11 @@ 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
\ start="^[~A-Za-z0-9_./$(){}%-][A-Za-z0-9_./\t ${}()%-]*&\?:\?:\{1,2}[^:=]"rs=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*$"
syn match makeTarget "^[~A-Za-z0-9_./$(){}%*@-][A-Za-z0-9_./\t $(){}%*@-]*&\?::\=\s*$"
\ contains=makeIdent,makeSpecTarget,makeComment
\ skipnl nextgroup=makeCommands,makeCommandError
+74 -25
View File
@@ -2,18 +2,29 @@
" Language: Modula-3
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>
" Last Change: 2021 Apr 08
" Last Change: 2022 Oct 31
if exists("b:current_syntax")
finish
endif
" Modula-3 keywords
syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST DEFINITION
syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION EXIT EXPORTS FINALLY
syn keyword modula3Keyword FROM GENERIC IMPORT LOCK METHOD OF RAISE RAISES
syn keyword modula3Keyword READONLY RECORD REF RETURN SET TRY TYPE TYPECASE
syn keyword modula3Keyword UNSAFE VALUE VAR WITH
" Whitespace errors {{{1
if exists("modula3_space_errors")
if !exists("modula3_no_trail_space_error")
syn match modula3SpaceError display excludenl "\s\+$"
endif
if !exists("modula3_no_tab_space_error")
syn match modula3SpaceError display " \+\t"me=e-1
endif
endif
" Keywords {{{1
syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST
syn keyword modula3Keyword DEFINITION EVAL EXIT EXCEPT EXCEPTION EXIT
syn keyword modula3Keyword EXPORTS FINALLY FROM GENERIC IMPORT LOCK METHOD
syn keyword modula3Keyword OF RAISE RAISES READONLY RECORD REF
syn keyword modula3Keyword RETURN SET TRY TYPE TYPECASE UNSAFE
syn keyword modula3Keyword VALUE VAR WITH
syn match modula3keyword "\<UNTRACED\>"
@@ -22,44 +33,71 @@ syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN
syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL
syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP
" Reserved identifiers
" Reserved identifiers {{{1
syn keyword modula3Identifier ABS ADR ADRSIZE BITSIZE BYTESIZE CEILING DEC
syn keyword modula3Identifier DISPOSE FIRST FLOAT FLOOR INC ISTYPE LAST
syn keyword modula3Identifier LOOPHOLE MAX MIN NARROW NEW NUMBER ORD ROUND
syn keyword modula3Identifier SUBARRAY TRUNC TYPECODE VAL
" Predefined types
" Predefined types {{{1
syn keyword modula3Type ADDRESS BOOLEAN CARDINAL CHAR EXTENDED INTEGER
syn keyword modula3Type LONGCARD LONGINT LONGREAL MUTEX NULL REAL REFANY TEXT
syn keyword modula3Type WIDECHAR
syn match modula3Type "\<\%(UNTRACED\s\+\)\=ROOT\>"
" Operators
syn keyword modulaOperator DIV MOD IN AND OR NOT
" Operators {{{1
syn keyword modula3Operator DIV MOD
syn keyword modula3Operator IN
syn keyword modula3Operator NOT AND OR
" TODO: exclude = from declarations
if exists("modula3_operators")
syn match modula3Operator "\^"
syn match modula3Operator "+\|-\|\*\|/\|&"
" TODO: need to exclude = in procedure definitions
syn match modula3Operator "<=\|<\|>=\|>\|:\@<!=\|#"
syn match modula3Operator "[-+/*]"
syn match modula3Operator "&"
syn match modula3Operator "<=\|<:\@!\|>=\|>"
syn match modula3Operator ":\@<!=\|#"
endif
" Literals {{{1
" Booleans
syn keyword modula3Boolean TRUE FALSE
" Nil
syn keyword modula3Nil NIL
" Integers
syn match modula3Integer "\<\d\+L\=\>"
syn match modula3Integer "\<\d\d\=_\x\+L\=\>"
" Numbers {{{2
" Reals
syn match modula3Real "\c\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>"
" NOTE: Negated numbers are constant expressions not literals
syn case ignore
" Integers
syn match modula3Integer "\<\d\+L\=\>"
if exists("modula3_number_errors")
syn match modula3IntegerError "\<\d\d\=_\x\+L\=\>"
endif
let s:digits = "0123456789ABCDEF"
for s:radix in range(2, 16)
exe $'syn match modula3Integer "\<{s:radix}_[{s:digits[:s:radix - 1]}]\+L\=\>"'
endfor
unlet s:digits s:radix
" Reals
syn match modula3Real "\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>"
syn case match
" Strings and characters {{{2
" String escape sequences
syn match modula3Escape "\\['"ntrf]" contained display
" TODO: limit to <= 377 (255)
syn match modula3Escape "\\\o\{3}" contained display
syn match modula3Escape "\\\\" contained display
@@ -69,13 +107,23 @@ syn match modula3Character "'\%([^']\|\\.\|\\\o\{3}\)'" contains=modula3Escape
" Strings
syn region modula3String start=+"+ end=+"+ contains=modula3Escape
" Pragmas
" Pragmas {{{1
" EXTERNAL INLINE ASSERT TRACE FATAL UNUSED OBSOLETE CALLBACK EXPORTED PRAGMA NOWARN LINE LL LL.sup SPEC
" Documented: INLINE ASSERT TRACE FATAL UNUSED OBSOLETE NOWARN
syn region modula3Pragma start="<\*" end="\*>"
" Comments
syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell
" Comments {{{1
if !exists("modula3_no_comment_fold")
syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell fold
syn region modula3LineCommentBlock start="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@=" end="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@!" contains=modula3Comment transparent fold keepend
else
syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell
endif
" Default highlighting
" Syncing "{{{1
syn sync minlines=100
" Default highlighting {{{1
hi def link modula3Block Statement
hi def link modula3Boolean Boolean
hi def link modula3Character Character
@@ -85,12 +133,13 @@ hi def link modula3Identifier Keyword
hi def link modula3Integer Number
hi def link modula3Keyword Statement
hi def link modula3Nil Constant
hi def link modula3IntegerError Error
hi def link modula3Operator Operator
hi def link modula3Pragma PreProc
hi def link modula3Real Float
hi def link modula3String String
hi def link modula3Type Type
hi def link modula3Type Type "}}}
let b:current_syntax = "modula3"
" vim: nowrap sw=2 sts=2 ts=8 noet:
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
+16 -7
View File
@@ -6,9 +6,10 @@
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Contributor: Karsten Hopp <karsten@redhat.com>
" Contributor: Dean, Adam Kenneth <adam.ken.dean@hpe.com>
" Last Change: 2021 Mar 29
" Last Change: 2022 Nov 09
" Added RemoteCommand from pull request #4809
" Included additional keywords from Martin.
" Included PR #5753
" SSH Version: 8.5p1
"
@@ -57,12 +58,12 @@ syn match sshconfigCiphers "\<aes256-gcm@openssh\.com\>"
syn match sshconfigCiphers "\<chacha20-poly1305@openssh\.com\>"
syn keyword sshconfigMAC hmac-sha1
syn keyword sshconfigMAC mac-sha1-96
syn keyword sshconfigMAC mac-sha2-256
syn keyword sshconfigMAC mac-sha2-512
syn keyword sshconfigMAC mac-md5
syn keyword sshconfigMAC mac-md5-96
syn keyword sshconfigMAC mac-ripemd160
syn keyword sshconfigMAC hmac-sha1-96
syn keyword sshconfigMAC hmac-sha2-256
syn keyword sshconfigMAC hmac-sha2-512
syn keyword sshconfigMAC hmac-md5
syn keyword sshconfigMAC hmac-md5-96
syn keyword sshconfigMAC hmac-ripemd160
syn match sshconfigMAC "\<hmac-ripemd160@openssh\.com\>"
syn match sshconfigMAC "\<umac-64@openssh\.com\>"
syn match sshconfigMAC "\<umac-128@openssh\.com\>"
@@ -78,16 +79,24 @@ syn match sshconfigMAC "\<umac-128-etm@openssh\.com\>"
syn keyword sshconfigHostKeyAlgo ssh-ed25519
syn match sshconfigHostKeyAlgo "\<ssh-ed25519-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<sk-ssh-ed25519@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<sk-ssh-ed25519-cert-v01@openssh\.com\>"
syn keyword sshconfigHostKeyAlgo ssh-rsa
syn keyword sshconfigHostKeyAlgo rsa-sha2-256
syn keyword sshconfigHostKeyAlgo rsa-sha2-512
syn keyword sshconfigHostKeyAlgo ssh-dss
syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp256
syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp384
syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp521
syn match sshconfigHostKeyAlgo "\<sk-ecdsa-sha2-nistp256@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<ssh-rsa-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<rsa-sha2-256-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<rsa-sha2-512-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<ssh-dss-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp256-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp384-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp521-cert-v01@openssh\.com\>"
syn match sshconfigHostKeyAlgo "\<sk-ecdsa-sha2-nistp256-cert-v01@openssh\.com\>"
syn keyword sshconfigPreferredAuth hostbased publickey password gssapi-with-mic
syn keyword sshconfigPreferredAuth keyboard-interactive
+9 -7
View File
@@ -7,7 +7,7 @@
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Contributor: Karsten Hopp <karsten@redhat.com>
" Originally: 2009-07-09
" Last Change: 2021-03-29
" Last Change: 2022 Nov 09
" SSH Version: 8.5p1
"
@@ -59,12 +59,12 @@ syn match sshdconfigCiphers "\<aes256-gcm@openssh\.com\>"
syn match sshdconfigCiphers "\<chacha20-poly1305@openssh\.com\>"
syn keyword sshdconfigMAC hmac-sha1
syn keyword sshdconfigMAC mac-sha1-96
syn keyword sshdconfigMAC mac-sha2-256
syn keyword sshdconfigMAC mac-sha2-512
syn keyword sshdconfigMAC mac-md5
syn keyword sshdconfigMAC mac-md5-96
syn keyword sshdconfigMAC mac-ripemd160
syn keyword sshdconfigMAC hmac-sha1-96
syn keyword sshdconfigMAC hmac-sha2-256
syn keyword sshdconfigMAC hmac-sha2-512
syn keyword sshdconfigMAC hmac-md5
syn keyword sshdconfigMAC hmac-md5-96
syn keyword sshdconfigMAC hmac-ripemd160
syn match sshdconfigMAC "\<hmac-ripemd160@openssh\.com\>"
syn match sshdconfigMAC "\<umac-64@openssh\.com\>"
syn match sshdconfigMAC "\<umac-128@openssh\.com\>"
@@ -258,6 +258,8 @@ syn keyword sshdconfigKeyword Subsystem
syn keyword sshdconfigKeyword SyslogFacility
syn keyword sshdconfigKeyword TCPKeepAlive
syn keyword sshdconfigKeyword TrustedUserCAKeys
syn keyword sshdconfigKeyword UseBlacklist
syn keyword sshdconfigKeyword UseBlocklist
syn keyword sshdconfigKeyword UseDNS
syn keyword sshdconfigKeyword UseLogin
syn keyword sshdconfigKeyword UsePAM
+27 -33
View File
@@ -3967,20 +3967,9 @@ maketitle(void)
{
#ifdef FEAT_STL_OPT
if (stl_syntax & STL_IN_TITLE)
{
int use_sandbox = FALSE;
int called_emsg_before = called_emsg;
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"titlestring", 0);
# endif
build_stl_str_hl(curwin, title_str, sizeof(buf),
p_titlestring, use_sandbox,
0, maxlen, NULL, NULL);
if (called_emsg > called_emsg_before)
set_string_option_direct((char_u *)"titlestring", -1,
(char_u *)"", OPT_FREE, SID_ERROR);
}
build_stl_str_hl(curwin, title_str, sizeof(buf), p_titlestring,
(char_u *)"titlestring", 0,
0, maxlen, NULL, NULL);
else
#endif
title_str = p_titlestring;
@@ -4100,20 +4089,8 @@ maketitle(void)
{
#ifdef FEAT_STL_OPT
if (stl_syntax & STL_IN_ICON)
{
int use_sandbox = FALSE;
int called_emsg_before = called_emsg;
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"iconstring", 0);
# endif
build_stl_str_hl(curwin, icon_str, sizeof(buf),
p_iconstring, use_sandbox,
0, 0, NULL, NULL);
if (called_emsg > called_emsg_before)
set_string_option_direct((char_u *)"iconstring", -1,
(char_u *)"", OPT_FREE, SID_ERROR);
}
build_stl_str_hl(curwin, icon_str, sizeof(buf), p_iconstring,
(char_u *)"iconstring", 0, 0, 0, NULL, NULL);
else
#endif
icon_str = p_iconstring;
@@ -4238,7 +4215,8 @@ build_stl_str_hl(
char_u *out, // buffer to write into != NameBuff
size_t outlen, // length of out[]
char_u *fmt,
int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox
char_u *opt_name, // option name corresponding to "fmt"
int opt_scope, // scope for "opt_name"
int fillchar,
int maxwidth,
stl_hlrec_T **hltab, // return: HL attributes (can be NULL)
@@ -4251,6 +4229,7 @@ build_stl_str_hl(
char_u *t;
int byteval;
#ifdef FEAT_EVAL
int use_sandbox;
win_T *save_curwin;
buf_T *save_curbuf;
int save_VIsual_active;
@@ -4286,6 +4265,10 @@ build_stl_str_hl(
stl_hlrec_T *sp;
int save_redraw_not_allowed = redraw_not_allowed;
int save_KeyTyped = KeyTyped;
// TODO: find out why using called_emsg_before makes tests fail, does it
// matter?
// int called_emsg_before = called_emsg;
int did_emsg_before = did_emsg;
// When inside update_screen() we do not want redrawing a statusline,
// ruler, title, etc. to trigger another redraw, it may cause an endless
@@ -4305,10 +4288,11 @@ build_stl_str_hl(
}
#ifdef FEAT_EVAL
/*
* When the format starts with "%!" then evaluate it as an expression and
* use the result as the actual format string.
*/
// if "fmt" was set insecurely it needs to be evaluated in the sandbox
use_sandbox = was_set_insecurely(opt_name, opt_scope);
// When the format starts with "%!" then evaluate it as an expression and
// use the result as the actual format string.
if (fmt[0] == '%' && fmt[1] == '!')
{
typval_T tv;
@@ -5191,6 +5175,16 @@ build_stl_str_hl(
// A user function may reset KeyTyped, restore it.
KeyTyped = save_KeyTyped;
// Check for an error. If there is one the display will be messed up and
// might loop redrawing. Avoid that by making the corresponding option
// empty.
// TODO: find out why using called_emsg_before makes tests fail, does it
// matter?
// if (called_emsg > called_emsg_before)
if (did_emsg > did_emsg_before)
set_string_option_direct(opt_name, -1, (char_u *)"",
OPT_FREE | opt_scope, SID_ERROR);
return width;
}
#endif // FEAT_STL_OPT
+5 -12
View File
@@ -352,7 +352,7 @@ dict_copy(dict_T *orig, int deep, int top, int copyID)
}
/*
* Check for adding a function to g: or s:.
* Check for adding a function to g: or s: (in Vim9 script) or l:.
* If the name is wrong give an error message and return TRUE.
*/
int
@@ -1105,17 +1105,9 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action, char *func_name)
{
--todo;
di1 = dict_find(d1, hi2->hi_key, -1);
if (d1->dv_scope != 0)
{
// Disallow replacing a builtin function in l: and g:.
// Check the key to be valid when adding to any scope.
if (d1->dv_scope == VAR_DEF_SCOPE
&& HI2DI(hi2)->di_tv.v_type == VAR_FUNC
&& var_wrong_func_name(hi2->hi_key, di1 == NULL))
break;
if (!valid_varname(hi2->hi_key, -1, TRUE))
break;
}
// Check the key to be valid when adding to any scope.
if (d1->dv_scope != 0 && !valid_varname(hi2->hi_key, -1, TRUE))
break;
if (type != NULL
&& check_typval_arg_type(type, &HI2DI(hi2)->di_tv,
@@ -1138,6 +1130,7 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action, char *func_name)
if (value_check_lock(di1->di_tv.v_lock, arg_errmsg, TRUE)
|| var_check_ro(di1->di_flags, arg_errmsg, TRUE))
break;
// Disallow replacing a builtin function.
if (dict_wrong_func_name(d1, &HI2DI(hi2)->di_tv, hi2->hi_key))
break;
clear_tv(&di1->di_tv);
-17
View File
@@ -573,7 +573,6 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
redraw_custom_statusline(win_T *wp)
{
static int entered = FALSE;
int saved_did_emsg = did_emsg;
// When called recursively return. This can happen when the statusline
// contains an expression that triggers a redraw.
@@ -581,18 +580,7 @@ redraw_custom_statusline(win_T *wp)
return;
entered = TRUE;
did_emsg = FALSE;
win_redr_custom(wp, FALSE);
if (did_emsg)
{
// When there is an error disable the statusline, otherwise the
// display is messed up with errors and a redraw triggers the problem
// again and again.
set_string_option_direct((char_u *)"statusline", -1,
(char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
}
did_emsg |= saved_did_emsg;
entered = FALSE;
}
#endif
@@ -673,12 +661,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
#ifdef FEAT_STL_OPT
if (*p_ruf)
{
int called_emsg_before = called_emsg;
win_redr_custom(wp, TRUE);
if (called_emsg > called_emsg_before)
set_string_option_direct((char_u *)"rulerformat", -1,
(char_u *)"", OPT_FREE, SID_ERROR);
return;
}
#endif
+2 -1
View File
@@ -1376,7 +1376,8 @@ get_lval(
else
prevval = 0; // avoid compiler warning
wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
&& rettv->v_type == VAR_FUNC
&& (rettv->v_type == VAR_FUNC
|| rettv->v_type == VAR_PARTIAL)
&& var_wrong_func_name(key, lp->ll_di == NULL))
|| !valid_varname(key, -1, TRUE);
if (len != -1)
+23 -27
View File
@@ -175,9 +175,7 @@ set_buffer_lines(
l = lines->vval.v_list;
if (l == NULL || list_len(l) == 0)
{
// set proper return code
if (lnum > curbuf->b_ml.ml_line_count)
rettv->vval.v_number = 1; // FAIL
// not appending anything always succeeds
goto done;
}
CHECK_LIST_MATERIALIZE(l);
@@ -537,6 +535,7 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
|| first > buf->b_ml.ml_line_count || last < first)
return;
// After this don't use "return", goto "cleanup"!
if (!is_curbuf)
{
VIsual_active = FALSE;
@@ -558,38 +557,35 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
}
if (u_save(first - 1, last + 1) == FAIL)
{
rettv->vval.v_number = 1; // FAIL
}
else
{
for (lnum = first; lnum <= last; ++lnum)
ml_delete_flags(first, ML_DEL_MESSAGE);
goto cleanup;
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
{
if (wp->w_cursor.lnum > last)
wp->w_cursor.lnum -= count;
else if (wp->w_cursor.lnum > first)
wp->w_cursor.lnum = first;
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
wp->w_cursor.lnum = wp->w_buffer->b_ml.ml_line_count;
wp->w_valid = 0;
if (wp->w_cursor.lnum <= wp->w_topline)
wp->w_topline = 1;
}
check_cursor_col();
deleted_lines_mark(first, count);
}
for (lnum = first; lnum <= last; ++lnum)
ml_delete_flags(first, ML_DEL_MESSAGE);
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
{
if (wp->w_cursor.lnum > last)
wp->w_cursor.lnum -= count;
else if (wp->w_cursor.lnum > first)
wp->w_cursor.lnum = first;
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
wp->w_cursor.lnum = wp->w_buffer->b_ml.ml_line_count;
wp->w_valid = 0;
if (wp->w_cursor.lnum <= wp->w_topline)
wp->w_topline = 1;
}
check_cursor_col();
deleted_lines_mark(first, count);
rettv->vval.v_number = 0; // OK
cleanup:
if (!is_curbuf)
{
curbuf = curbuf_save;
curwin = curwin_save;
VIsual_active = save_VIsual_active;
}
rettv->vval.v_number = 0; // OK
}
/*
+5 -3
View File
@@ -899,11 +899,13 @@ do_bang(
}
/*
* Try to find an embedded bang, like in :!<cmd> ! [args]
* (:!! is indicated by the 'forceit' variable)
* Try to find an embedded bang, like in ":!<cmd> ! [args]"
* ":!!" is indicated by the 'forceit' variable.
*/
ins_prevcmd = forceit;
trailarg = arg;
// Skip leading white space to avoid a strange error with some shells.
trailarg = skipwhite(arg);
do
{
len = (int)STRLEN(trailarg) + 1;
+6 -10
View File
@@ -64,7 +64,9 @@ static int disable_flush = 0; // If > 0, gui_mch_flush() is disabled.
gui_start(char_u *arg UNUSED)
{
char_u *old_term;
#ifdef GUI_MAY_FORK
static int recursive = 0;
#endif
#if defined(GUI_MAY_SPAWN) && defined(EXPERIMENTAL_GUI_CMD)
char *msg = NULL;
#endif
@@ -76,9 +78,8 @@ gui_start(char_u *arg UNUSED)
cursor_on(); // needed for ":gui" in .vimrc
full_screen = FALSE;
++recursive;
#ifdef GUI_MAY_FORK
++recursive;
/*
* Quit the current process and continue in the child.
* Makes "gvim file" disconnect from the shell it was started in.
@@ -153,7 +154,9 @@ gui_start(char_u *arg UNUSED)
gui_mch_update();
apply_autocmds(gui.in_use ? EVENT_GUIENTER : EVENT_GUIFAILED,
NULL, NULL, FALSE, curbuf);
#ifdef GUI_MAY_FORK
--recursive;
#endif
}
/*
@@ -3805,8 +3808,6 @@ get_tabline_label(
opt = (tooltip ? &p_gtt : &p_gtl);
if (**opt != NUL)
{
int use_sandbox = FALSE;
int called_emsg_before = called_emsg;
char_u res[MAXPATHL];
tabpage_T *save_curtab;
char_u *opt_name = (char_u *)(tooltip ? "guitabtooltip"
@@ -3815,7 +3816,6 @@ get_tabline_label(
printer_page_num = tabpage_index(tp);
# ifdef FEAT_EVAL
set_vim_var_nr(VV_LNUM, printer_page_num);
use_sandbox = was_set_insecurely(opt_name, 0);
# endif
// It's almost as going to the tabpage, but without autocommands.
curtab->tp_firstwin = firstwin;
@@ -3830,7 +3830,7 @@ get_tabline_label(
curbuf = curwin->w_buffer;
// Can't use NameBuff directly, build_stl_str_hl() uses it.
build_stl_str_hl(curwin, res, MAXPATHL, *opt, use_sandbox,
build_stl_str_hl(curwin, res, MAXPATHL, *opt, opt_name, 0,
0, (int)Columns, NULL, NULL);
STRCPY(NameBuff, res);
@@ -3841,10 +3841,6 @@ get_tabline_label(
lastwin = curtab->tp_lastwin;
curwin = curtab->tp_curwin;
curbuf = curwin->w_buffer;
if (called_emsg > called_emsg_before)
set_string_option_direct(opt_name, -1,
(char_u *)"", OPT_FREE, SID_ERROR);
}
// If 'guitablabel'/'guitabtooltip' is not set or the result is empty then
-3
View File
@@ -6190,13 +6190,11 @@ gui_mch_draw_string(
// handled here.
int i;
int wlen; // string length in words
int clen; // string length in characters
int cells; // cell width of string up to composing char
int cw; // width of current cell
int c;
wlen = 0;
clen = 0;
cells = 0;
for (i = 0; i < len; )
{
@@ -6236,7 +6234,6 @@ gui_mch_draw_string(
}
cells += cw;
i += utf_ptr2len_len(text + i, len - i);
++clen;
}
#if defined(FEAT_DIRECTX)
if (IS_ENABLE_DIRECTX())
+2 -7
View File
@@ -471,7 +471,6 @@ prt_header(
if (*p_header != NUL)
{
linenr_T tmp_lnum, tmp_topline, tmp_botline;
int use_sandbox = FALSE;
/*
* Need to (temporarily) set current line number and first/last line
@@ -487,12 +486,8 @@ prt_header(
curwin->w_botline = lnum + 63;
printer_page_num = pagenum;
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"printheader", 0);
# endif
build_stl_str_hl(curwin, tbuf, (size_t)(width + IOSIZE),
p_header, use_sandbox,
' ', width, NULL, NULL);
build_stl_str_hl(curwin, tbuf, (size_t)(width + IOSIZE), p_header,
(char_u *)"printheader", 0, ' ', width, NULL, NULL);
// Reset line numbers
curwin->w_cursor.lnum = tmp_lnum;
+1 -1
View File
@@ -3673,7 +3673,7 @@ usage(void)
main_msg(_("--startuptime <file>\tWrite startup timing messages to <file>"));
#endif
#ifdef FEAT_JOB_CHANNEL
main_msg(_("--log <file>\tStart logging to <file> early"));
main_msg(_("--log <file>\t\tStart logging to <file> early"));
#endif
#ifdef FEAT_VIMINFO
main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
+21 -6
View File
@@ -1565,12 +1565,27 @@ utf_char2cells(int c)
{0x1f6f3, 0x1f6f3}
#ifdef MACOS_X
// Include SF Symbols characters, which should be rendered as
// double-width. All of them are in the Supplementary Private Use
// Area-B range. The exact range was determined by downloading the "SF
// Symbols" app from Apple, and then selecting all symbols, copying
// them out, and inspecting the unicode values of them.
, {0x100000, 0x100d7f}
// Include SF Symbols 4 characters, which should be rendered as
// double-width. SF Symbols is an Apple-specific set of symbols and
// icons for use in Apple operating systems. They are included as
// glyphs as part of the default San Francisco fonts shipped with
// macOS. The current version is SF Symbols 4.
//
// These Apple-specific glyphs are not part of standard Unicode, and
// all of them are in the Supplementary Private Use Area-B range. The
// exact range was determined by downloading the 'SF Symbols 4' app
// from Apple (https://developer.apple.com/sf-symbols/), and then
// selecting all symbols, copying them out, and inspecting the unicode
// values of them.
//
// Note that these symbols are of varying widths, as they are symbols
// representing differents things ranging from a simple gear icon to an
// airplane. Some of them are in fact wider than double-width, but Vim
// doesn't support non-fixed-width font, and tagging them as
// double-width is the best way to handle them.
//
// Also see https://en.wikipedia.org/wiki/San_Francisco_(sans-serif_typeface)#SF_Symbols
, {0x100000, 0x1018c7}
#endif
};
-3
View File
@@ -4394,7 +4394,6 @@ dump_pipe(int options,
int ret;
DWORD len;
DWORD toRead;
int repeatCount;
// we query the pipe to see if there is any data to read
// to avoid to perform a blocking read
@@ -4405,11 +4404,9 @@ dump_pipe(int options,
&availableBytes, // available bytes total
NULL); // byteLeft
repeatCount = 0;
// We got real data in the pipe, read it
while (ret != 0 && availableBytes > 0)
{
repeatCount++;
toRead = (DWORD)(BUFLEN - *buffer_off);
toRead = availableBytes < toRead ? availableBytes : toRead;
ReadFile(g_hChildStd_OUT_Rd, buffer + *buffer_off, toRead , &len, NULL);
+1 -1
View File
@@ -1730,7 +1730,7 @@ msgstr "--servername <Name>\tBenutze den Vim-Server <Name>"
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <Datei>\tSchreibe Start Zeitmessung in <Datei>"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <Datei>\tLogge frühzeitig in <Datei>"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+1 -1
View File
@@ -1765,7 +1765,7 @@ msgstr ""
"-- startuptime <archivo>\tGuardar los mensajes de tiempo de inicio en "
"<archivo>"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <archivo>\tIniciar registro en <archivo> pronto"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+2 -2
View File
@@ -1616,8 +1616,8 @@ msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr ""
"--startuptime <file>\tScrivi tutti i messaggi iniziali di timing in <file>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <file>\tInizia registrazione a <file> appena possibile"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <file>\t\tInizia registrazione a <file> appena possibile"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\tUsa <viminfo> invece di .viminfo"
+1 -1
View File
@@ -1741,7 +1741,7 @@ msgstr ""
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <ôàéë>\tÇàïèñàòü âðåìåííûå ìåòêè çàïóñêà â <ôàéë>"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr ""
"--log <ôàéë>\t\tÍà÷àòü çàïèñü æóðíàëà â <ôàéë> íà ðàííåì ýòàïå\n"
"\t\t\t\tèíèöèàëèçàöèè"
+1 -1
View File
@@ -1741,7 +1741,7 @@ msgstr ""
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <файл>\tЗаписать временные метки запуска в <файл>"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr ""
"--log <файл>\t\tНачать запись журнала в <файл> на раннем этапе\n"
"\t\t\t\tинициализации"
+1 -1
View File
@@ -1628,7 +1628,7 @@ msgstr "--servername <име>\tПошаљи/постани Vim сервер <и
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <фајл>\tУпиши поруке о дужини покретања у <фајл>"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <фајл>\t\tЗапочиње рано логовање у <фајл>"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+1 -1
View File
@@ -1691,7 +1691,7 @@ msgstr "--servername <ad>\t<ad> Vim sunucusuna gönder veya sunucu ol"
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <dsy>\tBaşlangıç zamanlama iletilerini <dsy>'ya yaz"
msgid "--log <file>\tStart logging to <file> early"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <dosya>\t<dosya>'ya günlüklemeyi erkenden başlat"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+2 -2
View File
@@ -1745,8 +1745,8 @@ msgstr ""
"--startuptime <ôàéë>\tÇàïèñàòè çàïóñêí³ ïîâ³äîìëåííÿ ç ÷àñîâèìè â³äì³òêàìè "
"äî <ôàéëó>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <ôàéë>\tÏî÷àòè çàïèñ ó <ôàéë> æóðíàëó ÿêíàéðàí³øå"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <ôàéë>\t\tÏî÷àòè çàïèñ ó <ôàéë> æóðíàëó ÿêíàéðàí³øå"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\tÂèêîðèñòàòè <viminfo> çàì³ñòü .viminfo"
+2 -2
View File
@@ -1745,8 +1745,8 @@ msgstr ""
"--startuptime <файл>\tЗаписати запускні повідомлення з часовими відмітками "
"до <файлу>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <файл>\tПочати запис у <файл> журналу якнайраніше"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <файл>\t\tПочати запис у <файл> журналу якнайраніше"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\tВикористати <viminfo> замість .viminfo"
+2 -2
View File
@@ -1676,8 +1676,8 @@ msgstr "--servername <名称>\t发送到或成为 Vim 服务器 <名称>"
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <文件>\t将启动计时信息写入 <文件>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <文件>\t尽早开始记录日志到 <文件>"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <文件>\t\t尽早开始记录日志到 <文件>"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\t使用 <viminfo> 取代 .viminfo"
+2 -2
View File
@@ -1676,8 +1676,8 @@ msgstr "--servername <
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <文件>\t将启动计时信息写入 <文件>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <文件>\t尽早开始记录日志到 <文件>"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <文件>\t\t尽早开始记录日志到 <文件>"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\t使用 <viminfo> 取代 .viminfo"
+2 -2
View File
@@ -1676,8 +1676,8 @@ msgstr "--servername <
msgid "--startuptime <file>\tWrite startup timing messages to <file>"
msgstr "--startuptime <文件>\t将启动计时信息写入 <文件>"
msgid "--log <file>\tStart logging to <file> early"
msgstr "--log <文件>\t尽早开始记录日志到 <文件>"
msgid "--log <file>\t\tStart logging to <file> early"
msgstr "--log <文件>\t\t尽早开始记录日志到 <文件>"
msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
msgstr "-i <viminfo>\t\t使用 <viminfo> 取代 .viminfo"
+2 -2
View File
@@ -1,7 +1,7 @@
/* buffer.c */
int get_highest_fnum(void);
void buffer_ensure_loaded(buf_T *buf);
int open_buffer(int read_stdin, exarg_T *eap, int flags);
int open_buffer(int read_stdin, exarg_T *eap, int flags_arg);
void set_bufref(bufref_T *bufref, buf_T *buf);
int bufref_valid(bufref_T *bufref);
int buf_valid(buf_T *buf);
@@ -48,7 +48,7 @@ void col_print(char_u *buf, size_t buflen, int col, int vcol);
void maketitle(void);
void resettitle(void);
void free_titles(void);
int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, stl_hlrec_T **hltab, stl_hlrec_T **tabtab);
int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, char_u *opt_name, int opt_scope, int fillchar, int maxwidth, stl_hlrec_T **hltab, stl_hlrec_T **tabtab);
void get_rel_pos(win_T *wp, char_u *buf, int buflen);
char_u *fix_fname(char_u *fname);
void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname);
+9 -24
View File
@@ -1292,9 +1292,10 @@ win_redr_custom(
char_u buf[MAXPATHL];
char_u *stl;
char_u *p;
char_u *opt_name;
int opt_scope = 0;
stl_hlrec_T *hltab;
stl_hlrec_T *tabtab;
int use_sandbox = FALSE;
win_T *ewp;
int p_crb_save;
@@ -1314,9 +1315,7 @@ win_redr_custom(
fillchar = ' ';
attr = HL_ATTR(HLF_TPF);
maxwidth = Columns;
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"tabline", 0);
# endif
opt_name = (char_u *)"tabline";
}
else
{
@@ -1327,6 +1326,7 @@ win_redr_custom(
if (draw_ruler)
{
stl = p_ruf;
opt_name = (char_u *)"rulerformat";
// advance past any leading group spec - implicit in ru_col
if (*stl == '%')
{
@@ -1349,21 +1349,17 @@ win_redr_custom(
fillchar = ' ';
attr = 0;
}
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"rulerformat", 0);
# endif
}
else
{
opt_name = (char_u *)"statusline";
if (*wp->w_p_stl != NUL)
{
stl = wp->w_p_stl;
opt_scope = OPT_LOCAL;
}
else
stl = p_stl;
# ifdef FEAT_EVAL
use_sandbox = was_set_insecurely((char_u *)"statusline",
*wp->w_p_stl == NUL ? 0 : OPT_LOCAL);
# endif
}
col += wp->w_wincol;
@@ -1382,7 +1378,7 @@ win_redr_custom(
// might change the option value and free the memory.
stl = vim_strsave(stl);
width = build_stl_str_hl(ewp, buf, sizeof(buf),
stl, use_sandbox,
stl, opt_name, opt_scope,
fillchar, maxwidth, &hltab, &tabtab);
vim_free(stl);
ewp->w_p_crb = p_crb_save;
@@ -4584,18 +4580,7 @@ draw_tabline(void)
// Use the 'tabline' option if it's set.
if (*p_tal != NUL)
{
int saved_did_emsg = did_emsg;
// Check for an error. If there is one we would loop in redrawing the
// screen. Avoid that by making 'tabline' empty.
did_emsg = FALSE;
win_redr_custom(NULL, FALSE);
if (did_emsg)
set_string_option_direct((char_u *)"tabline", -1,
(char_u *)"", OPT_FREE, SID_ERROR);
did_emsg |= saved_did_emsg;
}
else
#endif
{
+6
View File
@@ -338,6 +338,12 @@ func Test_assert_fails_in_try_block()
endtry
endfunc
func Test_assert_fails_in_timer()
" should not cause a hit-enter prompt, which isn't actually checked here
call timer_start(0, {-> assert_fails('call', 'E471:')})
sleep 10m
endfunc
func Test_assert_beeps()
new
call assert_equal(0, assert_beeps('normal h'))
+27 -6
View File
@@ -23,8 +23,8 @@ func Test_setbufline_getbufline()
call assert_equal(1, setbufline(b, 5, 'x'))
call assert_equal(1, setbufline(b, 5, ['x']))
call assert_equal(1, setbufline(b, 5, []))
call assert_equal(1, setbufline(b, 5, test_null_list()))
call assert_equal(0, setbufline(b, 5, []))
call assert_equal(0, setbufline(b, 5, test_null_list()))
call assert_equal(1, 'x'->setbufline(bufnr('$') + 1, 1))
call assert_equal(1, ['x']->setbufline(bufnr('$') + 1, 1))
@@ -86,6 +86,11 @@ func Test_setline_startup()
sleep 50m
call assert_equal(['Hello'], readfile('Xtest'))
call assert_equal(0, setline(1, []))
call assert_equal(0, setline(1, test_null_list()))
call assert_equal(0, setline(5, []))
call assert_equal(0, setline(6, test_null_list()))
call delete('Xtest')
endfunc
@@ -112,8 +117,8 @@ func Test_appendbufline()
call assert_equal(1, appendbufline(b, 4, 'x'))
call assert_equal(1, appendbufline(b, 4, ['x']))
call assert_equal(1, appendbufline(b, 4, []))
call assert_equal(1, appendbufline(b, 4, test_null_list()))
call assert_equal(0, appendbufline(b, 4, []))
call assert_equal(0, appendbufline(b, 4, test_null_list()))
call assert_equal(1, appendbufline(1234, 1, 'x'))
call assert_equal(1, appendbufline(1234, 1, ['x']))
@@ -122,8 +127,8 @@ func Test_appendbufline()
call assert_equal(0, appendbufline(b, 1, []))
call assert_equal(0, appendbufline(b, 1, test_null_list()))
call assert_equal(1, appendbufline(b, 3, []))
call assert_equal(1, appendbufline(b, 3, test_null_list()))
call assert_equal(0, appendbufline(b, 3, []))
call assert_equal(0, appendbufline(b, 3, test_null_list()))
call assert_equal(['a', 'b', 'c'], getbufline(b, 1, '$'))
@@ -274,4 +279,20 @@ func Test_setbufline_startup_nofile()
call delete('Xresult')
endfunc
" Test that setbufline(), appendbufline() and deletebufline() should fail and
" return 1 when "textlock" is active.
func Test_change_bufline_with_textlock()
new
inoremap <buffer> <expr> <F2> setbufline('', 1, '')
call assert_fails("normal a\<F2>", 'E565:')
call assert_equal('1', getline(1))
inoremap <buffer> <expr> <F2> appendbufline('', 1, '')
call assert_fails("normal a\<F2>", 'E565:')
call assert_equal('11', getline(1))
inoremap <buffer> <expr> <F2> deletebufline('', 1)
call assert_fails("normal a\<F2>", 'E565:')
call assert_equal('111', getline(1))
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+47
View File
@@ -1653,6 +1653,53 @@ func Test_cmd_bang_E135()
%bwipe!
endfunc
func Test_cmd_bang_args()
new
:.!
call assert_equal(0, v:shell_error)
" Note that below there is one space char after the '!'. This caused a
" shell error in the past, see https://github.com/vim/vim/issues/11495.
:.!
call assert_equal(0, v:shell_error)
bwipe!
CheckUnix
:.!pwd
call assert_equal(0, v:shell_error)
:.! pwd
call assert_equal(0, v:shell_error)
" Note there is one space after 'pwd'.
:.! pwd
call assert_equal(0, v:shell_error)
" Note there are two spaces after 'pwd'.
:.! pwd
call assert_equal(0, v:shell_error)
:.!ls ~
call assert_equal(0, v:shell_error)
" Note there is one space char after '~'.
:.!ls ~
call assert_equal(0, v:shell_error)
" Note there are two spaces after '~'.
:.!ls ~
call assert_equal(0, v:shell_error)
:.!echo "foo"
call assert_equal(getline('.'), "foo")
:.!echo "foo "
call assert_equal(getline('.'), "foo ")
:.!echo " foo "
call assert_equal(getline('.'), " foo ")
:.!echo " foo "
call assert_equal(getline('.'), " foo ")
%bwipe!
endfunc
" Test for using ~ for home directory in cmdline completion matches
func Test_cmdline_expand_home()
call mkdir('Xexpdir', 'R')
+1
View File
@@ -611,6 +611,7 @@ let s:filename_checks = {
\ 'verilogams': ['file.va', 'file.vams'],
\ 'vgrindefs': ['vgrindefs'],
\ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'],
\ 'vhs': ['file.tape'],
\ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'],
\ 'viminfo': ['.viminfo', '_viminfo'],
\ 'vmasm': ['file.mar'],
+26 -3
View File
@@ -939,9 +939,13 @@ endfunc
func Test_append()
enew!
split
call append(0, ["foo"])
call append(1, [])
call append(1, test_null_list())
call assert_equal(0, append(1, []))
call assert_equal(0, append(1, test_null_list()))
call assert_equal(0, append(0, ["foo"]))
call assert_equal(0, append(1, []))
call assert_equal(0, append(1, test_null_list()))
call assert_equal(0, append(8, []))
call assert_equal(0, append(9, test_null_list()))
call assert_equal(['foo', ''], getline(1, '$'))
split
only
@@ -2938,6 +2942,25 @@ func Test_builtin_check()
let g:bar = 123
call extend(g:, #{bar: { -> "foo" }}, "keep")
call assert_fails('call extend(g:, #{bar: { -> "foo" }}, "force")', 'E704:')
unlet g:bar
call assert_fails('call extend(l:, #{foo: { -> "foo" }})', 'E704:')
let bar = 123
call extend(l:, #{bar: { -> "foo" }}, "keep")
call assert_fails('call extend(l:, #{bar: { -> "foo" }}, "force")', 'E704:')
unlet bar
call assert_fails('call extend(g:, #{foo: function("extend")})', 'E704:')
let g:bar = 123
call extend(g:, #{bar: function("extend")}, "keep")
call assert_fails('call extend(g:, #{bar: function("extend")}, "force")', 'E704:')
unlet g:bar
call assert_fails('call extend(l:, #{foo: function("extend")})', 'E704:')
let bar = 123
call extend(l:, #{bar: function("extend")}, "keep")
call assert_fails('call extend(l:, #{bar: function("extend")}, "force")', 'E704:')
unlet bar
endfunc
func Test_funcref_to_string()
+1
View File
@@ -316,6 +316,7 @@ func Test_let_errors()
call assert_fails('let l += 2', 'E734:')
call assert_fails('let g:["a;b"] = 10', 'E461:')
call assert_fails('let g:.min = function("max")', 'E704:')
call assert_fails('let g:cos = "" | let g:.cos = {-> 42}', 'E704:')
if has('channel')
let ch = test_null_channel()
call assert_fails('let ch += 1', 'E734:')
+2 -2
View File
@@ -3721,8 +3721,8 @@ def Test_set_get_bufline()
assert_equal(1, setbufline(b, 5, 'x'))
assert_equal(1, setbufline(b, 5, ['x']))
assert_equal(1, setbufline(b, 5, []))
assert_equal(1, setbufline(b, 5, test_null_list()))
assert_equal(0, setbufline(b, 5, []))
assert_equal(0, setbufline(b, 5, test_null_list()))
assert_equal(1, 'x'->setbufline(bufnr('$') + 1, 1))
assert_equal(1, ['x']->setbufline(bufnr('$') + 1, 1))
+12
View File
@@ -3132,6 +3132,18 @@ def Test_expr9_any_index_slice()
unlet g:testlist
enddef
def s:GetList(): list<string>
return ['a', 'b', 'z']
enddef
def Test_slice_const_list()
const list = GetList()
final sliced = list[0 : 1]
# OK to change the list after slicing, it is a copy now
add(sliced, 'Z')
assert_equal(['a', 'b', 'Z'], sliced)
enddef
def Test_expr9_const_any_index_slice()
var lines =<< trim END
vim9script
+2 -1
View File
@@ -4087,7 +4087,8 @@ def Test_no_unknown_error_after_error()
endfor
END
writefile(lines, 'Xdef', 'D')
assert_fails('so Xdef', ['E684:', 'E1012:'])
# Either the exit or out callback is called first, accept them in any order
assert_fails('so Xdef', ['E684:\|E1012:', 'E1012:\|E684:'])
enddef
def InvokeNormal()
+3 -3
View File
@@ -592,7 +592,6 @@ f_assert_exception(typval_T *argvars, typval_T *rettv)
void
f_assert_fails(typval_T *argvars, typval_T *rettv)
{
char_u *cmd;
garray_T ga;
int save_trylevel = trylevel;
int called_emsg_before = called_emsg;
@@ -608,13 +607,13 @@ f_assert_fails(typval_T *argvars, typval_T *rettv)
&& check_for_opt_string_arg(argvars, 4) == FAIL)))))
return;
cmd = tv_get_string_chk(&argvars[0]);
// trylevel must be zero for a ":throw" command to be considered failed
trylevel = 0;
suppress_errthrow = TRUE;
in_assert_fails = TRUE;
++no_wait_return;
char_u *cmd = tv_get_string_chk(&argvars[0]);
do_cmdline_cmd(cmd);
// reset here for any errors reported below
@@ -758,6 +757,7 @@ theend:
did_emsg = FALSE;
got_int = FALSE;
msg_col = 0;
--no_wait_return;
need_wait_return = FALSE;
emsg_on_display = FALSE;
msg_scrolled = 0;
+26
View File
@@ -710,6 +710,32 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
848,
/**/
847,
/**/
846,
/**/
845,
/**/
844,
/**/
843,
/**/
842,
/**/
841,
/**/
840,
/**/
839,
/**/
838,
/**/
837,
/**/
836,
/**/
835,
/**/
+12
View File
@@ -185,6 +185,18 @@ compile_member(int is_slice, int *keeping_dict, cctx_T *cctx)
// a copy is made so the member type is no longer declared
if (typep->type_decl->tt_type == VAR_LIST)
typep->type_decl = &t_list_any;
// a copy is made, the composite is no longer "const"
if (typep->type_curr->tt_flags & TTFLAG_CONST)
{
type_T *type = copy_type(typep->type_curr, cctx->ctx_type_list);
if (type != typep->type_curr) // did get a copy
{
type->tt_flags &= ~(TTFLAG_CONST | TTFLAG_STATIC);
typep->type_curr = type;
}
}
}
else
{