9 Commits

Author SHA1 Message Date
Szymon Wilczek c3f803c3b6 feat(server): serverlist({info=true}) gets detailed info #39392
Problem:
UI tools and orchestration engines need more context than just raw
socket addresses from serverlist(). Without knowing if a server belongs
to the current instance or knowing its PID, UIs cannot display
meaningful options to users.

Solution:
- Added the `info=v:true` option to `serverlist()`.
- When `info` is requested, it implies `peer=true` and returns a list of
  dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and
  `own`.
- Uses an RPC request to `getpid()` across the socket to fetch the
  peer's actual process ID.

Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
2026-05-06 08:55:34 -04:00
Justin M. Keyes 28ba068372 feat(:restart): v:starttime, v:exitreason #39282
Problem:
- The `ZR` feature makes it more obvious that we need some sort of flag so that
  an `ExitPre` / `QuitPre` / `VimLeave` handler can handle restarts differently
  than a normal exit. For example, it's common that users want `:mksession` on
  restart, but perhaps not on a normal exit.
- Nvim has no way to report its "uptime".

Solution:
- Introduce `v:starttime`
- Introduce `v:exitreason`
2026-04-22 13:40:41 -04:00
zeertzjq 208951cbc0 fix(:restart): avoid ERR/WRN logging on Windows with --listen (#39287)
Problem:  :restart leads to ERR/WRN logging on Windows with --listen.
Solution: Add a log_level flag to vim._with() and use it to suppress
          logging from serverstart()/serverstop() during restart.
2026-04-22 08:12:55 +08:00
Sanzhar Kuandyk 5891f2f3dc fix(:restart): reuse --listen addr on Windows #38539
Problem:
On Windows, :restart cannot immediately reuse the canonical --listen
address because named pipe release is asynchronous.

Solution:
Start the new Nvim server on a temporary address; in the new Nvim,
retry serverstart() with the original ("canonical") address until it
succeeds.
2026-04-21 12:49:16 -04:00
Justin M. Keyes 3ebfa2a3cb feat(vimfn): use Lua for more excmds/vimfns
Problem:
Too much boilerplate needed to use Lua to impl an excmd or f_xx
function.

Solution:
- Add `nlua_call_vimfn` which takes the args typval, executes
  Lua, and returns a typval.
- refactor(excmd): lua impl for :log, :lsp
2026-04-18 16:57:37 +02: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
Siddhant Agarwal 7a71235399 fix(server): serverlist({peer=true}) does not find peer servers #35506 2025-08-28 06:41:31 -07:00
Justin M. Keyes 56a4ef3c21 docs: lsp, ui events, dev guidance, osc7
fix #34981
2025-07-28 22:00:25 -04:00
Siddhant Agarwal 5151f635ca feat: serverlist({peer=true}) returns peer addresses #34806
Problem:
serverlist() only lists servers that were started by the current Nvim.

Solution:
Look for other Nvim servers in stdpath("run").
2025-07-27 21:40:04 -07:00