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: tests: Test_WinScrolled_Resized_eiw() uses wrong filename
(Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique
glepnir [Mon, 10 Feb 2025 21:18:00 +0000 (22:18 +0100)]
patch 9.1.1101: insexpand.c hard to read
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>
- 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: #15970
closes: #16476
Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1099: Vim9: import with extends may crash
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: #16601
closes: #16603
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1095: tests: matchparen plugin test wrongly named
Problem: tests: matchparen plugin test wrongly named
(zeertzjq)
Solution: rename test_matchparen to test_plugin_matchparen
to be consistent with the other plugin tests
patch 9.1.1094: Vim9: problem finding implemented method in type hierarchy
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: #16495
closes: #16497
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1093: tests: output of test ...win32_ctrl_z depends on python version
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.
patch 9.1.1092: tests: fix expected return code for python 3.13 on Windows
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.
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 :shrug:
Luuk van Baal [Sat, 8 Feb 2025 17:52:39 +0000 (18:52 +0100)]
patch 9.1.1084: Unable to persistently ignore events in a window and its buffers
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>
Zhaoming Luo [Thu, 6 Feb 2025 20:39:35 +0000 (21:39 +0100)]
patch 9.1.1081: has('bsd') is true for GNU/Hurd
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>
Chris Kipp [Thu, 6 Feb 2025 20:26:08 +0000 (21:26 +0100)]
patch 9.1.1080: filetype: Mill files are not recognized
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>
patch 9.1.1079: GUI late startup leads to uninitialized scrollbars
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>
Julio B [Thu, 6 Feb 2025 19:31:27 +0000 (20:31 +0100)]
patch 9.1.1078: Terminal ansi colors off by one after tgc reset
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: #16568
closes: #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>
Theodore Dubois [Wed, 5 Feb 2025 22:59:25 +0000 (23:59 +0100)]
patch 9.1.1077: included syntax items do not understand contains=TOP
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: #11277
closes: #16571
Signed-off-by: Theodore Dubois <tblodt@icloud.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Tue, 4 Feb 2025 15:48:36 +0000 (16:48 +0100)]
patch 9.1.1076: vim_strnchr() is strange and unnecessary
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>
zeertzjq [Mon, 3 Feb 2025 17:56:16 +0000 (18:56 +0100)]
patch 9.1.1074: Strange error when heredoc marker starts with "trim"
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>
zeertzjq [Mon, 3 Feb 2025 17:49:49 +0000 (18:49 +0100)]
patch 9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10
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>
zeertzjq [Sun, 2 Feb 2025 18:03:17 +0000 (19:03 +0100)]
patch 9.1.1071: args missing after failing to redefine a function
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>
glepnir [Sun, 2 Feb 2025 08:36:22 +0000 (09:36 +0100)]
patch 9.1.1069: preinsert text completions not deleted with <C-W>/<C-U>
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: #16557
closes: #16565
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Sun, 2 Feb 2025 08:14:35 +0000 (09:14 +0100)]
patch 9.1.1068: getchar() can't distinguish between C-I and Tab
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: #10603
closes: #16554
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Sun, 2 Feb 2025 07:55:57 +0000 (08:55 +0100)]
patch 9.1.1066: heap-use-after-free and stack-use-after-scope with :14verbose
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>
John Marriott [Sat, 1 Feb 2025 14:25:34 +0000 (15:25 +0100)]
patch 9.1.1063: too many strlen() calls in userfunc.c
Problem: too many strlen() calls in userfunc.c
Solution: refactor userfunc.c and remove calls to strlen(),
drop set_ufunc_name() and roll it into alloc_ufunc(),
check for out-of-memory condition in trans_function_name_ext()
(John Marriott)
closes: #16537
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1062: terminal: E315 when dragging the terminal with the mouse
Problem: terminal: E315 when dragging the terminal with the mouse
(user202729)
Solution: call update_topline() and validate_cursor() when clicking
on the status line with the mouse (Hirohito Higashi)
fixes: #16024
fixes: #16211
closes: #16552
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Morton Fox [Sat, 1 Feb 2025 09:28:52 +0000 (10:28 +0100)]
runtime(openPlugin): fix unclosed parenthesis in GetWordUnderCursor()
Problem:
Saw the following error when invoking gx mapping with cursor on a URL:
Error detected while compiling function <SNR>95_GetWordUnderCursor:
line 7:
E1123: Missing comma before argument: return expand(user_var)
E116: Invalid arguments for function dist#vim9#Open
Solution:
The line before "return expand(...)" has two open parentheses but only
one close parenthesis. Add another close parenthesis.
closes: #16553
Signed-off-by: Morton Fox <github@qslw.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1061: tests: test_glvs fails when unarchiver not available
Problem: tests: test_glvs fails when unarchiver not available
(Brian L. Matthews)
Solution: Check if an unarchiver is available, skip the test otherwise
patch 9.1.1060: Vim always enables 'termguicolors' in a terminal
Problem: Vim always enables 'termguicolors' in a terminal, even
when not wanted (after v9.1.1054)
Solution: Respect `:set notermguicolors` in vimrc file
glepnir [Fri, 31 Jan 2025 14:28:29 +0000 (15:28 +0100)]
patch 9.1.1059: completion: input text deleted with preinsert when adding leader
Problem: completion: input text deleted with preinsert when adding leader
Solution: remove compl_length and check the ptr for being equal
to pattern when preinsert is active (glepnir)
closes: #16545
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Ivan Pešić [Fri, 31 Jan 2025 14:20:03 +0000 (15:20 +0100)]
patch 9.1.1058: translation(sr): Missing Serbian translation for the tutor
Problem: translation(sr): Missing Serbian translation for the tutor
Solution: include new Serbian translation for the new tutor,
include translation for chapter 2 of the traditional tutor,
update the Makefiles for installing the runtime files
(Ivan Pešić)
closes: #16550
Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Thu, 30 Jan 2025 10:04:47 +0000 (11:04 +0100)]
patch 9.1.1057: Superfluous cleanup steps in test_ins_complete.vim
Problem: Superfluous cleanup steps in test_ins_complete.vim.
Solution: Remove unnecessary :bw! and :autocmd! commands.
Also remove unnecessary STRLEN() in insexpand.c
(zeertzjq)
closes: #16542
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Luca Saccarola [Wed, 29 Jan 2025 17:39:30 +0000 (18:39 +0100)]
runtime(netrw): upstream snapshot of v176
relevant commits:
- deprecate!: netrw#Launch, netrw#Open and gx mappings
- refactor: move some utility functions in a private file
- feat: add function to deprecate features
- refactor!: remove NetrwClean command and function
- refactor: use appropriate directories to store temporary files
- refactor: better way to call vim.ui.open
- refactor(Open): prefer lua wrapper function instead of cmdline
- refactor!: drop vim 7 checks
- refactor: use vim.ui.open when using neovim
- refactor: remove s:CheckIfKde
- refactor: balloon functionality
- refactor!: remove netrw#Access function
closes: #16519
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1054: Vim doesn't work well with TERM=xterm-direct
Problem: Vim doesn't work well with TERM=xterm-direct
(Andrea Pappacoda)
Solution: detect if a terminal supports true-colors and
enable termguicolors
The terminfo database for xterm-direct contains both the (non-standard)
termcap RGB capability and a number of colors == 0x1000000 so it seems
either of those two options can be used to detect a terminal capable of
displaying true colors.
So set the termguicolor option automatically, when either of the two
options is detected. (for some reasons, my debian xterm (v393) does not
respond to XTGETTCAP query attempts, so falling back to the number of
colors seems like a good compromize)
zeertzjq [Sat, 25 Jan 2025 14:29:03 +0000 (15:29 +0100)]
patch 9.1.1053: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt'
Problem: "nosort" enables fuzzy filtering even if "fuzzy" isn't in
'completeopt' (after v9.1.1049)
Solution: Only enable fuzzy filtering when "fuzzy" is in 'completeopt'.
(zeertzjq)
closes: #16510
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1052: tests: off-by-one error in CheckCWD in test_debugger.vim
Problem: tests: off-by-one error in CheckCWD in test_debugger.vim
Solution: Fix off-by-one in CheckCWD leading to local tests failure
(Yee Cheng Chin)
Vim's test_debugger's Test_debug_backtrace_level test will fail if you
happen to run it in a Vim repository with full path of directory being
exactly 29 characters (e.g. `/Users/bob/developing/src/vim`). The test
does term dump comparison and the printout will overflow if the CWD is
too long. It does have a function to skip to test if it detects that but
it's off by one leading to this one situation where it will fail.
The reason why the logic didn't account for this is that Vim's message
printing will overflow the text if it prints a message at exactly the
width of the terminal. This could be considered a bug / quirk but that
will be another issue.
closes: #16517
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1051: tests: no support for env variables when running Vim in terminal
Problem: tests: no support for env variables when running Vim in
terminal
Solution: support the "env" argument in RunVimInTerminal(),
close swapfiles properly in test_termcodes,
use CheckFeature in test_termencoding
glepnir [Thu, 23 Jan 2025 18:55:14 +0000 (19:55 +0100)]
patch 9.1.1049: insert-completed items are always sorted
Problem: insert-completed items are always sorted, although the LSP
spec[1] standard defines sortText in the returned
completionitem list. This means that the server has sorted the
results. When fuzzy is enabled, this will break the server's
sorting results.
Solution: disable sorting of candidates when "nosort" is set in
'completeopt'
Gordian Dziwis [Tue, 21 Jan 2025 21:24:23 +0000 (22:24 +0100)]
patch 9.1.1045: filetype: N-Tripels and TriG files are not recognized
Problem: filetype: N-Tripels and TriG files are not recognized
Solution: detect '*.nt' files as ntriples filetype and '*.trig' files
as trig filetype (Gordian Dziwis)
closes: #16493
Signed-off-by: Gordian Dziwis <gordian@dziw.is> Signed-off-by: Christian Brabandt <cb@256bit.org>
Peter Benjamin [Mon, 20 Jan 2025 20:56:41 +0000 (21:56 +0100)]
patch 9.1.1042: filetype: just files are not recognized
Problem: filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
include just ftplugin, indent and syntax plugin
(Peter Benjamin)
closes: #16466
Signed-off-by: Peter Benjamin <petermbenjamin@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1041: Vim9: out-of-bound access when echoing an enum
Problem: Vim9: out-of-bound access when echoing an enum
Solution: Add NUL to growarray, check that ufunc is non-null
before accessing it to make Coverity happy
(Yegappan Lakshmanan)
closes: #16488
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1040: Vim9: imported type cannot be used as func return type
Problem: Vim9: imported type cannot be used as func return type
(Dayvid Albuquerque)
Solution: temporarily reset the is_export flag (Yegappan Lakshmanan)
fixes: #16489
closes: #16492
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Ernie Rael [Sun, 19 Jan 2025 09:03:00 +0000 (10:03 +0100)]
patch 9.1.1037: Vim9: confusing error when using abstract method via super
Problem: Vim9: confusing error when using abstract method via super
Solution: Display an error when an abstract method is invoked using
super (Ernie Rael)
Luca Saccarola [Sat, 18 Jan 2025 16:36:02 +0000 (17:36 +0100)]
runtime(netrw): upstream snapshot of v175
Relevant commits:
- release: netrw v175
- fix: prevent netrw to load into the built-in terminal
- fix: restore correctly cpo settings
- fix(docs): mispelled original authors name
- chore: move viml files to new formatting standard
fixes: #16463
closes: #16465
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>