As reported in #16559, bytes of a multibyte character may
be written as separate U+FFFD characters in a ":terminal"
window on a busy machine. The testing facilities currently
offer an optional filtering step to be carried out between
reading and comparing the contents of two screendump files
for each such file. This filtering has been resorted to
(#14767 and #16560) in an attempt to unconditionally replace
known non-Latin-1 characters with an arbitrary substitute
ASCII character and avoid this rendering mishap leading to
syntax tests failures. However, it has been overlooked at
the time that metadata description (in shorthand) to follow
spurious U+FFFD characters may be *distinct* and make the
remainder of such a line, ASCII characters and whatnot, also
unequal between compared screendump files.
While it is straightforward to adapt current filter files to
ignore the line characters after the leftmost U+FFFD,
> It is challenging and error-prone to keep up to date filter
> files because moving around examples in source files will
> likely make redundant some previously required filter files
> and, at the same time, it may require creating new filter
> files for the same source file; substituting one multibyte
> character for another multibyte character will also demand
> a coordinated change for filter files.
Besides, unconditionally dropping arbitrary parts of a line
is rather too blunt an instrument. An alternative approach
is to not use the supported filtering for this purpose; let
a syntax test pass or fail initially; then *if* the same
failure is imminent, drop the leftmost U+FFFD and the rest
of the previously seen line (repeating it for all previously
seen unequal lines) before another round of file contents
comparing. The obvious disadvantage with this filtering,
unconditional and otherwise, is that if there are consistent
failures for _other reasons_ and the unequal parts happen to
be after U+FFFDs, then spurious test passing can happen when
stars align for _a particular test runner_.
Hence syntax test authors should strive to write as little
significant text after multibyte characters as syntactically
permissible, write multibyte characters closer to EOL in
general, and make sure that their checked-in and published
"*.dump" files do not have any U+FFFDs.
It is also practical to refrain from attempting screendump
generation if U+FFFDs can already be discovered, and instead
try re-running from scratch the syntax test in hand, while
accepting other recently generated screendumps without going
through with new rounds of verification.
Reference:
https://github.com/vim/vim/pull/16470#issuecomment-2599848525closes: #17704
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
These file filters are not sufficient to work around #16559
and are to be superseded by a more promising alternative.
related: #17704
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Before two screendumps are compared for equality by calling
"VerifyScreenDump()", parts of their contents can be omitted
from comparison by executing arbitrary Vim commands written
in a filter file that shares its basename with screendumps.
Sometimes, such filtering can only be too general, as more
context is required in order to decide what parts to touch.
Two new arbitrary functions are therefore hooked in the body
of "VerifyScreenDump()" for the purpose of probing into the
current context and applying iterative filtering as needed.
A paired-up public implementation of each function is also
provided to expedite a workaround for #16559:
------------------------------------------------------------
source util/screendump.vim
let opts = {
\ 'FileComparisonPreAction':
\ function('g:ScreenDumpDiscardFFFDChars'),
\ 'NonEqualLineComparisonPostAction':
\ function('g:ScreenDumpLookForFFFDChars'),
\ }
call g:VerifyScreenDump(buf, basename, opts)
------------------------------------------------------------
related: #17704
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
And express the established indentation style of the file in
its modeline.
related: #17704
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The currently given names to the uploaded archives are too
common and require (often manual) renaming for downloaded
archives that belong to different CI runs/attempts of a PR
and/or different PRs. Let's automatically disambiguate such
archives from one another by giving them more unique names
for convenience and future reference.
related: #17704
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Improve formatting and naming consistency of the syntax tests.
closes: #17850
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: VMS support can be improved
Solution: Merge chagnes from Steven M. Schweda
(Zoltan)
closes: #17810
Co-authored-by: Steven M. Schweda <sms@antinode.info>
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot perform autocompletion
Solution: Add the 'autocomplete' option value
(Girish Palya)
This change introduces the 'autocomplete' ('ac') boolean option to
enable automatic popup menu completion during insert mode. When enabled,
Vim shows a completion menu as you type, similar to pressing |i\_CTRL-N|
manually. The items are collected from sources defined in the
'complete' option.
To ensure responsiveness, this feature uses a time-sliced strategy:
- Sources earlier in the 'complete' list are given more time.
- If a source exceeds its allocated timeout, it is interrupted.
- The next source is then started with a reduced timeout (exponentially
decayed).
- A small minimum ensures every source still gets a brief chance to
contribute.
The feature is fully compatible with other |i_CTRL-X| completion modes,
which can temporarily suspend automatic completion when triggered.
See :help 'autocomplete' and :help ins-autocompletion for more details.
To try it out, use :set ac
You should see a popup menu appear automatically with suggestions. This
works seamlessly across:
- Large files (multi-gigabyte size)
- Massive codebases (:argadd thousands of .c or .h files)
- Large dictionaries via the `k` option
- Slow or blocking LSP servers or user-defined 'completefunc'
Despite potential slowness in sources, the menu remains fast,
responsive, and useful.
Compatibility: This mode is fully compatible with existing completion
methods. You can still invoke any CTRL-X based completion (e.g.,
CTRL-X CTRL-F for filenames) at any time (CTRL-X temporarily
suspends 'autocomplete'). To specifically use i_CTRL-N, dismiss the
current popup by pressing CTRL-E first.
---
How it works
To keep completion snappy under all conditions, autocompletion uses a
decaying time-sliced algorithm:
- Starts with an initial timeout (80ms).
- If a source does not complete within the timeout, it's interrupted and
the timeout is halved for the next source.
- This continues recursively until a minimum timeout (5ms) is reached.
- All sources are given a chance, but slower ones are de-prioritized
quickly.
Most of the time, matches are computed well within the initial window.
---
Implementation details
- Completion logic is mostly triggered in `edit.c` and handled in
insexpand.c.
- Uses existing inc_compl_check_keys() mechanism, so no new polling
hooks are needed.
- The completion system already checks for user input periodically; it
now also checks for timer expiry.
---
Design notes
- The menu doesn't continuously update after it's shown to prevent
visual distraction (due to resizing) and ensure the internal list
stays synchronized with the displayed menu.
- The 'complete' option determines priority—sources listed earlier get
more time.
- The exponential time-decay mechanism prevents indefinite collection,
contributing to low CPU usage and a minimal memory footprint.
- Timeout values are intentionally not configurable—this system is
optimized to "just work" out of the box. If autocompletion feels slow,
it typically indicates a deeper performance bottleneck (e.g., a slow
custom function not using `complete_check()`) rather than a
configuration issue.
---
Performance
Based on testing, the total roundtrip time for completion is generally
under 200ms. For common usage, it often responds in under 50ms on an
average laptop, which falls within the "feels instantaneous" category
(sub-100ms) for perceived user experience.
| Upper Bound (ms) | Perceived UX
|----------------- |-------------
| <100 ms | Excellent; instantaneous
| <200 ms | Good; snappy
| >300 ms | Noticeable lag
| >500 ms | Sluggish/Broken
---
Why this belongs in core:
- Minimal and focused implementation, tightly integrated with existing
Insert-mode completion logic.
- Zero reliance on autocommands and external scripting.
- Makes full use of Vim’s highly composable 'complete' infrastructure
while avoiding the complexity of plugin-based solutions.
- Gives users C native autocompletion with excellent responsiveness and
no configuration overhead.
- Adds a key UX functionality in a simple, performant, and Vim-like way.
closes: #17812
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot disable cscope interface using configure, because in
feature.h FEAT_CSCOPE will always be enabled for huge builds
(chdiza)
Solution: Don't define FEAT_CSCOPE from configure script but set the
ENABLE_CSCOPE flag and check for the presence of that flag in
feature.h
fixes: #17825closes: #17842
Signed-off-by: Christian Brabandt <cb@256bit.org>
This change includes the following upstream commits:
- fix: remove black lines in directory listing
- fix: correctly create new file when using Lexplore
- refactor: remove print functionality
The main highlight is removing print functionality that was broken both
in neovim and vim.
closes: #17847
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: can define an enum/interface in a function
(lacygoill)
Solution: Give an error when defining an enum or an interface inside a
function (Yegappan Lakshmanan)
fixes: #17835fixes: #17837closes: #17837
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Add complete_check() to ccomplete completion script to avoid UI hangs
and keep Vim responsive as ccomplete can be slow on huge files.
closes: #17826
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wayland: gvim still needs GVIM_ENABLE_WAYLAND
Solution: Drop the GVIM_ENABLE_WAYLAND code, always enable both X11 and
Wayland GUI support (Christoffer Aasted)
closes: #17817
Signed-off-by: Christoffer Aasted <chr.aasted@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: :term splits new window above in vim, but in nvim it change
the buffer for current window
Solution: :hor term to ensure consistent splitting for Vim and Neovim
closes: #17822
Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: using ints as bool
Solution: Include stdbool.h and start using bool type directly
(Hirohito Higashi)
This is a test to see if using the boolean types cause any issues.
If this change causes issues on any platform, please reach out.
closes: #17830
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Since patch 9.1.1199 the gvim window no longer had _NET_WM_ICON
nor WM_HINTS icon information, for example when not using a
Gnome or KDE desktop (after v9.1.1199)
Solution: Check if the icon theme as used in patch 1199 contains a gvim
icon. If so, set the window's icon from that. Otherwise
use the previous method (Olaf Seibert)
fixes: #17703closes: #17814
Signed-off-by: Olaf Seibert <rhialto@falu.nl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: style issue in vim9type.c and vim9generics.c
(after v9.1.1581 and v9.1.1580)
Solution: Update Style and place opening brace on a new line.
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible memory leak in vim9generics.c
Solution: Free ret_free if ga_grow() fails and before returning
(Lidong Yan).
In parse_generic_func_type_args() at vim9generics.c, we allocate memory
in ret_name and should free it by calling vim_free(ret_free). If
ga_grow on gfatab->gfat_args failed, we forget to call vim_free(ret_free)
thus would cause a leak. Add vim_free(ret_free) before return NULL.
closes: #17821
Signed-off-by: Lidong Yan <yldhome2d2@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible memory leak in vim9type.c
Solution: Free tuple_types_ga if there was an error in
type_type_add_types() (Lidong Yan)
In parse_type_tuple() at src/vim9type.c, we allocate memory
in `tuple_types_ga` by ga_grow(), but forget to free it when
tuple_type_add_types() fails. Replace `return NULL` with `goto on_err`
to fix leak.
closes: #17820
Signed-off-by: Lidong Yan <yldhome2d2@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains about unchecked return value in
common_function() (after v9.1.1577)
Solution: Check the return value of skip_generic_func_type_args()
and return in case of an error (Yegappan Lakshmanan)
closes: #17818
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: configure: comment still mentions autoconf 2.71 to generate
the configure script
Solution: Update the comment to use autoconf 2.72 instead (Yee Chin Cheng).
Vim v9.1.1369 updated the autoconf generation to be done using 2.72.
Update comments to reflect that.
closes: #17815
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: no generic support yet
Solution: Add support for generic functions, funcrefs and object/class
methods (Yegappan Lakshmanan).
closes: #17313
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot easily trigger wildcard expansion
Solution: Introduce wildtrigger() function
(Girish Palya)
This PR introduces a new `wildtrigger()` function.
See `:h wildtrigger()`
`wildtrigger()` behaves like pressing the `wildchar,` but provides a
more refined and controlled completion experience:
- Suppresses beeps when no matches are found.
- Avoids displaying irrelevant completions (like full command lists)
when the prefix is insufficient or doesn't match.
- Skips completion if the typeahead buffer has pending input or if a
wildmenu is already active.
- Does not print "..." before completion.
This is an improvement on the `feedkeys()` based autocompletion script
given in #16759.
closes: #17806
Signed-off-by: Girish Palya <girishji@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tabpanel not drawn correctly with wrapped lines
(utubo, after v9.1.1534)
Solution: Use Columns as width, not the frame width
(Hirohito Higashi)
fixes: #17774closes: #17809
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Dead code in mbyte.c
Solution: Delete the dead wcwidth()/iswprint() code
(Damien Lejay)
These library calls have been disabled since patch 6.2.446 (2002) due to
display issues with Hebrew. They are also non-portable: wcwidth() is a
POSIX function and not available on MSVC or other non-POSIX platforms.
Keeping this code path adds complexity without benefit.
closes: #17811
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Memory leak when pressing Ctrl-D in cmdline mode
(after 9.1.1571).
Solution: Free prev_cmdbuff before assigning to it.
(zeertzjq).
Existing tests already cover this. This change fixes the CI failure.
closes: #17807
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
`vim.pot` is included in the repository after
```gitcommit
commit 59bd74ed4c9ab366182c93bdc430b186729abbad
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Jul 13 08:26:57 2025 +0200
translation: include vim.pot in the repository
```
And it adds quite a lot of noise to the diffs since then. See the
reasoning in a comment in `.gitattributes`.
I'm not 100% sure that marking it as binary would have no negative side
effects. But I was not able to find a better option in `git help
attributes`.
Solution suggested in
```gitcommit
commit 5d552d652b0197063565ab937d30f92a9ed28545
Author: Christian Brabandt <cb@256bit.org>
Date: Tue Jul 15 20:42:48 2025 +0200
translation: ignore vim.pot creation date, regenerate it, rm allfiles
Signed-off-by: Christian Brabandt <cb@256bit.org>
```
does not seem to be solving the problem. It only hides the
`POT-Creation` line from the `vim.pot` diff. Maybe a more elaborate
filter could be used - one that replaces lines numbers in `vim.pot` with
`xxxx`, thus removing the most annoying and useless part of the diff.
One downside is that it requires everyone to install such a filter
locally - it can not be part of the repo config, as far as I understand.
closes: #17775
Signed-off-by: Illia Bobyr <illia.bobyr@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Let's add the --no-location to the xgettext command line call, so that
the generated vim.pot file does not contain the message location. Those
will get out of date soon and we don't want to update vim.pot just
because the location in a comment changes.
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: expanding $var does not escape whitespace for 'path'
Solution: Escape whitespace when expanding 'path' option.
(Miguel Barro)
closes: #17801
Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The CmdlineChanged event was firing unnecessarily, even when
the command line's content hadn't actually changed.
Solution: I've added a check to compare the command-line buffer's state
before and after key processing. The `CmdlineChanged` event
now only triggers if the buffer's contents are genuinely
different (Girish Palya).
closes: #17803
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match :autocmd options and special buffer pattern.
- Normalise ellipsis (three dots) in Ex command argument lists.
closes: #17793
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Copilot suggested some improvements in cmdexpand.c
(after v9.1.1556)
Solution: Use better variable names and comments
(John Marriott).
closes: #17795
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>