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

Error with split windows #9

Open
real-or-random opened this issue May 18, 2018 · 2 comments
Open

Error with split windows #9

real-or-random opened this issue May 18, 2018 · 2 comments

Comments

@real-or-random
Copy link
Contributor

  1. Open file supported by DyeVim
  2. Split the window
  3. Scroll 1 tick up and 1 tick down with scroll wheel in new window

Result:

Error detected while processing function <SNR>151_OnCursorMoved:
line    1:
  File "<string>", line 1, in <module>
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/dyevim.py", line 66, in OnCursorMoved
    self._windows[ self._GetCurrentWId() ].OnCursorMoved()
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/window.py", line 75, in OnCursorMoved
    self.OnViewportChanged( current )
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/window.py", line 87, in OnViewportChanged
    self._CreateMatchesForInterval( view )
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/window.py", line 57, in _CreateMatchesForInterval
    for sr in self._buffer.GetSkippedRanges( view ):
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/buffer.py", line 81, in GetSkippedRanges
    self._QuerySkippedRanges()
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/DyeVim/autoload/../python/dye/buffer.py", line 90, in _QuerySkippedRanges
    self._timeout )
  File "/home/tim/.config/haskell-vim-now/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 649, in GetSkippedRanges
    buffer = vim.buffers[ bufnr ]
ValueError: number must be greater than zero  

(Other cursor moves in step 3 yield essentially the same result but then the stack trace is output line by line.)

@davits
Copy link
Owner

davits commented May 21, 2018

The problem is that on :split command OnBufEnter autocmd is not called, since the buffer is the same.
The problem is solved by adding call self.OnBufferEnter() in the OnWindowEnter() function after this line

self._SetCurrentWId()

Please give it a try, meanwhile I'll see if there is a better solution.

@real-or-random
Copy link
Contributor Author

That change fixes the problem.

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