TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
494 stars 9 forks source link

conflict with goyo [vimade#Redraw[6]] #70

Closed YuCao16 closed 1 month ago

YuCao16 commented 2 years ago

Hi, Thanks for your work, it works unbelievable well. It seems not capable with Goyo, however, if I type :Goyo, it was fine, but when I quit Goyo by typing :Goyo!, it raise me this error:

Error detected while processing function vimade#Redraw[6]..provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 4 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/Users/caoyu/.config/nvim/autoload/plugged/vimade/lib/vimade/bridge.py", line 14, in unfadeAll
    fader.unfadeAll()
  File "/Users/caoyu/.config/nvim/autoload/plugged/vimade/lib/vimade/fader.py", line 334, in unfadeAll
    unfadeAllSigns()
  File "/Users/caoyu/.config/nvim/autoload/plugged/vimade/lib/vimade/fader.py", line 320, in unfadeAllSigns
    signs.unfade_bufs(list(currentBuffers.values()))
  File "/Users/caoyu/.config/nvim/autoload/plugged/vimade/lib/vimade/signs.py", line 35, in unfade_bufs
    buf_signs = util.eval_and_return('[' + ','.join(['get(getbufinfo('+x.bufnr+')[0], \'signs\', [])' for x in bufs ]) + ']')
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynvim/plugin/script_host.py", line 205, in eval
    obj = self.request("vim_eval", expr)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynvim/msgpack_rpc/session.py", line 102, in reques
t
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E684: list index out of range: 0

I'm using: neovim==0.6.0 goyo==1.6.0(???) vimade==0.0.5,

I saw there is a related commits dad8122, but I don't have any clues how to fix it. Can anyone help?

YuCao16 commented 2 years ago

Actually, I have found a less elegant solution, if I quit Goyo by :q and type :so ~/.config/nvim/init.vim, it will return to the origin window. The reason I refresh init.vim is I set background transparent and it can restart Vimade, as well. However, if possible, it is still hoped that other solutions can be found, Thanks!

TaDaa commented 2 years ago

Latest update should fix this error, let me know if not

YuCao16 commented 2 years ago

It works, thanks for your help!

In case some people also use transparent background, with amazing Vimade and Goyo,

function! s:QuitGoyo()
    hi Normal guibg=NONE ctermbg=NONE
    hi NonText ctermbg=NONE guibg=NONE
endfunction
autocmd! User GoyoLeave nested call <SID>QuitGoyo()

this function above will reset background when you quit Goyo.

TaDaa commented 1 month ago

Thanks for reporting! Closing this issue