ahmedkhalf/jupyter-nvim

Error when open *.ipynb

f3fora opened this issue · 1 comments

nvim raises this error when open a ipynb file.

error caught while executing async callback:
NvimError('Vim:E158: Invalid buffer name: 2')
Traceback (most recent call last):
  File "/home/user/.local/share/nvim/site/pack/packer/start/jupyter-nvim/rplugin/python3/jupyter-nvim/__init__.py", line 47, in write_notebook
    nb.draw_full()
  File "/home/user/.local/share/nvim/site/pack/packer/start/jupyter-nvim/rplugin/python3/jupyter-nvim/utils.py", line 43, in draw_full
    self._nvim.funcs.sign_place(
  File "/usr/lib/python3.9/site-packages/pynvim/api/nvim.py", line 299, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E158: Invalid buffer name: 2

the call was requested at
  File "/usr/lib/python3.9/site-packages/pynvim/plugin/host.py", line 124, in _on_request
    rv = handler(*args)
  File "/usr/lib/python3.9/site-packages/pynvim/plugin/host.py", line 92, in _wrap_delayed_function
    self._request_handlers[name](*args)
  File "/usr/lib/python3.9/site-packages/pynvim/plugin/host.py", line 102, in _wrap_function
    return fn(*args)
  File "/home/user/.local/share/nvim/site/pack/packer/start/jupyter-nvim/rplugin/python3/jupyter-nvim/__init__.py", line 49, in openNotebook
    self.nvim.async_call(write_notebook)

Thank you for letting me know! I have now discovered a better way to read file contents. And this issue should be fixed now.