Commit Graph

33613 Commits

Author SHA1 Message Date
Evgeni Chasnovski
1ffaaa06c5 docs(pack): document $XDG_DATA_HOME/nvim/site presence in 'packpath'
Problem: Some use cases might lead to `vim.pack.add()` failing to
`:packadd` a plugin because of missing entry in 'packpath'. Like with
`nvim --clean` or manually setting `$XDG_DATA_HOME` during startup.

Solution: Document it. A more proactive approach can be ensuring correct
'packpath' entry, but it is currently somewhat verbose to do (due to
having to adjust for Windows using `\` in 'packpath' entries).
2025-08-22 13:41:36 +03:00
Evgeni Chasnovski
7acfad226d test(pack): simplify tests for data field 2025-08-22 13:32:11 +03:00
Evgeni Chasnovski
92e7d5eaf2 perf(pack): reduce number of 'opt/' directory computations 2025-08-22 13:00:30 +03:00
tao
d73cfefed5 fix(folds): error when deleting lines at end of buffer #35396
Problem:
with `foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr()
foldminlines=0`, deleting lines at the end of the buffer always
reports an invalid top error, because the top value (i.e. the
start line number of the deletion) is always 1 greater than
the total line number of the modified buffer.

Solution:
remove the ml_line_count validation
2025-08-21 19:55:45 -07:00
zeertzjq
12b6f65283 vim-patch:014d50d: runtime(systemverilog): Add syntax highlighting for 1800-2023 block strings (#35425)
closes: vim/vim#18056

014d50df80

Co-authored-by: Ayan Banerjee <ayanbanrj@gmail.com>
2025-08-22 09:26:47 +08:00
Igor Lacerda
8e48c02061 fix(lsp): handle array with empty string when checking empty hover (#35423) 2025-08-21 17:15:56 -07:00
zeertzjq
865a28155e vim-patch:8.2.1672: v_lock is used when it is not initialized (#35416)
Problem:    v_lock is used when it is not initialized. (Yegappan Lakshmanan)
Solution:   Initialize the typval in eval1().

4a091b9978

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-22 06:28:45 +08:00
Birdee
c522cb0e96 feat(pack): support user-defined data in plugin spec #35360
Problem:
The load function in opts was difficult to use if you wished to
customize based on the plugin being loaded.

You could get the name, but without some way to mark a spec, that was of
limited usefulness unless you wanted to hardcode a list of names in the
function, or write a wrapper around the whole thing

Solution:
Allow users to provide an arbitrary data field in plugin specs so that
they may receive info as to how to handle that plugin in load, get() and
events, and act upon it

Co-authored-by: BirdeeHub <birdee@localhost>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2025-08-21 10:08:29 -07:00
luukvbaal
9467731865 feat(extui): support paging in the dialog window (#35310)
Problem:  Unable to see e.g. `inputlist()` prompts that exceed the dialog
          window height.
          Multi-line prompts are not handled properly, and tracking
          is insufficient for messages in cmdline_block mode.
Solution: Add vim.on_key handler while the dialog window is open that
          forwards paging keys to the window.
          Properly render multi-line prompts. Keep track of both the start
          and end of the current cmdline prompt. Append messages after the
          current prompt in cmdline_block mode.
2025-08-21 14:56:59 +02:00
Cameron Ring
30dae87de4 fix(startup): file buf is lost if stdin is empty and "-" is last #35402
Problem:
Running `echo dummy | nvim file1 file2` closes the file1 buffer if
file1 doesn't exist.

Solution:
Logic changed in 43e8ec9 such that stdin buffer may now be created *after*
file args. Handle that case.
2025-08-20 20:34:49 -07:00
zeertzjq
a8dad46e1c Merge pull request #35352 from janlazo/vim-8.1.2008
vim-patch:8.1.2008,v8.2.{844,853,3348,3795,4379}
2025-08-21 11:31:31 +08:00
Jan Edmund Lazo
dc2d4b07a8 vim-patch:8.2.0853: ml_delete() often called with FALSE argument
Problem:    ml_delete() often called with FALSE argument.
Solution:   Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.

ca70c07b72

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:46:35 -04:00
Jan Edmund Lazo
e77d15cc5d vim-patch:8.2.3348: line2byte() returns wrong value after adding textprop
Problem:    line2byte() returns wrong value after adding textprop. (Yuto
            Kimura)
Solution:   Reduce the length by the size of the text property. (closes vim/vim#8759)

14c7530c4f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:46:35 -04:00
Jan Edmund Lazo
ed012b817d vim-patch:8.2.0844: text properties crossing lines not handled correctly
Problem:    Text properties crossing lines not handled correctly.
Solution:   When saving for undo include an extra line when needed and do not
            adjust properties when undoing. (Axel Forsman, closes vim/vim#5875)

ML_DEL_UNDO, ML_APPEND_UNDO are no-opt because textprop feature is N/A.

a9d4b84d97

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:49 -04:00
Jan Edmund Lazo
09964b7ef0 vim-patch:8.2.4379: an empty change is reported to a listener
Problem:    An empty change is reported to a listener.
Solution:   Do not report an empty change. (closes vim/vim#9768)  Remove unused
            return value.

55737c2a31

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:49 -04:00
Jan Edmund Lazo
15d3a83999 vim-patch:8.2.3795: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate the jumplist feature.

739f13a55b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:48 -04:00
Jan Edmund Lazo
d06fdecb97 vim-patch:8.1.2008: error for invalid range when using listener and undo
Problem:    Error for invalid range when using listener and undo. (Paul Jolly)
Solution:   Do not change the cursor before the lines are restored.
            (closes vim/vim#4908)

4544bd2f24

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:48 -04:00
zeertzjq
fbaead249b Merge pull request #35410 from zeertzjq/vim-308a313
vim-patch: doc updates
2025-08-21 09:15:20 +08:00
zeertzjq
7d53982b7f vim-patch:84a343a: runtime(doc): correct another problem in :h items()
The returned value is only in arbitrary order for a Dict.

closes: vim/vim#18050

84a343a6ed
2025-08-21 08:44:08 +08:00
zeertzjq
1fdacbb3e4 vim-patch:44c8072: runtime(doc): fix style and clarify items() function for String type
related: vim/vim#18021

44c8072ef6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-21 08:44:08 +08:00
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