33743 Commits

Author SHA1 Message Date
zeertzjq
049de6f119 vim-patch:partial:308a313: runtime(doc): Update help for the items() function
closes: vim/vim#18021

308a3130be

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-21 08:44:07 +08:00
Tiago Inaba
848c7a7894 fix(lsp): update window title when cycling through signatures #35407 2025-08-20 11:09:16 -07:00
github-actions[bot]
cd2d5de1f9 docs: update version.c #35201
vim-patch:8.1.1555: NOT_IN_POPUP_WINDOW is confusing
vim-patch:8.1.1586: error number used in two places
vim-patch:8.1.1599: compiler warning for uninitialized variable
vim-patch:8.1.1603: crash when using unknown highlighting in text property
vim-patch:8.1.1655: popup window border drawn wrong with multi-byte char
vim-patch:8.1.1675: listener list not correctly updated on listener_remove()
vim-patch:8.1.1710: Coverity found dead code
vim-patch:8.1.1844: buffer no longer unloaded when adding text properties
vim-patch:8.1.2071: when 'wincolor' is set text property changes highlighting
vim-patch:8.1.2211: listener callback "added" argument is not the total
vim-patch:8.1.2215: unreachable code in adjusting text prop columns
vim-patch:8.1.2216: text property in wrong place after :substitute
vim-patch:8.1.2298: missing part of 8.1.2296
vim-patch:8.1.2308: deleting text before zero-width textprop removes it
vim-patch:8.1.2369: cannot build with quickfix and without text properties


vim-patch:8.2.0124: compiler warnings for variable types
vim-patch:8.2.0126: textprop test fails
vim-patch:8.2.0967: unnecessary type casts for vim_strnsave()
vim-patch:8.2.1670: a couple of gcc compiler warnings
vim-patch:8.2.2429: :goto does not work correctly with text properties
vim-patch:8.2.2890: text property duplicated when data block splits
vim-patch:8.2.3062: internal error when adding several text properties
vim-patch:8.2.3372: line2byte() value wrong when adding a text property
vim-patch:8.2.3483: #ifdef for using sysinfo() is incomplete
vim-patch:8.2.4043: using int for second argument of ga_init2()
vim-patch:8.2.4144: cannot load libsodium dynamically
vim-patch:8.2.4960: text properties that cross lines not updated for deleted line
vim-patch:8.2.4961: build error with a certain combination of features
vim-patch:8.2.5014: byte offsets are wrong when using text properties
vim-patch:8.2.5041: cannot close a terminal popup with "NONE" job

vim-patch:9.0.0169: insufficient testing for line2byte() with text properties
vim-patch:9.0.0181: textprop test with line2byte() fails on MS-Windows


vim-patch:9.1.0633: Compilation warnings with `-Wunused-parameter`
vim-patch:9.1.0957: MS-Windows: conversion warnings
2025-08-20 09:43:26 -07:00
luukvbaal
61b6553ee9 fix(ui): proper event ordering for nested cmdline_block events (#35344)
Problem:  Wrong event order for nested cmdline in a conditional cmdline_block.
Solution: Emit all but the first cmdline_block event immediately after
          getting the next command, before executing it.
2025-08-20 15:02:55 +02:00
bfredl
4a1295c626 Merge pull request #34186 from bfredl/neotags
build: generate helptags without running "nvim" binary
2025-08-20 09:10:02 +02:00
zeertzjq
27bc7dcb01 Merge pull request #35399 from zeertzjq/vim-9.1.1647
vim-patch: runtime file updates
2025-08-20 08:09:14 +08:00
zeertzjq
3d511833ae vim-patch:2f7e4eb: runtime(python): optimize pythonSync pattern
Order the keywords by expected frequency: "def" and "class" are assumed
to be more likely than "async def" in the majority of Python code.

closes: vim/vim#18032

2f7e4eb335

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-20 07:24:35 +08:00
zeertzjq
ba25f3e4d4 vim-patch:9.1.1647: filetype: Cangjie files are not recognized
Problem:  filetype: Cangjie files are not recognized
Solution: Detect *.cj files as cangjie filetype, include a syntax plugin
          (WuJunkai2004)

This commit introduces a new syntax highlighting file for the Cangjie
programming language, includes 4 parts as required:
- The main syntax file: runtime/syntax/cangjie.vim
- The filetype detection rule in: runtime/filetype.vim
- The documentation update in: runtime/doc/syntax.txt
- Some menus

References:
- https://gitcode.com/Cangjie
- https://cangjie-lang.cn/

fixes: 18014
closes: vim/vim#18027

0c4405a6b2

Co-authored-by: WuJunkai2004 <wujunkai20041123@outlook.com>
2025-08-20 07:23:49 +08:00
Sean Dewar
3ec63cdab8 fix(treesitter): run FileType autocmds in the context of <abuf>
Problem: many FileType autocommands assume curbuf is the same as the target
buffer; this can cause &syntax to be restored for the wrong buffer in some cases
when TSHighlighter:destroy is called.

Solution: run nvim_exec_autocmds in the context of the target buffer via
nvim_buf_call.
2025-08-19 20:03:05 +01:00
TheBlob42
701258921e feat(snippet): highlight active tabstop (#35378) 2025-08-19 06:21:32 -07:00
bfredl
6b936002cc build: make build.zig generate helptags without running "nvim" binary
This is matters for cross-compiling where we might not
be able to run the "nvim" binary on the host.

Instead reimplement the helptags extractor as a small
lua script, which we can run on the host using the nlua0
helper already used for other generator scripts.
2025-08-19 11:14:02 +02:00
zeertzjq
25bc41847e vim-patch:9.1.1649: attrs allocation and fuzzy growarray could leak (#35383)
Problem:  attrs allocation and fuzzy growarray could leak on early
          returns
Solution: Ensure proper cleanup of allocated memory on exit paths
          (glepnir)

closes: vim/vim#18038

c7c10f8c11

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-19 08:45:15 +08:00
ite-usagi
1e20f31aa3 docs(tutor): update Japanese tutor #35379 2025-08-18 10:46:56 -07:00
ite-usagi
ddae46fba0 docs(l10n): building translation file #35380 2025-08-18 08:06:21 -07:00
Justin M. Keyes
1b2a6e0664 Merge #35018 refactor(lsp): centralized enable/is_enabled strategy 2025-08-18 10:57:57 -04:00
Yi Ming
f40162ba19 refactor(lsp): use vim.lsp._capability.enable internally 2025-08-18 19:41:55 +08:00
Yi Ming
050b04384e refactor(lsp): correct enable marker name 2025-08-18 19:41:55 +08:00
Yi Ming
2ace4089f8 refactor(lsp): no longer rely on LspDetach for detaching capabilities 2025-08-18 19:41:55 +08:00
Yi Ming
b3fbc8d6fa refactor(lsp): move util.enable to capability.enable 2025-08-18 19:41:53 +08:00
zeertzjq
052126b77a test(tui_spec): avoid race between server exit and new client (#35376)
Don't start a new client to check for server exit. Check for the server
socket being removed instead.
2025-08-18 15:24:22 +08:00
zeertzjq
f363ea8547 test(tui_spec): fix another case of flakiness (#35374) 2025-08-18 12:53:40 +08:00
Justin M. Keyes
960b33a9d8 docs: misc, dev-api-fast, $XDG_STATE_HOME #35138 2025-08-17 20:45:40 -07:00
Siddhant Agarwal
1d40f67776 feat(ssh): SSH configuration parser #35027 2025-08-17 20:40:28 -07:00
zeertzjq
37119ad0d2 vim-patch:9.1.1645: fuzzy.c can be further improved (#35371)
Problem:  fuzzy.c can be further improved
Solution: Fix memory leak and refactor it (glepnir).

Optimize performance and memory allocation:

- Fix memory leak in fuzzy_match_in_list.
- using single memory allocation in match_positions
- Improve has_match performance and add null pointer checks

closes: vim/vim#18012

59799f3afa

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-18 11:03:08 +08:00
zeertzjq
e4d3812c8b Merge pull request #35370 from zeertzjq/excmd
:connect fixes
2025-08-18 09:43:34 +08:00
zeertzjq
c1f142322b fix(excmd): correct :connect abbreviation 2025-08-18 09:22:42 +08:00
zeertzjq
f5cbf11644 fix(client): avoid :connect race with server detach
Also fix some warnings and flakiness in :restart/:connect tests.
2025-08-18 09:22:41 +08:00
Sean Dewar
2211953266 fix(api): on_detach consistently before buf_freeall autocmds
Problem: on_detach may be called after buf_freeall and other important things,
plus its textlock restrictions are insufficient. This can cause issues such as
leaks, internal errors and crashes.

Solution: disable buffer updates in buf_freeall, before autocommands (like the
order after #35355 and when do_ecmd reloads a buffer). Don't do so in
free_buffer_stuff; it's not safe to run user code there, and buf_freeall already
runs before then; just free them to avoid leaks if buf_freeall autocommands
registered more for some reason.

Fixes #28084
Fixes #33967
Fixes #35116
2025-08-17 22:32:53 +01:00
Justin M. Keyes
d8ed43c6a7 Merge #35109 vim.pos, vim.range 2025-08-17 16:37:56 -04:00
Corey Cole
4299837b44 docs(windows): WSL build instructions #35365 2025-08-17 13:07:03 -07:00
Justin M. Keyes
7eb9badd93 refactor(tests): remove redundant test #35364 2025-08-17 12:11:13 -07:00
Jaehwang Jung
285c04e2d0 fix(api,lsp): call on_detach before wiping out the buffer #35355
Problem:
Buffer-updates on_detach callback is invoked before buf_freeall(), which
deletes autocmds of the buffer (via apply_autocmds(EVENT_BUFWIPEOUT,
...)). Due to this, buffer-local autocmds executed in on_detach (e.g.,
LspDetach) are not actually invoked.

Solution:
Call buf_updates_unload() before buf_freeall().
2025-08-17 11:37:24 -07:00
zeertzjq
35a7642647 vim-patch:3cee950: runtime(diff): fix mixed translations in zh_CN (#35362)
some translations confused zh_CN and zh_TW

3cee950fc9

Co-authored-by: 毛逸宁 <mao.yining@outlook.com>
2025-08-17 18:33:29 +08:00
Yi Ming
a37e101dc7 refactor(lsp): change capability name to snake case 2025-08-17 12:37:34 +08:00
Yi Ming
7c3e579a90 refactor(lsp): register all derived Capability prototypes 2025-08-17 12:37:34 +08:00
Yi Ming
81d8198bda refactor(lsp): define Capability.on_attach 2025-08-17 12:37:34 +08:00
Yi Ming
a7fef170b7 refactor(lsp): check supported methods instead of tbl_get 2025-08-17 12:37:34 +08:00
Yi Ming
9f5b309d82 feat(lua): conversion between vim and lsp position/range 2025-08-17 12:13:24 +08:00
Yi Ming
98f8224c19 feat(lua): vim.pos/vim.range 2025-08-17 11:54:53 +08:00
zeertzjq
7e450aa383 vim-patch:b405c79: runtime(vim): set 'comments' based on script type (legacy/Vim9) (#35359)
fixes: vim/vim#18000

b405c79004

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-17 01:26:37 +00:00
zeertzjq
577f9fa1be vim-patch:9.1.1640: Unicode has deprecated some code-points (#35358)
Problem:  Unicode has deprecated some code-points
Solution: Update the digraph tables to align with the Unicode v16
          release (David Friant)

This commit updates the digraphs Left-Pointing Angle Bracket '</'
and Right-Pointing Angle Bracket '/>' to account for the fact that
the old Unicode codepoints for them (2329 and 232A, respectively)
have been deprecated. As per the Miscellaneous Technical code chart
(https://www.unicode.org/charts/PDF/U2300.pdf), the old digraphs
have been reassigned to the CJK Left Angle Bracket and Right Angle
Bracket (3008 and 3009) with their declaration moved to the
appropriate block.

This commit also introduces the new digraphs '<[' and ']>' to
represent the Mathematical Left Angle Bracket and Mathematical
Right Angle Bracket (27E8 and 27E9) to replace the deprecated code
points in the Technical block.

Tests have been added and, I believe, the documentation has been
updated accordingly.

closes: vim/vim#17990

c08b94b072

Co-authored-by: David Friant <friant@HPEnvyx360.friant.dev>
2025-08-17 08:52:05 +08:00
Michael Henry
5f8d4a248a feat(provider): detect venv python via "pynvim-python" tool #35273
Problem:
Detection of the pynvim module is currently done by finding the first
Python interpreter in the `PATH` and checking if it can import pynvim.
This has several problems:
- Activation of an unrelated Python virtual environment will break
  automatic detection, unless pynvim is also installed in that
  environment.
- Installing pynvim to the expected location is difficult. User
  installation into the system-wide or user-wide Python site area is now
  deprecated.  On Ubuntu 24.04 with Python 3.12, for example, the
  command `pip install --user pynvim` now fails with the error message
  `error: externally-managed-environment`.
- Users may create a dedicated virtual environment in which to install
  pynvim, but Nvim won't detect it; instead, they must either activate
  it before launching Nvim (which interferes with the user of other
  virtual environments) or else hard-code the variable
  `g:python3_host_prog` in their `init.vim` to the path of the correct
  Python interpreter.  Neither option is desirable.

Solution:
Expose pynvim's Python interpreter on the `PATH` under the
name `pynvim-python`.  Typical user-flow:

1. User installs either uv or pipx.
2. User installs pynvim via:
   ```
   uv tool install --upgrade pynvim
   # Or:
   pipx install --upgrade pynvim
   ```

With corresponding changes in pynvim https://github.com/neovim/pynvim/issues/593
the above user-flow is all that's needed for Nvim to detect the
installed location of pynvim, even if an unrelated Python virtual
environments is activated.  It uses standard Python tooling to automate
the necessary creation of a Python virtual environment for pyenv and the
publication of `pynvim-python` to a directory on `PATH`.
2025-08-16 14:48:08 -07:00
MinimalEffort07
77860f5418 build(deps): CMake generation fails when path contains spaces #35332
Problem:
Additional include directories in DEPS_INCLUDE_FLAGS variable are not
quoted. Paths with spaces break the resulting compile command.

Solution:
Enclose values in double quotes.
Note: normally we should avoid manual quoting, but in this case we can't
because of how `DEPS_INCLUDE_FLAGS` is used in `BuildLuv.cmake`
and `BuildLpeg.cmake`.
2025-08-16 12:25:34 -07:00
zeertzjq
013af17ed9 vim-patch:9.1.1623: Buffer menu does not handle unicode names correctly (#35353)
Problem:  Buffer menu does not handle unicode names correctly
          (after v9.1.1622)
Solution: Fix the BMHash() function (Yee Cheng Chin)

The Buffers menu uses a BMHash() function to generate a sortable number
to be used for the menu index. It used a naive (and incorrect) way of
encoding multiple ASCII values into a single integer, but assumes each
character to be only in the ASCII 32-96 range. This means if we use
non-ASCII file names (e.g. Unicode values like CJK or emojis) we get
integer underflow and overflow, causing the menu index to wrap around.
Vim's GUI implementations internally use a signed 32-bit integer for the
`gui_mch_add_menu_item()` function and so we need to make sure the menu
index is in the (0, 2^31-1) range.

To do this, if the file name starts with a non-ASCII value, we just use
the first character's value and set the high bit so it sorts after the
other ASCII ones. Otherwise, we just take the first 5 characters, and
use 5 bit for each character to encode a 30-bit number that can be
sorted.

This means Unicode file names won't be sorted beyond the first
character. This is likely going to be fine as there are lots of ways to
query buffers.

related: vim/vim#17403
closes: vim/vim#17928

8f9de4991e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-16 13:20:36 +08:00
bfredl
c12701d4e1 Merge pull request #35329 from bfredl/uncrustify_all
fix(build): also check os_win sources with uncrustify in CI
2025-08-15 11:06:42 +02:00
zeertzjq
8d154e5927 vim-patch:9.1.1633: Search pattern shown incorrectly with negative offset (#35337)
Problem:  Search pattern shown incorrectly with negative offset.
          (lkintact)
Solution: Don't prepend a '+' sign to a negative offset (zeertzjq).

fixes: vim/vim#17993
closes: vim/vim#17994

ade0815856
2025-08-15 00:06:32 +00:00
zeertzjq
7afcfb6c9a vim-patch:9.1.1632: memory leak in fuzzy.c
Problem:  memory leak in fuzzy.c
Solution: Free fuzmatch, add a few minor refactors
          (glepnir)

fixes neovim CID 584055: fuzmatch leak when count becomes 0
Fix partial allocation failure cleanup in buffer expansion

closes: vim/vim#17996

03d6e06edd

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-15 07:17:24 +08:00
zeertzjq
e38e65b86c vim-patch:9.1.1630: tests: fuzzy bufname completion test doesn't match successfully
Problem:  tests: fuzzy buffer name completion test doesn't match
          successfully (after 9.1.1627).
Solution: Update pattern to account for the change in case sensitivity.
          Also mark Test_search_stat_option() as flaky as it can still
          sometimes fail (zeertzjq).

closes: vim/vim#17992

891353671a
2025-08-15 07:17:24 +08:00
Gregory Anders
218ff601c4 fix(tui): do not emit resize screen sequence after host terminal is resized (#35335)
Some terminals support the CSI 8 t sequence to resize their own window
area. Neovim will emit this sequence when the TUI is resized
programatically, but it should not be emitted when the TUI is resized
because the host terminal was resized, as that results in an infinite
resize loop.
2025-08-14 18:14:26 -05:00
Siddhant Agarwal
649bb372f6 feat(ui): :connect command #34586
Add the `:connect <address>` command which connects the currently
running TUI to the server at the given address.
2025-08-14 15:58:09 -07:00