OSDN Git Service

virtual buffers: Handle the case where programmaticScrollMayFireEvent is True and...
authorJames Teh <jamie@jantrid.net>
Tue, 24 Nov 2009 05:09:27 +0000 (15:09 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 24 Nov 2009 05:09:27 +0000 (15:09 +1000)
source/virtualBuffers/__init__.py

index 5462ef6..1ee7551 100644 (file)
@@ -994,7 +994,7 @@ class VirtualBuffer(cursorManager.CursorManager):
                if not self.VBufHandle:\r
                        return False\r
 \r
-               if self.programmaticScrollMayFireEvent and time.time() - self._lastProgrammaticScrollTime < 0.4:\r
+               if self.programmaticScrollMayFireEvent and self._lastProgrammaticScrollTime and time.time() - self._lastProgrammaticScrollTime < 0.4:\r
                        # This event was probably caused by this buffer's call to scrollIntoView().\r
                        # Therefore, ignore it. Otherwise, the cursor may bounce back to the scroll point.\r
                        # However, pretend we handled it, as we don't want it to be passed on to the object either.\r