File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ def Request( self, force=False ):
5555 # - look up the actual visible range, then call this function
5656 # - if not overlapping, do the factor expansion and request
5757 self ._last_requested_range = vimsupport .RangeVisibleInBuffer ( self ._bufnr )
58+ # If this is false, either the self._bufnr is not a valid buffer number or
59+ # the buffer is not visible in any window.
60+ # Since this is called asynchronously, a user may bwipeout a buffer with
61+ # self._bufnr number between polls.
62+ if self ._last_requested_range is None :
63+ return False
64+
5865 self ._tick = vimsupport .GetBufferChangedTick ( self ._bufnr )
5966
6067 # We'll never use the last response again, so clear it
Original file line number Diff line number Diff line change @@ -206,7 +206,10 @@ class Range:
206206 start : Location = Location ()
207207 end : Location = Location ()
208208
209- buffer = vim .buffers [ bufnr ]
209+ try :
210+ buffer = vim .buffers [ bufnr ]
211+ except KeyError :
212+ return None
210213
211214 if not windows :
212215 return None
You can’t perform that action at this time.
0 commit comments