Skip to content
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

Exception when trying to close the last window #27

Closed
jubnzv opened this issue Aug 4, 2020 · 1 comment
Closed

Exception when trying to close the last window #27

jubnzv opened this issue Aug 4, 2020 · 1 comment

Comments

@jubnzv
Copy link

jubnzv commented Aug 4, 2020

Hi, thanks for this cool plugin.

I found a small issue. When I trying to close the last window that is a chadtree buffer, I get the following exception in the messages area:

Traceback (most recent call last):
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 84, in run
    fut.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 104, in run
    new_state = await fn(
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 175, in c_quit
    await call(nvim, cont)
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/nvim.py", line 27, in cont
    ret = fn()
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 173, in cont
    kill_fm_windows(nvim, settings=settings)
  File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/wm.py", line 136, in kill_fm_windows
    nvim.api.win_close(window, True)
  File "/home/jubnzv/.local/lib/python3.8/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/home/jubnzv/.local/lib/python3.8/site-packages/pynvim/msgpack_rpc/session.py", line 104, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E444: Cannot close last window
Vim:E444: Cannot close last window

Steps to reproduce:

  1. Open an arbitrary file with nvim: nvim $(mktemp)
  2. Open chadtree: :CHADOpen<cr>
  3. Close all other windows: <C-w>o
  4. Try to close chadtree window: q
@ms-jpq
Copy link
Owner

ms-jpq commented Aug 4, 2020

Thanks for the report.

I fixed it:

b033bbc

@ms-jpq ms-jpq closed this as completed Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants