lewis6991 / impatient.nvim

Improve startup time for Neovim
MIT License
1.19k stars 28 forks source link

impatient.lua:243: attempt to call field 'encode' (a nil value) #40

Closed ayoubelmhamdi closed 2 years ago

ayoubelmhamdi commented 2 years ago

with the new update of this plugin,i get this error when I open neovim

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:243: attempt to call field 'encode' (a
 nil value)

when I open neovim, I get this error I'm in Linux: Void-linux nvim version: NVIM v0.6.0-dev+a5d6f36 this error come from this function

function M.save_cache()
  if M.dirty then
    log('Updating cache file: %s', M.path)
    local f = io.open(M.path, 'w+b')
    f:write(mpack.encode(M.cache))
    f:flush()
    M.dirty = false
  end
end

when go back to to commit 561b86e I see that I should be

-      f:write(mpack.encode(M.cache))
+      f:write(mpack.pack(M.cache))

-      return mpack.unpack(f:read'*a')
+      return mpack.decode(f:read'*a')
clason commented 2 years ago

You have to upgrade your Neovim version to the latest HEAD, see https://github.com/neovim/neovim/issues/14090#issuecomment-955239489.

clason commented 2 years ago

(If you run the nightly pre-release, you have to constantly keep it updated, or things will break.)

lewis6991 commented 2 years ago

Duplicate of #38

lewis6991 commented 2 years ago

27c783556dd3e4085a0a93063f242c888405d6b6 should stop old 0.6-dev installs breaking, though it is still recommended you upgrade to latest master or roll back to 0.5