-
Notifications
You must be signed in to change notification settings - Fork 37
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
ExecLua function will cause neovim hangup #104
Comments
@glepnir Thanks! will check it. |
take code form test file. also hangup. @zchee cc |
any update for this issue? |
@glepnir I'd dig this issue but not yet solved... |
@glepnir Could you post Go side minimal code? It's doesn't work at least my local. func (c *Command) LspInstall(p *plugin.Plugin) ([]string, error) {
userConfig := make([]string, 0)
getUserConfig := "require('lspmeta').get_user_config_server()"
if err := c.nvim.ExecLua(getUserConfig, userConfig); err != nil {
return nil, err
}
return userConfig, nil
} |
hmm it can't work for you because you does not have lua function right? check my second image. it use the go test code from |
Hi @glepnir @zchee I was facing a similar issue and found out that the issue was due to the A small, working lua example is: func hello(args []string) (int, error) {
nv, err := nvim.NewChildProcess(
ChildProcessArgs("--embed") // we need to start `nvim` with this flag. In the unit tests this was set, but not in the example above
)
if err != nil {
return 0, err
}
var result int
program := "local a, b = ... return a + b"
if err := nv.ExecLua(program, &result, 1, 2); err != nil {
return result, err
}
return result, nil
}
func main() {
plugin.Main(func(p *plugin.Plugin) error {
p.HandleFunction(&plugin.FunctionOptions{Name: "Hello"}, hello)
return nil
})
} There was another issue #155 where setting the Please help review and let me know what you think about this solution. Thanks! Screen.Recording.2023-07-15.at.5.05.56.PM.mov |
@zchee I can confirm my lua code can works well.
lua code
The text was updated successfully, but these errors were encountered: