numirias / semshi

🌈 Semantic Highlighting for Python in Neovim
1.03k stars 34 forks source link

AttributeError: 'NoneType' object has no attribute 'viewport' #108

Open wookayin opened 3 years ago

wookayin commented 3 years ago

Neovim version: NVIM v0.6.0-dev+1556-gc642f3ac2, but it happens in v0.5.0 release as well

error caught in async handler '.../vim/plugged/semshi/rplugin/python3/semshi:function:SemshiVimResized [[71, 102]]'
Traceback (most recent call last):
  File ".../vim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 91, in event_vim_resized
    self._update_viewport(*args)
  File ".../vim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 231, in _update_viewport
    self._cur_handler.viewport(start, stop)
AttributeError: 'NoneType' object has no attribute 'viewport'

Often semshi throws an error when vim gets resized. It might be a conflict with other plugins installed, but it sometimes happens. No idea why self._cur_handler is not ever set.

wookayin commented 2 years ago

This can be fixed like https://github.com/wookayin/semshi/commit/11cf4e7738377298efd27d7db406c45115b5a79e