Commit Graph

37082 Commits

Author SHA1 Message Date
Barrett Ruth
daa229bfde fix(dir): restore loaded plugin guard #40528 2026-07-01 14:45:55 -04:00
Justin M. Keyes
12ea9735f7 refactor(path): path_skip_sep() #40524
Problem:
Redundant code.

Solution:
Add path_skip_sep() and use it.

Dropping MB_PTR_ADV is safe: the loops only advance while `*p` is
a one-byte separator (`/`, `\`, `:`). MB_PTR_ADV was needed in legacy
Vim because it supported non-UTF-8 (DBCS) *internal* encodings.
2026-07-01 09:48:54 -04:00
tao
fa9b3381bc feat(path): fnamemodify(':h') preserves logical root #40447
Problem:
On Windows, `fnamemodify('//foo/C$', ':h')` incorrectly removes `C$`
as a regular file name and returns `//foo`. However, this is a valid
UNC path, `foo` is a server name and `C$` is a share name.
The correct result should be `//foo/C$`.

Solution:
Extend `os_fileinfo2` and `FileInfo` with `prefix_off`, `rest_off` to
identify path types and logical root boundaries. ':h' can use this info
to prevent traversing past the logical root.

Examples:
  /foo               => /
  //foo              => // (POSIX)
  //foo/bar          => //foo (POSIX)
  //server/share/foo => //server/share/ (Windows)
  C:/foo             => C:/
  //?/C:/foo         => //?/C:/

Co-authored-by: Barrett Ruth <br@barrettruth.com>
2026-07-01 08:25:21 -04:00
Justin M. Keyes
05d7040425 Merge #40516 from justinmk/health 2026-07-01 07:45:47 -04:00
Justin M. Keyes
ed9a1c0b15 fix(health): handle failed dir listing 2026-07-01 13:27:07 +02:00
Justin M. Keyes
34efdadb4e feat(health): report ulimit info
Problem:
Nvim shows `(libuv) kqueue(): Too many open files` on macos.
ref https://github.com/neovim/neovim/issues/40238

Solution:
Add a healthcheck for this situation.
2026-07-01 13:26:21 +02:00
Justin M. Keyes
d253acca35 Merge #40114 feat(vim.fs): dir(), find() error-reporting 2026-07-01 07:18:08 -04:00
Justin M. Keyes
1035a9fb5d refactor(dir): use vim.fs.dir() 2026-07-01 13:01:02 +02:00
Justin M. Keyes
971a0a0fe0 feat(vim.fs): dir() ergonomics 2026-07-01 13:00:06 +02:00
Justin M. Keyes
f141916e3d fix(vim.fs): dir(), find() error-reporting 2026-07-01 12:05:41 +02:00
Rudrajeet Pal
4e04dff228 feat(vim.fs): dir(), find() error-reporting
Problem:
vim.fs.dir() and vim.fs.find() drop errors returned by uv.fs_scandir().

Solution:
- vim.fs.dir():
  - Return root scan failures as a secondary return value.
  - Propagate recursive scan failures through the iterator. This allows
    callers to distinguish unreadable directories from empty ones.

- vim.fs.find(): Collect errors during search, and return the list as
  a second retval.
2026-07-01 12:05:41 +02:00
zeertzjq
0d81f257af Merge pull request #40523 from zeertzjq/vim-9.1.1540
vim-patch:9.1.{1540,1542}
2026-07-01 17:50:33 +08:00
zeertzjq
3fd0ed3176 vim-patch:9.1.1542: Coverity complains about uninitialized variable
Problem:  Coverity complains about uninitialized variable
          (Tony Mechelynck)
Solution: Initialize variables

closes: vim/vim#17717

6865bdc914

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-07-01 17:32:08 +08:00
zeertzjq
020bc95cd2 vim-patch:9.1.1540: completion: menu state wrong on interruption
Problem:  completion: menu state wrong on interruption
          (Maxim Kim)
Solution: Call show_pum() if completion was interrupted
          (Girish Palya).

Popup menu was not built after fuzzy sorting, so internal state wasn't
reflected on screen.

No test. Couldn't get the terminal test to trigger both interruption and
refresh together.

fixes: vim/vim#17725
closes: vim/vim#17736

f6a308c65b

Co-authored-by: Girish Palya <girishji@gmail.com>
2026-07-01 17:11:32 +08:00
Francisco Requena
8a845104c8 feat(treesitter): conceal backslash in markdown inline highlights #40495
Problem:
Markdown inline backslash escapes display visually.

Solution:
Use `@conceal` queries to hide the backslash.
2026-07-01 04:03:31 -04:00
zeertzjq
c040f53dc1 vim-patch:9.2.0756: Session with multiple tabpages sets 'winminheight' to 0 (#40512)
Problem:  Session with multiple tabpages sets 'winminheight' to 0.
Solution: Only save 'winminheight' and 'winminwidth' once (zeertzjq).

related: vim/vim#8119
related: neovim/neovim#40493
closes: vim/vim#20673

294dec827d
2026-07-01 07:10:04 +08:00
zeertzjq
3fea2a7fc5 vim-patch:9.2.0754: repeated completion length lookup in search_for_exact_line (#40511)
Problem:  search_for_exact_line() repeatedly calls ins_compl_len() and
          relies on ternary operator precedence.
Solution: Cache the completion length and parenthesize the ternary
          expression.

closes: vim/vim#20678

ac443b9924

Co-authored-by: glepnir <glephunter@gmail.com>
2026-06-30 23:08:58 +00:00
jdrouhard
b19962e827 fix(lsp): request semantic tokens in BufWinEnter (#40510)
Problem: A previous refactor removed the BufWinEnter autocmd that
initiated a token request. When an LSP server sends a refresh
notification, then buffers that aren't shown in any window lost their
only trigger to request new tokens.

Solution: Add the BufWinEnter autocmd back which simply requests tokens
for all clients attached to the buffer.
2026-06-30 14:35:07 -07:00
Justin M. Keyes
f46857d1df refactor(os): deduplicate console/fd boilerplate #40509
Problem:
Scattered, redundant boilerplate for Windows console/fd plumbing.

Solution:
- Add os_dup_cloexec()
- Add os_reattach_console_stdio().
- Use os_open_conin_fd().
2026-06-30 15:31:35 -04:00
Barrett Ruth
4f1a05da7b fix(dir): use nvim.dir augroup #40507 2026-06-30 14:58:58 -04:00
Barrett Ruth
784ab9edfb fix(dir): reload listing on :edit #40496 2026-06-30 14:19:53 -04:00
Justin M. Keyes
d303617132 refactor(os): libuv_proc_stdio #40506 2026-06-30 13:29:19 -04:00
dependabot[bot]
b532180108 ci: bump actions/cache
Bumps the github-actions group with 1 update in the /.github/actions/cache directory: [actions/cache](https://github.com/actions/cache).


Updates `actions/cache` from 5.0.4 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5.0.4...v6.1.0)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-30 15:32:18 +02:00
zeertzjq
dbfa85b1fa test(old): unskip Test_mode_changes() #40490 2026-06-30 08:01:52 -04:00
zeertzjq
6c5f0cf29f fix(cmdwin): handle control characters properly #40488
- Replace newlines in the current cmdline with NULs when opening cmdwin,
  and do the reverse when putting a cmdwin line back into the cmdline.
- Escape control characters with Ctrl-V when feeding cmdline.
2026-06-30 08:00:31 -04:00
zeertzjq
f89972e13a fix(options): crash when setting option to empty dict #40492 2026-06-30 07:58:46 -04:00
Barrett Ruth
1b959ba485 fix(dir): remove loaded plugin guard #40489 2026-06-30 07:54:36 -04:00
github-actions[bot]
ab4e9683f5 docs: update version.c #40444
vim-patch:9.2.0516: socketserver: spurious error when servername is taken
vim-patch:9.2.0615: sixel encoder drops pixels on the right edge of shapes
vim-patch:9.2.0637: sixel: anti-aliased RGBA images render with visible outline
vim-patch:9.2.0692: GTK2: build failure, popup images not drawn correctly
vim-patch:9.2.0727: popup images not rendered correctly when unfocused
vim-patch:9.2.0730: GTK4 GUI tabline is not updated
vim-patch:9.2.0731: GTK4 GUI scrollbar size not updated when restoring a session
vim-patch:9.2.0733: GTK3: GUI slow on X11 since dropping the alpha channel
vim-patch:9.2.0737: tests: comment test can be improved
vim-patch:e876e256f CI: Bump actions/checkout in the github-actions group across 1 directory
vim-patch:9.2.0740: GTK4: scrollbar wrongly displayed
vim-patch:c0fc51184 CI: MS-Windows: Run gvim/vim tests in parallel
vim-patch:9.2.0744: popup_atcursor() closes immediately on white space
vim-patch:9.2.0746: NULL pointer dereference in gui_photon
vim-patch:9.2.0747: cscope: connection leak when growing the array fails
vim-patch:9.2.0751: GTK3 GUI is slow under Wayland
2026-06-30 06:48:09 -04:00
zeertzjq
aa3823cca3 test(editor/cmdwin_spec): check that Ctrl-C puts line in cmdline (#40487) 2026-06-30 07:35:08 +08:00
zeertzjq
d3509eac6a vim-patch:3fa4da4: runtime: add missing fnameescape()/shellescape() in a few runtime files (#40486)
ping @jamessan for the debugchangelog change.

3fa4da4acb

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-06-30 06:58:18 +08:00
Justin M. Keyes
62c0984647 Merge #40484 from justinmk/cmdwinchaos 2026-06-29 17:57:49 -04:00
Christian Clason
5c245bd427 build(deps): bump wasmtime to v36.0.12 2026-06-29 23:35:22 +02:00
Christian Clason
d3046f5703 build(deps): bump tree-sitter to ae2081989 2026-06-29 23:35:22 +02:00
Justin M. Keyes
684371ba5d fix(cmdwin): handle split/tabpage
Problem:
- If cmdwin window is split, ENTER in one does not close the others.
- If cmdwin is put into a different tabpage via <c-w>T, it stops working
  (ENTER does not execute the cmd).

Solution:
- Close the buffer instead of the window.
- In the WinClosed handler, skip `M._cleanup()` unless this is the last
  cmdwin window.
2026-06-29 23:22:52 +02:00
Justin M. Keyes
2a4bb3eb37 feat(cmdwin): allow tabpage actions 2026-06-29 22:38:29 +02:00
Justin M. Keyes
5256685661 feat(cmdwin): drop CHECK_CMDWIN
Allow window navigation/creation even while cmdwin is alive! 😱
2026-06-29 22:38:29 +02:00
akiyosi
d6a1b4110a feat(terminal): try to find newer conpty.dll on Windows #40328
The system version of ConPTY in kernel32.dll is old and will
mangle some VT sequences sent by shells. Newer versions of ConPTY
available as part of the Windows Terminal project fix this by
passing through VT sequences unmodified when the terminal has set
ENABLE_VIRTUAL_TERMINAL_INPUT. This change allows users to fix
buggy behaviour of Neovim's terminal on Windows by copying
conpty.dll to Neovim's bin directory.

Co-authored-by: Scott Young <s@sjy.au>
2026-06-29 14:46:23 -04:00
glepnir
7312df77bb fix(api): nvim_buf_set_text resets changelist to 0 #39965
Problem: changed_lines got a hardcoded 0, so the changelist entry
and '. mark always recorded column 0 instead of where the edit
actually happened.

Solution: pass start_col instead. changelist now tracks the real
column.
2026-06-29 14:38:07 -04:00
bfredl
b22a8e2f00 Merge pull request #40475 from bfredl/vim.NIL
fix(lua): give nicer error message when trying to index vim.NIL
2026-06-29 19:28:52 +02:00
Justin M. Keyes
d2073d2eec refactor: cleanup, docs #40480 2026-06-29 13:10:31 -04:00
Nathan Zeng
845b66dd4a feat(:restart)!: ":restart" (no bang) saves/restores session #40321
Problem:
`:restart` does not preserve window layout, etc.

Solution:
- Change `:restart` to save/restore a session automatically.
- Introduce "bang" variant `:restart!` to restart *without* session
  save/restore.
- Introduce `v:startreason`.
- `ZR` maps to `:restart!`.
2026-06-29 10:55:23 -04:00
Sanzhar Kuandyk
39e9c1754a fix(process): avoid inherited stdio for Windows jobs #40074
Problem:
On Windows, channel jobs inherit Nvim's stdio, so a background job
writing to CON (e.g. gutentags) draws onto the TUI and stays until
redraw.

Solution:
Give Windows job stdin/stderr libuv-created pipes (UV_CREATE_PIPE)
instead of inherited fds, so libuv spawns the child with
CREATE_NO_WINDOW and CON writes no longer leak onto the TUI.
2026-06-29 10:52:19 -04:00
Justin M. Keyes
06fd0d1e45 refactor(test): dedup benchmark utils #40478 2026-06-29 10:36:36 -04:00
Justin M. Keyes
559730af0a perf(options): avoid Lua<=>API roundtrips #40477
Problem:
- Lua<=>API roundtrips
- Although we prefer Lua for most business-logic code, doing this
  conversion in C makes sense in this case because:
  1. setting options is a hot path
  2. most of the options logic lives in C
  3. the current arrangement is MORE verbose and requires MORE code

Solution:
Move conversion to a C util.
- nvim_set_option_value passes the raw Object (scalar, Array, or Dict)
  to `object_as_optval_for()` which flattens it to the canonical `:set`
  string and validates the type.
- drop `convert_value_to_vim`, eliminate its roundtrip.
2026-06-29 10:00:36 -04:00
dependabot[bot]
96762cffcd ci: bump zizmorcore/zizmor-action
Bumps the github-actions group with 1 update in the / directory: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `zizmorcore/zizmor-action` from 0.5.6 to 0.5.7
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](5f14fd08f7...192e21d79a)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 15:13:14 +02:00
bfredl
71b28da0f4 fix(lua): give nicer error message when trying to index vim.NIL
The added test shows the context, one expected a JSON field
to be a Object but it was a null value

pros: shows `vim.NIL` instead of `a userdata`
cons: the context `field 'foo'` is lost. I think this is generated
with internal magic which is hard to replicate.
2026-06-29 14:20:09 +02:00
Christian Clason
c6dd97cc64 build(deps): bump luajit to a2bde6081 2026-06-29 14:03:35 +02:00
zeertzjq
7945732ed7 Merge pull request #40472 from zeertzjq/vim-1f33732
vim-patch: ftplugin recommended style
2026-06-29 09:21:54 +08:00
zeertzjq
07c37f6645 vim-patch:1f33732: runtime: guard recommended style settings consistently
Normalize the 15 existing guards to the documented two-level form
get(g:, 'X_recommended_style', get(g:, 'filetype_recommended_style', 1)):
fix the two non-standard "!exists() || != 0" guards (python, arduino) and
tolk's wrong fallback variable, and convert the simple one-level guards.

Add the guard to filetype plugins that set stylistic indentation/format
options without one: aap, abap, ada, cabal, cobol, elixir, falcon,
graphql, heex, idris2, mermaid, occam, racket, scala, swift, tera.

Settings that are required rather than stylistic are left untouched, e.g.
make/gomod/scdoc (mandatory tabs), chatito and vroom (indent mandated by
the format), and the textwidth/formatoptions cases in gitcommit/help/
jjdescription.

Supported by AI.

fixes:  vim/vim#20036
closes: vim/vim#20650

1f33732613

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 08:47:54 +08:00
zeertzjq
0c828415dd vim-patch:e99b4d0: runtime(doc): Document ft_recommended_style
related: vim/vim#20036

e99b4d0214

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-06-29 08:47:54 +08:00