runtime(netrw): restore blank line cleanup after file listing
Problem: v182 refactoring removed blank line cleanup (g/^$/d) from
s:LocalListing(), causing empty lines between directories
and files.
Solution: Add the missing cleanup after append() in s:PerformListing()
(uma-chan).
Problem: tests: testdir is a bit messy
Solution: move test scripts into testdir/util/ directory
src/testdir/ has become a dumping ground mixing test cases with utility
functions. Let's fix this by moving all utility functions into the
testdir/util/ directory
Also a few related changes had to be done:
- Update Filelist
- update README.txt and mention the new directory layout
- fix shadowbuild by linking the util directory into the shadow dir
patch 9.1.1524: tests: too many imports in the test suite
Problem: tests: too many imports in the test suite
Solution: Clean up the imported scripts
Most tests make use of check.vim, so let's just source it once in
runtest.vim instead of having each test manually source it.
runtest.vim already sources shared.vim, which again sources
view_util.vim, so we don't need to source those two common
dependencies in all the other tests
And then check.vim sources term_util.vim already, so we can in addition
drop sourcing it explicitly in each single test script.
Note: test_expand_func.vim had to be updated to account for the changed
number of sourced files.
And finally check.vim uses line-continuation so let's also explicitly
enable line continuation via the 'cpo' option value.
patch 9.1.1522: tests: still some ANSI escape sequences in test output
Problem: tests: still some ANSI escape sequences in test messages output
Solution: update the cleanup regexp to also handle those ANSI escape
sequences: `<esc>|2h` and `<esc>|31H` like in this log output:
```
2025-07-05T20:02:47.6350409Z <esc>|2hExecuted 171 tests in 4.739708 seconds<esc>|31H
```
patch 9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect'
Problem: When 'wildmode' is set to include "noselect", the popup menu (pum)
incorrectly retained its scroll position when reopened. This
meant that after scrolling down through the menu with `<C-n>`,
reopening the menu (e.g., by retyping the command and
triggering completion again) would show the menu starting from
the previously scrolled position, rather than from the top.
This could confuse users, as the first visible item would not
be the first actual match in the list.
Solution: Ensure that the popup menu resets its scroll position to the
top when reopened (Girish Palya).
closes: #17673
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1520: completion: search completion doesn't handle 'smartcase' well
Problem: When using `/` or `?` in command-line mode with 'ignorecase' and
'smartcase' enabled, the completion menu could show items that
don't actually match any text in the buffer due to case mismatches
Solution: Instead of validating menu items only against the user-typed
pattern, the new logic also checks whether the completed item
matches actual buffer content. If needed, it retries the match
using a lowercased version of the candidate, respecting
smartcase semantics.
closes: #17665
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1519: tests: Test_termdebug_decimal_breakpoints() may fail
Problem: Test_termdebug_decimal_breakpoints() fails with List index out
of range, because when adding the second breakpoint, the
cursor is still on the very first line (a header include line)
and therefore gdb refuses to set the breakpoint with:
`msg="No compiled code for line 1 in file XTD_decimal.c"`
Solution: Run the program, so that it will break at the very first
defined breakpoint and then once we are in the program,
set further breakpoints
Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com> Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1513: resizing Vim window causes unexpected internal window width
Problem: resizing Vim window causes unexpected internal window width
(chdiza, after v9.1.1465)
Solution: move the column calculation around (Hirohito Higashi)
fixes: #17657
fixes: #17595
closes: #17668
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1512: completion: can only complete from keyword characters
Problem: completion: can only complete from keyword characters
Solution: remove this restriction, allow completion functions when
called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword
characters (Girish Palya)
Previously, functions specified in the `'complete'` option were
restricted to starting completion only from keyword characters (as
introduced in PR 17065). This change removes that restriction.
With this change, user-defined functions (e.g., `omnifunc`, `userfunc`)
used in `'complete'` can now initiate completion even when triggered
from non-keyword characters. This makes it easier to reuse existing
functions alongside other sources without having to consider whether the
cursor is on a keyword or non-keyword character, or worry about where
the replacement should begin (i.e., the `findstart=1` return value).
The logic for both the “collection” and “filtering” phases now fully
respects each source’s specified start column. This also extends to
fuzzy matching, making completions more predictable.
Internally, this builds on previously merged infrastructure that tracks
per-source metadata. This PR focuses on applying that metadata to
compute the leader string and insertion text appropriately for each
match.
Also, a memory corruption has been fixed in prepare_cpt_compl_funcs().
closes: #17651
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1511: tests: two edit tests change v:testing from 1 to 0
Problem: tests: two edit tests change v:testing from 1 to 0.
Solution: Don't change v:testing in these two tests, since it's already
set to 1 in runtest.vim (zeertzjq).
closes: #17660
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
for :ex command" and instead add the getcompletiontype()
function (Hirohito Higashi).
last `unmap` can cause the error "E31: No such mapping" when
`doaudocmd FileType go` if appending other commands to `b:undo_ftplugin` i.e.
the space and the next bar as `let b:undo_ftplugin .= ' | setl ...'`.
closes: #17664
Signed-off-by: ichizok <gclient.gaap@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Thu, 3 Jul 2025 19:28:50 +0000 (21:28 +0200)]
patch 9.1.1508: string manipulation can be improved in cmdexpand.c
Problem: String manipulation can be improved in cmdexpand.c
Solution: Refactor cmdexpand.c to remove calls to
STRLEN()/STRMOVE()/STRCAT() (John Marriott)
This commit does the following:
In function nextwild():
- slightly refactor the for loop to remove an array access
- call STRLEN() and store it's result for reuse
- move some variables closer to where they are used, renaming some on
the way
In function ExpandOne():
- move some calculations outside of the for loops
- factor out calls to STRCAT() (which has an inherent STRLEN() call) in
the for loop
- move some variables closer to where they are used
In function expand_files_and_dirs():
- factor out calls to STRMOVE() (which has an inherent STRLEN() call)
In function get_filetypecmd_arg():
- move declarations of the string arrays into the blocks where they are
used
In function get_breakadd_arg():
- move declaration of the string array into the block where it is
used
In function globpath():
- factor out calls to STRLEN() and STRCAT()
- move some variables closer to where they are used
And finally some minor cosmetic style changes
closes: #17639
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime(vim): Update base-syntax and generator, match all default highlight groups
- Match Conceal, ComplMatchIns, MsgArea, Terminal, and User[1-9]
highlight groups.
- Generate the vimGroup syntax group from runtime/syncolor.vim.
- Match :SynColor and :SynLink as special user commands.
fixes #17467
closes: #17556
Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1507: symlinks are resolved on :cd commands
Problem: File paths change from symlink to target path after :cd command
when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
When not included (default), symlinks are resolved maintaining
backward compatibility. When included, symlinks are preserved
providing the improved behavior. (glepnir)
related: neovim/neovim#15695
closes: #17628
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1505: not possible to return completion type for :ex command
Problem: not possible to return command-line completion type for :ex
command
Solution: make getcmdcompltype() accept an optional and return the
command-line completion for that arg (Shougo Matsushita).
closes: #17606
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Doug Kearns [Mon, 30 Jun 2025 18:22:38 +0000 (20:22 +0200)]
runtime(vim): Update base-syntax, improve :syn-sync line defaults
Set minlines and maxlines to 100 and 200 respectively. Set these after
the script interface syntax files have been loaded to ensure the values
set in those are overridden.
fixes #17580
closes: #17614
Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Girish Palya [Mon, 30 Jun 2025 18:14:43 +0000 (20:14 +0200)]
patch 9.1.1498: completion: 'complete' funcs behave different to 'omnifunc'
Problem: completion: Functions specified in the 'complete' option did
not have the leader string removed when called with findstart = 0,
unlike 'omnifunc' behavior
Solution: update behaviour and make behaviour consistent (Girish Palya)
closes: #17636
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Foxe Chen [Sun, 29 Jun 2025 16:00:46 +0000 (18:00 +0200)]
patch 9.1.1495: Wayland: uses $XDG_SEAT to determine seat
Problem: Wayland: uses $XDG_SEAT to determine seat to use
(dr0bz, after v9.1.1485)
Solution: Do not try to determine the seat from $XDG_SEAT, remove the
code that checks for this environment variable (Foxe Chen).
Damien Lejay [Sun, 29 Jun 2025 15:50:20 +0000 (17:50 +0200)]
patch 9.1.1494: runtime(tutor): no French translation for Chapter 2
Problem: runtime(tutor): no French translation for Chapter 2
Solution: add and refine French translation of tutor2, update French
vimtutor manpage (Damien Lejay)
- Add runtime/tutor/tutor2.fr.utf-8
- Improve translation based on review
- Update references in tutor1.fr and vimtutor-fr.1
- Adjust MAINTAINERS accordingly
closes: #17546
Co-authored-by: Gabriel Dupras <57042631+gdupras@users.noreply.github.com> Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1492: tests: failure when Wayland compositor fails to start
Problem: tests: failure when Wayland compositor fails to start
Solution: instead of throwing an error causing a failure, throw
"Skipped", so that the Vim test suite continues and does not
fail
Girish Palya [Sat, 28 Jun 2025 17:47:34 +0000 (19:47 +0200)]
patch 9.1.1490: 'wildchar' does not work in search contexts
Problem: 'wildchar' does not work in search contexts
Solution: implement search completion when 'wildchar' is typed
(Girish Palya).
This change enhances Vim's command-line completion by extending
'wildmode' behavior to search pattern contexts, including:
- '/' and '?' search commands
- ':s', ':g', ':v', and ':vim' commands
Completions preserve the exact regex pattern typed by the user,
appending the completed word directly to the original input. This
ensures that all regex elements — such as '<', '^', grouping brackets
'()', wildcards '\*', '.', and other special characters — remain intact
and in their original positions.
---
**Use Case**
While searching (using `/` or `?`) for lines containing a pattern like
`"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by
a trigger key (`wildchar`) to open a **popup completion menu** showing
all matching words.
This offers two key benefits:
1. **Precision**: Select the exact word you're looking for without
typing it fully.
2. **Memory aid**: When you can’t recall a full function or variable
name, typing a few letters helps you visually identify and complete the
correct symbol.
---
**What’s New**
Completion is now supported in the following contexts:
- `/` and `?` search commands
- `:s`, `:g`, `:v`, and `:vimgrep` ex-commands
---
**Design Notes**
- While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have
to use `<CTRL-V><Tab>` or "\t" to search for a literal tab.
- **Responsiveness**: Search remains responsive because it checks for
user input frequently.
---
**Try It Out**
Basic setup using the default `<Tab>` as the completion trigger:
```vim
set wim=noselect,full wop=pum wmnu
```
Now type:
```
/foo<Tab>
```
This opens a completion popup for matches containing "foo".
For matches beginning with "foo" type `/\<foo<Tab>`.
---
**Optional: Autocompletion**
For automatic popup menu completion as you type in search or `:`
commands, include this in your `.vimrc`:
```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged [:/?] CmdComplete()
def CmdComplete()
var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(),
expand('<afile>') == ':']
var trigger_char = '\%(\w\|[*/:.-]\)$'
var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$' # Exclude numeric range
if getchar(1, {number: true}) == 0 # Typehead is empty, no more
pasted input
&& !wildmenumode() && curpos == cmdline->len() + 1
&& (!cmdmode || (cmdline =~ trigger_char && cmdline !~
not_trigger_char))
SkipCmdlineChanged()
feedkeys("\<C-@>", "t")
timer_start(0, (_) => getcmdline()->substitute('\%x00', '',
'ge')->setcmdline()) # Remove <C-@>
endif
enddef
patch 9.1.1489: terminal: no visual highlight of empty cols with empty 'listchars'
Problem: terminal: no visual highlight of empty cols when 'listchars'
is empty (Yousef Mohammed)
Solution: reset wlv.win_attr when column is zero and we are drawing a
terminal buffer
fixes: #17559
closes: #17618
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Hirohito Higashi [Sat, 28 Jun 2025 16:18:21 +0000 (18:18 +0200)]
patch 9.1.1486: documentation issues with Wayland
Problem: documentation issues with Wayland
(after v9.1.1485)
Solution: Tweak documentation style. Capitalize the first letter of
Wayland (Hirohito Higashi)
related: #17619
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Luca Saccarola [Fri, 27 Jun 2025 16:28:17 +0000 (18:28 +0200)]
runtime(netrw): upstream snapshot of v182
relevant commits:
- refactor: cleanup netrw#BrowseX
- fix: correctly handle symlinks in treeview
- chore: add minimalrc for reproducing issues
- refactor: simplify s:NetrwInit with the 'newer' assignment syntax
- refactor: remove balloon functionality
- Tune local file listing especially for Windows network drives
- interim fix for browse open with multiple windows
closes: #17616
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Emir SARI [Thu, 26 Jun 2025 18:38:16 +0000 (20:38 +0200)]
patch 9.1.1483: not possible to translation position in buffer
Problem: not possible to translation position in buffer
Solution: use _() macro to mark the output as translatable
(Emir SARI)
Row/Column indicator separator is currently not customizable. Some
languages have a space after the comma as the usual practice, plus this
would help translators use a custom separator like colons if necessary.
Additionally, after a save, the line and the byte indicator is also
hardcoded, this enables i18n for that as well.
closes: #17608
Signed-off-by: Emir SARI <emir_sari@icloud.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Luuk van Baal [Thu, 26 Jun 2025 18:34:15 +0000 (20:34 +0200)]
patch 9.1.1482: scrolling with 'splitkeep' and line()
Problem: Topline is preemptively updated by line() in WinResized
autocmd with 'splitkeep' != "cursor".
Solution: Set `skip_update_topline` when 'splitkeep' != "cursor".
(Luuk van Baal)
related: neovim/neovim#34666
closes: #17613
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
mityu [Wed, 25 Jun 2025 18:46:34 +0000 (20:46 +0200)]
runtime(doc): improve documentation style in editing.txt
Usually, Vim's document provides example code after explanations.
However some part of the editing.txt doesn't follow the style, therefore
this commit modifies it so that it follows the usual style.
Emir SARI [Wed, 25 Jun 2025 18:22:43 +0000 (20:22 +0200)]
patch 9.1.1479: regression when displaying localized percentage position
Problem: regression when displaying localized percentage position
(after v9.1.1291)
Solution: calculate percentage first (Emir SARI)
Cleanups made in ec032de broke the Turkish percent display, failing to
prepend it properly in cases between 0 and 10. In Turkish, the percent
sign is prepended to the number, so it was displaying it as `% 5`
(should have been `%5`), while displaying numbers bigger than 9 properly.
related: #17597
Signed-off-by: Emir SARI <emir_sari@icloud.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Aliaksei Budavei [Mon, 23 Jun 2025 18:02:14 +0000 (20:02 +0200)]
runtime(java): Complement the recognition of type parameter sections
In addition to matching type parameter sections of generic
classes and records and interfaces, match such sections of
generic methods and constructors. As before, opt for it by
defining "g:java_highlight_generics"; the diamond form still
does not qualify for this kind of recognition.
And make section patterns agree with one another in syntax
items.
This commit does the following:
- in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT()
- in expand_cmdline() move check for out-of-memory to cover both
assignments of file_str
- in nextwild() don't free `p2` until after it's last use.
closes: #17592
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
Mark Woods [Sun, 22 Jun 2025 18:16:29 +0000 (20:16 +0200)]
runtime(comment): add <Plug>-mappings
vim9script <expr> mappings relying on imports cannot be evaluated
outside of the script file with the imports, so do not work with plugins
like vim-which-key, which evaluates <expr> mappings to apply them.
Using <Plug> mappings is one way to address this, and has the added
benefit of reading like a description for users finding the mappings.
fixes: #17523
closes: #17563
Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Mark Woods [Sun, 22 Jun 2025 18:12:16 +0000 (20:12 +0200)]
runtime(openPlugin): add <Plug>-mappings
vim9script <scriptcmd> mappings relying on imports cannot be evaluated
outside of the script file with the imports, so do not work with plugins
like vim-which-key, which applies the mappings using feedkeys().
Using <Plug> mappings is one way to address this, and has the added
benefit of reading like a description for users finding the mappings.
related: #17563
Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>