Open chuwy opened 3 years ago
Same error with:
> nvim --clean \
--cmd set\ rtp+=/Users/antonparkhomenko/.local/share/nvim/site/pack/packer/start/plenary.nvim \
--cmd ":lua require('plenary.async').uv.fs_open('/Users/antonparkhomenko/.zshrc', 'r', 438)"
And even if I run it with 0.4.4 I get:
E5105: Error while calling lua chunk: [string "<VimL compiled string>"]:1: attempt to yield across C-call boundary
I can reproduce this
NVIM v0.5.1
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210927-1441-demfsz/neovim-0.5.1/build/config -I/tmp/neovim-20210927-1441-demfsz/neovim-0.5.1/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210927-1441-demfsz/neovim-0.5.1/build/src/nvim/auto -I/tmp/neovim-20210927-1441-demfsz/neovim-0.5.1/build/include
Compiled by brew@BigSur
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.5.1/share/nvim"
Run :checkhealth for more info
Async functions must be called from an async context or with async.run
. Calling an async function directly means the current function must be async as well. This is very similar to JS or Python where it is more explicit because it's built-in
local a = require("plenary.async")
-- `read` is an async function
read = function(path)
local err, fd = a.uv.fs_open(path, "r", 438)
assert(not err, err)
end
a.run(function() read("mypath") end)
I'm starting to write a very minimalistic plugin with
async
example from README. Basically there's onlyinit.lua
file with:But it fails with the following error, whenever I try to call the function:
Although in fact I see the same error even when call it directly:
:version
output: