TaDaa / vimade

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

NVim switching panels error #41

Open lucas-miranda opened 4 years ago

lucas-miranda commented 4 years ago

Decription

Most of times when I open two files side by side and I try to switch from right panel to the left panel, this error occurs and prevents me from switching panels:

Error detected while processing function vimade#CheckWindows[3]..provider#python3#Call:                                                                                                                                   
line   18:                                                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                   
  File "<string>", line 2, in <module>                                                                                                                                                                               
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/bridge.py", line 32, in update                                                                                                                    
    fader.update(nextState)                                                                                                                                                                                          
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/fader.py", line 215, in update                                                                                                                    
    fadeWin(win)                                                                                                                                                                                                     
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/fader.py", line 543, in fadeWin                                                                                                                   
    colors = coords[row - 1]                                                                                                                                                                                         
Press ENTER or type command to continue                                                                                                                                                                     
Erro detectado ao processar function vimade#CheckWindows[3]..provider#python3#Call:                                                                                                                                  
line   18:                                                                                                                                                                                                          
IndexError: list index out of range
Press ENTER or type command to continue     

Environment

TaDaa commented 4 years ago

can you shoot me over the output from :checkhealth . Do notice the issue with wordwrap enabled/disabled? Also are there folds present on the screen when the issue occurs?

lucas-miranda commented 4 years ago

I have tried wordwrap enabled/disabled and that doesn't seems to interfere.

I open a file for the first time, and folds are present, the error happens But when I open all folds of that file, the error doesn't occurs anymore When I open some folds, the vimade opacity appears with some errors (some parts are with opacity < 1.0 and others not) And when I close every fold again, the error starts happening as before

CheckHealth

health#nvim#check
========================================================================
## Configuration
  - WARNING: $NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+
    - ADVICE:
      - Use the 'guicursor' option to configure cursor shape. :help |'guicursor'|
      - https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Multiple python2 executables found.  Set `g:python_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python2
  - INFO: Other python executable: /bin/python2
  - INFO: Python version: 2.7.16
  - INFO: pynvim version: 0.4.0 (outdated; from /usr/local/lib/python2.7/dist-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.4.1

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.7.3
  - INFO: pynvim version: 0.4.0 (outdated; from /usr/local/lib/python3.7/dist-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.4.1

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - WARNING: `node` and `npm` (or `yarn`) must be in $PATH.
    - ADVICE:
      - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.
TaDaa commented 4 years ago

Thanks -- I should have a fix out for this later tonight -- the folded issue should be resolved in my pending changes. I'll try to reproduce in py2 though

TaDaa commented 4 years ago

I believe this is resolved, let me know if you are still experiencing issues

lucas-miranda commented 4 years ago

It's still happening, but the error message is a bit different this time:

Error detected while processing function vimade#CheckWindows[3]..provider#python3#Call:                                                                                                                                   
line   18:                                                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                   
  File "<string>", line 2, in <module>                                                                                                                                                                               
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/bridge.py", line 32, in update                                                                                                                    
    fader.update(nextState)                                                                                                                                                                                          
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/fader.py", line 215, in update                                                                                                                    
    for state in diffs:                                                                                                                                                                                              
  File "/home/luke/.config/nvim/plugins-database/vimade/lib/vimade/fader.py", line 543, in fadeWin                                                                                                                   
    vim.command('let g:vimade_synids=['+','.join(ids)+']')                                                                                                                                                           
Press ENTER or type command to continue    
TaDaa commented 4 years ago

quite bizarre - I tried reverting the change to use vim.command over vim.eval. Let me know if this fixes it -- perhaps vim.command could be finicky depending on OS.

Line 543 is a strange place for it to throw an error -- worst case is that synID should return 0. Also wondering why the stack trace is also referencing line 215, because there are no function calls within that loop.

I've tried using your init.vim and nvim version, but I was unable to experience any errors. If this doesn't work, I might need a specific set of files or that exact scenario that can be used to reproduce this issue.

lucas-miranda commented 4 years ago

With your last commit it suddenly started to work! I have run some tests and everything seems to be fine now.

Since I'm currently working on a C# project, I began to thinking it could be something related to OmniSharp or YouCompleteMe (that I use to handle OmniSharp). But I just started NVim and opened one file and another with folds closed, that would be a very odd thing to be a C# specific problem with just that.

TaDaa commented 4 years ago

Nice glad its working better -- I did see that vim.command_output was also finicky with really long let g: commands on macos, guessing it was a similar issue. Vim.eval is a little slower, but will leave it like this if its more stable.