Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information