Commit Graph

5386 Commits

Author SHA1 Message Date
bfredl
5581a53437 fix(shell): ceci n'est pas une pipe
On linux /dev/stdin is defined as a symlink to /proc/self/fd/0
This in turn is defined as a "magic" symlink which is allowed to point
to internal kernel objects which really does not have a file
name. As a glaring inconsistency, fopen("/proc/self/fd/0", "r")
works if fd was originally opened using pipe() but not using
socketpair(). As it happens UV_CREATE_PIPE does not create pipes
but creates socket pairs. These two unfortunate conditions
means that using /dev/stdin and similar does not work in
shell commands in nvim on linux. as a work around, override
libuv's descicion and create an actual pipe pair.

This change is not needed on BSD:s but done unconditionally for simplicity,
except for on windows where it is not done for stdout because of windows

fixes #35984
2026-01-13 09:41:51 +01:00
zeertzjq
7a6e8d4430 docs: misc (#37281)
Close #37289
Close #37348

Co-authored-by: Marc Jakobi <marc@jakobi.dev>
Co-authored-by: Anton Kesy <anton@kesy.de>
2026-01-12 03:50:57 +00:00
zeertzjq
aed1f8c377 vim-patch:9.1.2079: use-after-free with 'qftf' wiping buffer (#37364)
Problem:  use-after-free with 'quickfixtextfunc' wiping buffer
          (henices)
Solution: Evaluate 'quickfixtextfunc' with textlock enabled.

closes: vim/vim#19142

300ea1133f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-12 07:04:36 +08:00
zeertzjq
46f83dc271 vim-patch:536ee91: runtime(doc): add termdebug tag (#37321)
vim-patch:536ee91: runtime(doc): add termdebug tag, remove term "floating window"

Problem:
- When I type `:h termdebug`, I will expect to see the introduction of
  the termdebug plugin. But instead, it shows me document of
  `termdebug_wide`, and I have to scroll up quite much to find the
  introduction.
- `:h popup` says `floating-window`? Why? As I have tried both features
  (of Vim and Neovim), I think they are _very different_ things, even
  more different than job features in Vim and Neovim.

Solution:
- In `:h terminal.txt`, add tag `*termdebug*` to the introduction of
  termdebug plugin.
- In `:h popup.txt`, "floating window" -> "popup window".

closes: vim/vim#19135

536ee91189

Change the title ":Termdebug plugin" to simply ":Termdebug", otherwise
the line is too long.

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2026-01-10 07:05:28 +08:00
Yochem van Rosmalen
b23e99e051 docs: remove ICCF Holland URL (#37230)
Problem:
ICCF Holland is dissolved by the end of 2025 ^1 and sponsorships are
transferred to Kuwasha (https://kuwasha.net). Their SSL certificate is
already expired, so the https URL mentioned in the intro text doesn't
work anymore. Reported by https://github.com/neovim/neovim/issues/36597#issue-3635391949.

Solution:
URL is removed from the text. We'll keep the vim.org URL for now as it
points to the same information.

[^1]: See June 2025 news on https://iccf-holland.org/index.html
2026-01-09 16:38:26 +08:00
zeertzjq
03e9797bb2 vim-patch:cf8e378: runtime(doc): clarify the behaviour of 'fo-m' (#37318)
fixes: vim/vim#19095

cf8e378f4e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-09 01:36:04 +00:00
Evgeni Chasnovski
3e83f7bec7 docs: drop vim.pack WIP note, add example code #37229 2026-01-07 21:43:55 -05:00
benarcher2691
55a0843b7c feat(editor): :source can run Lua codeblock / ts injection #36799
Problem:
Can't use `:source` to run a Lua codeblock (treesitter injection) in
a help (vimdoc) file.

Solution:
Use treesitter to parse the range and treat it as Lua if detected as
such.
2026-01-07 20:20:53 -05:00
zeertzjq
dd6ed20272 docs: misc (#37280)
Close #36806
Close #36812
Close #37003
Close #37016
Close #37038
Close #37039
Close #37157
Close #37185
Close #37213

Co-authored-by: saroj_r <sarojregmi.official@gmail.com>
Co-authored-by: Olivia Kinnear <git@superatomic.dev>
Co-authored-by: Igor <igorlfs@ufmg.br>
Co-authored-by: Justin Roberts <JustinEdwardLeo@gmail.com>
Co-authored-by: "Mike J. McGuirk" <mike.j.mcguirk@gmail.com>
Co-authored-by: Aymen Hafeez <49293546+aymenhafeez@users.noreply.github.com>
Co-authored-by: Peter Cardenas <16930781+PeterCardenas@users.noreply.github.com>
Co-authored-by: DrNayak2306 <dhruvgnk.work@gmail.com>
2026-01-07 08:11:42 +08:00
zeertzjq
7eb14ba0ba vim-patch:77a59be: runtime(cangjie): Update syntax script (#37267)
This commit updates `syntax/cangjie.vim` to match the latest `std.core`
library:

New Features:
* Documentation: Added highlighting for documentation keywords (e.g., `@param`, `@return`).
* Standard Library: Added highlighting for `std.core` functions, interfaces, and classes.
* Exceptions: Added highlighting for standard exception types.
* FFI Support: Added highlighting for C interoperability types (e.g., `CPointer`).

Improvements:
* Configuration: Added a unified switch (`s:enabled('builtin')`) for standard library highlighting.
* Type System: Updated `Int` and `UInt` aliases.
* Interpolation: Enabled standard library highlighting inside string interpolation.
* Cleanup: Removed non-core types like `ArrayList` and `HashMap`.

closes: vim/vim#19085

77a59be594

Co-authored-by: Neila <wu.junkai@qq.com>
2026-01-06 11:21:03 +00:00
zeertzjq
43bf045005 vim-patch:9.1.1646: MS-Windows: completion cannot handle implicit drive letters
Problem:  MS-Windows: completion cannot handle implicit drive letters
Solution: Consider paths like \folder and /folder as absolute
          (Miguel Barro).

closes: vim/vim#17829

a2f13bf782

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2026-01-04 19:36:35 +08:00
Jan Edmund Lazo
d548b52b0f build(vim-patch): update Vim N/A file/regexp (#37049)
* fix(vim-patch): test_codestyle.vim is NA

Neovim has make lint, specifically clint.lua.
Unless vim9jit, https://github.com/tjdevries/vim9jit, or similar tool
compiles vim9 "test" code into lua, it's futile to port it.

* fix(vim-patch): NA files from dev_vimpatch.txt

- channel
- json
- job
- term
- terminal

Nvim has its own incompatible implementation or uses 3rd-party
libraries (ie. libuv, libtermkey).

* fix(vim-patch): term.c is applicable for replace_termcodes()

* fix(vim-patch/na): blowfish,dlldata,iid_ole,nbdebug,os_w32

blowfish is for encryption.
dlldata,iid_ole,os_w32 are for Windows (GUI, registry, entry point).
Nvim doesn't need them to be installed on Windows.

nbdebug.[ch] is for Netbeans Debugging Tools.
They're N/A.

* fix(vim-patch): runtime/

Nvim has its own documentation for development

- runtime/doc/debug.txt
- runtime/doc/develop.txt

N/A since the beginning:

- runtime/doc/os_haiku.txt
- runtime/doc/pi_logipat.txt
- runtime/doc/quotes.txt
- runtime/plugin/logiPat.vim
- runtime/plugin/manpager.vim
- runtime/tools/demoserver.py
- runtime/spell/.*\.latin1

Vim9 is N/A.

- runtime/doc/os_haiku.txt

* fix(vim-patch): src/

win32yank replaces "src/winclip.c".
Vim's desktop files are N/A.
Nvim removed 'termencoding'.
Nvim doesn't use Vim's lsan-suppress.txt to configures LSAN.
2026-01-04 14:15:23 +08:00
zeertzjq
715015d3b2 vim-patch:93eb081: runtime(doc): Clarify visual mark behavior in getpos(), setpos() (#37223)
Add documentation notes explaining that visual marks '< and '> have
different behaviors in getpos() and setpos().

Also fix a small typo.

closes: vim/vim#19070

93eb081eee

Co-authored-by: Larson, Eric <numeric.larson@gmail.com>
2026-01-03 23:46:15 +00:00
Olivia Kinnear
a03ab03a10 fix(lsp): :lsp restart restarts on client exit #37125
Problem:
`:lsp restart` detects when a client has exited by using the `LspDetach`
autocommand. This works correctly in common cases, but breaks when
restarting a client which is not attached to any buffer. It also breaks
if a client is detached in between `:lsp restart` and the actual
stopping of the client.

Solution:
Move restart logic into `vim/lsp/client.lua`, so it can hook in to
`_on_exit()`. The public `on_exit` callback cannot be used for this, as
`:lsp restart` needs to ensure the restart only happens once, even if
the command is run multiple times on the same client.
2026-01-02 01:58:10 -05:00
Justin M. Keyes
b24522e77b Merge #37113 from echasnovski/pack-better-revert 2025-12-30 10:40:19 -05:00
Justin M. Keyes
ea3562d739 Merge #37142 from echasnovski/pack-safer-del 2025-12-30 04:20:33 -05:00
Phạm Bình An
f8d0190491 docs(prompt): Lua example, adjust for multiline input #37121 2025-12-30 03:57:35 -05:00
Justin M. Keyes
20e77c5d88 build: ship "_core/*" as bytecode (built-into Nvim binary)
Problem:
We want to encourage implementing core features in Lua instead of C, but
it's clumsy because:
- Core Lua code (built into `nvim` so it is available even if VIMRUNTIME
  is missing/invalid) requires manually updating CMakeLists.txt, or
  stuffing it into `_editor.lua`.
- Core Lua modules are not organized similar to C modules, `_editor.lua`
  is getting too big.

Solution:
- Introduce `_core/` where core Lua code can live. All Lua modules added
  there will automatically be included as bytecode in the `nvim` binary.
- Move these core modules into `_core/*`:
  ```
  _defaults.lua
  _editor.lua
  _options.lua
  _system.lua
  shared.lua
  ```

TODO:
- Move `_extui/ => _core/ui2/`
2025-12-30 01:44:24 -05:00
Kyle
03377b9552 feat(terminal): include sequence terminator in TermRequest event (#37152)
Problem:
Terminals should respond with the terminator (either BEL or ST) used in
the query so that clients can reliably parse the responses. The
`TermRequest` autocmd used to handle background color requests in the
terminal does not have access to the original sequence terminator, so it
always uses BEL. #37018

Solution:
Update vterm parsing to include the terminator type, then forward this
data into the emitted `TermRequest` events for OSC/DCS/APC sequences.
Update the foreground/background `TermRequest` callback to use the same
terminator as the original request.

Details:
I didn't add the terminator to the `TermResponse` event. However, I
assume the `TermResponse` event doesn't care about the terminator
because the sequence is already parsed. I also didn't update any of the
functions in `src/nvim/vterm/state.c` that write out responses. It
looked like those all pretty much used ST, and it would be a much larger
set of changes. In that same file, there's also logic for 8 bit ST
sequences, but from what I can tell, 8 bit doesn't really work (see `:h
xterm-8bit`), so I didn't use the 8 bit ST at all.
2025-12-29 16:30:23 -06:00
Evgeni Chasnovski
28ba99e026 feat(pack)!: suggest "delete" code action only for not active plugins
Problem: Deleting active plugins can lead to a situation when it is
  reinstalled after restart.

Solution: Suggest "delete" code action only for not active plugins.
  Whether a plugin is not active is visible by a hint in its header.
2025-12-28 18:39:26 +02:00
Evgeni Chasnovski
f5707a9c42 feat(pack)!: make del() only remove non-active plugins by default
Problem: Using `vim.pack.del()` to delete active plugin can lead to
  a situation when this plugin is reinstalled after restart. Removing
  plugin from 'init.lua' is documented, but can be missed.

Solution: Make `del()` only remove non-active plugins by default and
  throw an informative error if there is an active plugin.

  Add a way to force delete any plugin by adding `opts.force`. This also
  makes `del()` signature be the same as other functions, which is nice.
2025-12-28 18:39:26 +02:00
zeertzjq
5670dde1af vim-patch:a7f703c: runtime(doc): improve :catch documentation (#37131)
related: vim/vim#18984
closes:  vim/vim#19029

a7f703c215

Co-authored-by: Mao-Yining <101858210+mao-yining@users.noreply.github.com>
2025-12-28 08:18:48 +08:00
zeertzjq
1e44a001ec vim-patch:9.1.2024: 'fsync' option cannot be set per buffer (#37129)
Problem:  'fsync' option cannot be set per buffer
Solution: Make 'fsync' option global-local
          (glepnir)

closes: vim/vim#19019

4d5b303726

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-28 08:14:45 +08:00
Evgeni Chasnovski
c9965491d0 feat(pack): allow running update() without Internet connection
Problem: There is now way to run `update()` without Internet connection
  while there are some workflows that do not require it. Like "switch
  plugin version" and "revert latest update".

Solution: Add `opts.offline` to `update()`. This also allows now to
  treat `vim.pack.update(nil, { offline = true })` as a way to
  interactively explore currently installed plugins.
2025-12-26 20:05:12 +02:00
Evgeni Chasnovski
8c28507fcf feat(pack): allow choosing update target in update()
Problem: There are two fairly common workflows that involve lockfile and
  can be made more straightforward in `vim.pack`:

    1. Revert latest update. Like if it introduced unwanted behavior.

    2. Update to a revision in the lockfile. Like if already updated
       on another machine, verified that everything works, `git add` +
       `git commit` + `git push` the config, and want to have the same
       plugin states on current machine.

Solution: Make `update` allow `opts.target`. By default it uses
  `version` from a plugin specification (like a regular "get new changes
  from source" workflow). But it also allows `"lockfile"` value to
  indicate that target revision after update should be taken from the
  current lockfile verbatim.

  With this, the workflows are:

    1. Revert (somehow) to the lockfile before the update, restart, and
       `vim.pack.update({ 'plugin' }, { target = 'lockfile' })`. If Git
       tracked, revert with `git checkout HEAD -- nvim-pack-lock.json`.
       For non-VCS tracked lockfile, the revisions can be taken from the
       log file. It would be nicer if `update()` would backup a lockfile
       before doing an update, but that might require discussions.

    2. `git pull` + `:restart` +
       `vim.pack.update(nil, { target = 'lockfile' })`.
       The only caveats are for new and deleted plugins:
        - New plugins (not present locally but present in the lockfile)
          will be installed at lockfile revision during restart.
        - Deleted plugins (present locally but not present in the
          lockfile) will still be present: both locally *and* in the
          lockfile. They can be located by
          `git diff -- nvim-pack-lock.json` and require manual
          `vim.pack.del({ 'old-plugin1', 'old-plugin2' })`.
2025-12-26 18:32:59 +02:00
Yi Ming
e855a23c02 feat(lsp): on_accept can return item to customize behavior #37092
Problem:
`on_accept` is a bit cumbersome to customize.

Solution:
* Before: users had to override the entire `on_accept` logic for their changes to be applied.
* Now: users can modify the item and return it to apply the modified changes, or return `nil` to fully customize how the changes are applied.
2025-12-26 00:08:12 -05:00
Evgeni Chasnovski
c8ea8374c8 docs(pack): use more tags and add "Use shorter source" example 2025-12-25 12:57:59 +02:00
Evgeni Chasnovski
0353d33b00 feat(pack)!: change src of installed plugin inside update() in place
Problem: Changing `src` of already installed plugin currently takes
  effect immediately inside `vim.pack.add()` and acts as "delete and
  later fresh install". Although more robust, this might lead to
  unintentional data loss (since plugin is deleted) if the plugin was
  manually modified or the new source is not valid.
  Also this introduces unnecessary differentiation between "change
  `version`" and "change `src`" of already installed plugin.

Solution: Require an explicit `vim.pack.update()` to change plugin's
  source. It is done by conditionally changing `origin` remote of the
  Git repo. The effect does not require update confirmation in order to
  have new changes fetched from the new `src` right away.

  If in the future there are more types of plugins supported (i.e. not
  only Git repos), also do extra work (like delete + install) during
  `vim.pack.update()`.
2025-12-25 12:57:59 +02:00
Olivia Kinnear
29494f042c fix(ex): error handling for :lsp #37061 2025-12-25 03:19:12 -05:00
zeertzjq
20c96f1515 vim-patch:2006415: runtime(doc): add reference to searchcount() function
2006415016

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:53:31 +08:00
zeertzjq
0981d4e871 vim-patch:6d211bc: runtime(doc): Improve :catch documentation
fixes: vim/vim#18984

6d211bc4f0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:52:21 +08:00
zeertzjq
e1aceb0068 vim-patch:e09ff34: runtime(ty): include ty compiler plugin (#37066)
closes: vim/vim#18960

e09ff34129

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-12-22 08:13:20 +08:00
Justin M. Keyes
4485e715fb fix(options): deprecate 'gdefault', 'magic' 2025-12-20 22:07:27 -05:00
Justin M. Keyes
060993e438 docs: misc, lsp 2025-12-20 22:07:27 -05:00
Bryan Turns
bef68ba266 docs(lua): iInconsistent vim.keymap param name #37026
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].

Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
2025-12-20 19:26:44 -05:00
zeertzjq
9b55f037d2 vim-patch:64799a5: runtime(doc): clarify the behavior of CTRL-Z
fixes: vim/vim#18975

64799a5080

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-21 07:12:38 +08:00
zeertzjq
03aef8fd2a vim-patch:fe8c8b1: runtime(doc): fix outdated :function help
Since patch 7.4.264 a leading "g:" is skipped.

closes: vim/vim#18976

fe8c8b1e85
2025-12-21 07:12:38 +08:00
Sean Dewar
eac2f0443e feat(tag): respect jumpoptions=view when popping tagstack (#37021)
Problem: jumpoptions=view has no effect when popping from the tagstack.
Solution: make it work.
2025-12-19 23:32:09 +00:00
zeertzjq
c08139d790 fix(lua): don't remove first char of non-file stacktrace source (#37008) 2025-12-18 08:09:16 +08:00
Olivia Kinnear
bd225422a5 fix(lsp): tests for :lsp, rename start/stop
- Rename :lsp start/stop to enable/disable
- Move lua section of `:lsp` to `vim/_core`
- Add tests
2025-12-16 13:46:08 -05:00
brianhuster
63abb1a88f feat(lsp): builtin :lsp command
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
  claims to be a "data-only" plugin, in fact it still provides some
  user-facing commands because they haven't been upstreamed to Nvim.

Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
  restart`, `:lsp start` and `:lsp stop` respectively.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-16 13:46:04 -05:00
zeertzjq
1d22b05f8d docs: update support.txt (#36903) 2025-12-16 12:55:32 +08:00
Justin M. Keyes
d5cfca5b76 feat(docs): numbered listitems 2025-12-15 13:55:15 -05:00
Justin M. Keyes
31dfecb458 docs: misc, editorconfig
fix https://github.com/neovim/neovim/issues/36858
2025-12-15 13:55:15 -05:00
Riley Bruins
976a47e81b Revert "refactor(treesitter): use scratch buffer for string parser" #36964
This reverts commit 2a7cb32959.
2025-12-15 02:09:36 -05:00
Justin M. Keyes
981ea41abb feat(tui): ghostty builtin terminfo #36963
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.

Solution:
- Add ghostty to `gen_terminfo.lua`.
  - Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
2025-12-15 02:07:51 -05:00
zeertzjq
1bde5a91c4 vim-patch:bfb9f5c: runtime(doc): Rename NoDefaultCurrentDirectoryInExePath tag (#36921)
- Add leading "$" to match other environment variable tags.
- Clarify :help $NoDefaultCurrentDirectoryInExePath.

closes: vim/vim#18895

bfb9f5c40e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-12 09:13:15 +08:00
zeertzjq
5a83f23430 vim-patch:98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 in printf() (#36919)
Problem:  crash with invalid positional argument 0 in printf()
Solution: Reject positional arguments <= 0.

closes: vim/vim#18898

98a0cbf05b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-12 08:14:58 +08:00
skewb1k
b87bdef2a8 fix(lua): relax vim.wait() timeout validation #36900
Problem:
After bc0635a9fc `vim.wait()` rejects floats
and NaN values.

Solution:
Restore the prior behavior, while still supporting `math.huge`. Update
tests to cover float case.
2025-12-10 09:44:05 -05:00
ymich9963
d2e445e1bd docs(options): shell-powershell #36881
Problem:
Current options for powershell and pwsh had mistakes and rationale
behind them was not clear.

Solution:
Update the suggested options by splitting up powershell and pwsh, as
well as ensuring that all options work and rationale is documented and
discussed.
2025-12-10 00:57:16 -05:00