You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle possible errors from RangeVisibleInBuffer()
First and more common error is that by the time we execute
buffer = vim.buffers[ bufnr ]
the buffer might not be there any more. This is because
`RangeVisibleInBuffer()` is called asynchronously and the user may bwipeout
a buffer in between polls.
This regularly happens in our vim tests. In such a case, we get a nasty
traceback from `vimsupport` module.
The solution is to catch the KeyError and return None.
However, `ScrollingBufferRange()` also was not ready to handle None values
from `RangeVisibleInBuffer()`, even though `RangeVisibleInBuffer()` could return
None even before, if a visible window for `bufnr` can not be found.
0 commit comments