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.
This commit is contained in:
Sanzhar Kuandyk
2026-04-21 21:49:16 +05:00
committed by GitHub
parent d99e01ca80
commit 5891f2f3dc
4 changed files with 122 additions and 17 deletions

View File

@@ -216,7 +216,10 @@ describe('vim._core', function()
t.matches("^module 'vim%.hl' not found:", t.pcall_err(n.exec_lua, [[require('vim.hl')]]))
-- All `vim._core.*` modules are builtin.
t.eq({ 'serverlist' }, n.exec_lua([[return vim.tbl_keys(require('vim._core.server'))]]))
t.eq(
{ 'rebind_old_addr_after_restart', 'serverlist' },
n.exec_lua([[local k = vim.tbl_keys(require('vim._core.server')); table.sort(k); return k]])
)
local expected = {
'vim.F',
'vim._core.defaults',