-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(channels): introduce v:parent #18561
base: master
Are you sure you want to change the base?
Conversation
@@ -120,7 +119,30 @@ function vim._os_proc_children(ppid) | |||
return children | |||
end | |||
|
|||
-- TODO(ZyX-I): Create compatibility layer. | |||
-- Initializes v:parent (from server.c). | |||
function vim._server_init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experimenting with defining core logic in Lua instead of C.
Will need to think more about where this kind of code lives, as we accumulate more of it.
'nvim-child', | ||
api['version'], | ||
'remote', -- TODO: do we want a "child" or "nvim" client type? | ||
vim.empty_dict(), -- TODO: Need api.functions dict (not list): https://github.com/neovim/neovim/pull/12040 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#12040 will help bring some consistency with the structure of api_info()
and nvim_set_client_info
which currently have some questionable incompatibilities.
|
||
it('creates v:parent channel from $NVIM', function() | ||
local nrchans = #meths.list_chans() | ||
exec_lua([[return vim.fn.jobstart({ vim.v.progpath }, vim.empty_dict())]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had a convenience in the bridge where an empty {}
was acceptable for a Dict param. Is it intentional / desired that vim.empty_dict()
is required here? @bfredl
:lua lua =vim.fn.jobstart({ vim.v.progpath }, {})
E5108: Error executing lua Vim:E475: Invalid argument: expected dictionary
stack traceback:
[C]: in function 'jobstart'
[string ":lua"]:1: in main chunk
f3deee1
to
f0f83ea
Compare
Explicitly closing the parent channel was an attempt to avoid noise in the logs. But the channels should already be cleared by Nvim event_teardown() and server_teardown() happens too late. Need to find another way to avoid log noise.
followup to #11009
$NVIM
automatically, expose it asv:parent
$NVIM, v:parent #3118:!
) ?