Problem: tests: Test_log_nonexistent() causes asan failure
(Hirohito Higashi)
Solution: don't run vim using system(), but run Vim in a terminal
related: #16602
related: #16610
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: no support for protected new() method
Solution: support the protected "_new()" object method
(Yegappan Lakshmanan)
closes: #16604
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CI: uses Ubuntu 22.04 runners
Solution: Switch to Ubuntu 24.04 runners, make a few adjustments for
different $TMPDIR (Drew Vogel)
closes: #16442
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Currently syntax tests outputs all the Vim commands to the console,
which is annoying for a local developer but also makes the CI output
impossible to parse and just printing all the terminal output comes with
a performance penalty.
So let's just simply redirect all output to /dev/null similar to what
the script tests do.
This can be turned off locally for someone diagnosing issues but it
should not be the default behavior to output all terminal control
sequences to output in CI.
closes: #16612
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_perl: still some compile errors with Perl 5.38
Solution: copy declaration of PL_memory_wrap from Perl header
(Drew Vogel)
closes: #16613
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_WinScrolled_Resized_eiw() uses wrong filename
(Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: insexpand.c hard to read
Solution: refactor slightly to make it better readable
(glepnir)
Problem:
- Complex while loops with nested conditions
- Redundant if branches
- Hard to understand and maintain
Solution:
- Restructure using while(true) with clear break conditions
- Using ternary to replace some if conditions
- Add descriptive comments for each step
closes: #16600
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_log_nonexistent only works on Linux
(after v9.1.1097)
Solution: Add CheckUnix condition
closes: #16476
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match variables after operators, including line continuations.
- Match option variables without leading whitespace.
- Explicitly match expression subscripts.
- Match Vim9 variables in LHS of assignments and method calls.
- Match option variables (&option) with a dedicated syntax group like
environment variables.
- Match list literals, fixes: #5830
- Match :{un}lockvar arguments.
- Match registers and environment variables in :let unpack lists.
- Match lambda expressions
- Match Vim9 scope blocks
- Match variables in :for subject
- Highlight user variables with Normal
- Improve this/super keyword matching, fixes: #15970closes: #16476
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: import with extends may crash, v9.1.1087 wasn't the
correct way to fix it)
Solution: When using an import class, Check for a valid class member
variable at compile time (Yegappan Lakshmanan)
related: #16601closes: #16603
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: matchparen plugin test wrongly named
(zeertzjq)
Solution: rename test_matchparen to test_plugin_matchparen
to be consistent with the other plugin tests
related: #16599
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: problem finding implemented method for abstract method
in type hierarchy (Aliaksei Budavei)
Solution: When checking for abstract methods in an extended class, check
whether an abstract method is implemented in one of the parent
classes (Yegappan Lakshmanan)
fixes: #16495closes: #16497
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match both | separators and link to the Delimiter highlight group.
fixes#16584closes: #16590
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: output of test Test_terminal_eof_arg_win32_ctrl_z depends on python
version.
Solution: Check for the expected output in both, the second last line
and last line
It seems python 3.13 changed the output a bit and there is no longer a
trailing blank line. So to keep compatible with python < 3.13, let's
check for the expected output in either the last line and the second
last line.
closes: #16599
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: fix expected return code for python 3.13 on Windows
Solution: Check for return code 1 or 123 on Windows
There is a regression with python 3.13 on Windows, that it no longer
prints the requested error code, but instead exits with return code 1,
which breaks the test-suite.
So let's check for either exit code 1 or 123 in tests
Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg()
This will probably be fixed on the Python side, see the pull request
python/cpython#129901 but in the meantime, let's allow both error codes.
related: #16599
related: python/cpython#129900
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: timeout might be a bit too small
Solution: increase the test timeout from 30 to 45 seconds
related: #16599
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_terminwscroll_topline2 unreliable
(Yee Cheng Chin)
Solution: instead of using term_wait() with a specific time, use
terminal-api and to wait until the terminal is finished
call a terminal callback function when finished printing, instead of
using term_wait(), with a defined time, which caused timeouts on CI
with the macos runners
Unfortunately I couldn't figure out how to call the terminal-api on Windows,
so skip the test on Windows. cmd.com echo didn's seem to work and
neither did trying to use python, but perhaps it was just me fighting
with the terminal quoting rules 🤷
related: #16599
related: #16552
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: No check when tests are run under Github actions
Solution: Add the CheckGithubActions check command and skip test if
needed
related: #16599
related: actions/runner-images#11512
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: plugin tests are named inconsistently
Solution: group them under a common 'plugin' prefix
related: #16599
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: import with extends may crash
Solution: check otv for being NULL before trying to access it
(Hirohito Higashi)
closes: #16601
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: completion doesn't work with multi lines
(Łukasz Jan Niemier)
Solution: handle linebreaks in completion code as expected
(glepnir)
fixes: #2505closes: #15373
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: cmmt files are not recognized
Solution: detect '*.cmmt' as trace32 filetype
(Christian Sax)
"*.cmmt" files use the same syntax as regular TRACE32 scripts,
but are intended as a kind of script template.
closes: #16598
Signed-off-by: Christoph Sax <c_sax@mailbox.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
(Luuk van Baal)
Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.
closes: #16530
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
this change includes the following changes:
- a macro option must be #1–#9
- add \providecommand
- add starred versions of \newcommand, \newenvironment, and their
variants
- add number of arguments to \(re)newenvironment
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: setreg() doesn't correctly handle mbyte chars in blockwise
mode
Solution: use mb_ptr2len_len function pointer (Yee Cheng Chin)
setreg() will automatically calculate the width when a blockwise mode is
specified, but it does not properly calculate the line widths of mbyte
characters when value is passed as newline-terminated string. It does
work when value is passed as a list of lines though.
Fix this by properly using the mbyte function pointer to increment the
loop counter.
closes: #16596
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: unexpected DCS responses may cause out of bounds reads
(after v9.1.1054)
Solution: check that the parsed value is '=' as expected
(Julio B)
Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: has('bsd') is true for GNU/Hurd
Solution: exclude GNU/Hurd from BSD feature flag
(Zhaoming Luo)
GNU/Hurd, like Mac OS X, is a BSD-based system. It should exclude
has('bsd') feature just like what Mac OS X does. The __GNU__ pre-defined
macro indicates it's compiled for GNU/Hurd.
closes: #16580
Signed-off-by: Zhaoming Luo <zhmingluo@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: Mill files are not recognized
Solution: detect '*.mill' files as scala filetype
(author)
In the past [Mill](https://mill-build.org/mill/index.html) build files
were always `build.sc` and treated as Scala files. However as the 0.12.x
series of mill you can create a `build.mill` file. You can see a lot of
examples of this if you search
[GitHub](https://github.com/search?q=build.mill&type=code). This small
change just ensures that if you have a `*.mill` file it treats it as a
Scala file.
closes: #16585
Signed-off-by: Chris Kipp <ckipp@pm.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: GUI late startup leads to uninitialized scrollbars
Solution: initialize scrollbars for all windows in all tabpages
(Yee Cheng Chin)
GUI startup was erroneously only initializing scrollbars for all windows
in current tab, instead of all tabs. This breaks if the user has created
tab pages before using `:gui` command to enter GUI mode, or sourced a
session file in vimrc.
closes: #16588
related: macvim-dev/macvim#862
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
while at it, clean up the tar plugin a bit and sort the patterns for the
tar and gzip plugin
References:
- https://github.com/lz4/lz4
- https://lz4.org/closes: #16591
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Corpulent Robin <177767857+corpulentrobin@users.noreply.github.com>
Problem: Terminal ansi colors off by one after tgc reset
Solution: Set the correct index for libvterm palette,
revert parts in libvterm/src/pen.c that deviated from upstream
(Julio B)
fixes: #16568closes: #16573
related: Vim patch v8.2.0804
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Syntax engine interpreted contains=TOP as matching nothing
inside included files, since :syn-include forces HL_CONTAINED
on for every included item. After 8.2.2761, interprets
contains=TOP as contains=@INCLUDED, which is also not correct
since it doesn't respect exclusions, and doesn't work if there
is no @INCLUDED cluster.
Solution: revert patch 8.2.2761, instead track groups that have had
HL_CONTAINED forced, and interpret contains=TOP and
contains=CONTAINED using this. (Theodore Dubois)
fixes: #11277closes: #16571
Signed-off-by: Theodore Dubois <tblodt@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: vim_strnchr() is strange and unnecessary (after v9.1.1009)
Solution: Remove vim_strnchr() and use memchr() instead. Also remove a
comment referencing an #if that is no longer present.
vim_strnchr() is strange in several ways:
- It's named like vim_strchr(), but unlike vim_strchr() it doesn't
support finding a multibyte char.
- Its logic is similar to vim_strbyte(), but unlike vim_strbyte() it
uses char instead of char_u.
- It takes a pointer as its size argument, which isn't convenient for
all its callers.
- It allows embedded NULs, unlike other "strn*" functions which stop
when encountering a NUL byte.
In comparison, memchr() also allows embedded NULs, and it converts bytes
in the string to (unsigned char).
closes: #16579
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: length variable not used in compile_load()
Solution: use len instead of re-calculating the length
(Hirohito Higashi)
closes: #16582
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match :0debuggreedy as a special case until better range/count support
is implemented.
closes: #16572
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Strange error when heredoc marker starts with "trim".
Solution: Check for whitespace after "trim" or "eval" (zeertzjq)
For :python3 etc., a heredoc marker that starts with a lower-case letter
is valid, and when it starts with "trim" it works in a script but not in
a function, and this PR makes it works in a function.
For :let, a heredoc marker that starts with a lower-case letter is not
valid, but when it starts with "trim" or "eval" the error can be a bit
confusing in a function, and this PR make it less confusing.
closes: #16574
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_compiler fails on Windows without Maven.
Solution: Add Xspotbugs directory to $PATH when mvn is not available
(zeertzjq).
closes: #16576
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'diffopt' "linematch" cannot be used with {n} less than 10
digits (after v9.1.1022)
Solution: Fix off-by-one error when checking for digit (zeertzjq)
closes: #16577
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Arguments of a function are missing after failing to redefine
it (after 8.2.2505), and heap-use-after-free with script-local
function (after 9.1.1063).
Solution: Don't clear arguments or free uf_name_exp when failing to
redefine an existing function (zeertzjq)
closes: #16567
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot control cursor positioning of getchar().
Solution: Add "cursor" flag to {opts}, with possible values "hide",
"keep" and "msg".
related: #10603closes: #16569
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: preinsert text completions not deleted with <C-W>/<C-U>
(ddad431, after v9.1.1059)
Solution: handle <C-W> or <C-U> specifically and clear the completion
(glepnir)
fixes: #16557closes: #16565
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: getchar() can't distinguish between C-I and Tab.
Solution: Add {opts} to pass extra flags to getchar() and getcharstr(),
with "number" and "simplify" keys.
related: #10603closes: #16554
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: heap-use-after-free and stack-use-after-scope with :14verbose
when using :return and :try (after 9.1.1063).
Solution: Move back the vim_free(tofree) and the scope of numbuf[].
(zeertzjq)
closes: #16563
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: no digraph for "Approaches the limit"
Solution: Add the digraph using .= (Hans Ginzel)
Add digraph Approaches the Limit
≐ U+2250 https://www.fileformat.info/info/unicode/char/2250/index.htmcloses: #16508
Signed-off-by: Hans Ginzel <hans@matfyz.cz>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: not possible to use plural forms with gettext()
Solution: implement ngettext() Vim script function (Christ van Willegen)
closes: #16561
Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>