eric6/UI/Browser.py

changeset 8260
2161475d9639
parent 8258
82b608e352ec
child 8270
6ba3564b7161
--- a/eric6/UI/Browser.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/UI/Browser.py	Thu Apr 22 18:02:47 2021 +0200
@@ -799,10 +799,11 @@
         if self.model().rowCount() == 0:
             return
         
-        if self.currentIndex().isValid():
-            startIndex = self.currentIndex()
-        else:
-            startIndex = self.model().index(0, 0)
+        startIndex = (
+            self.currentIndex()
+            if self.currentIndex().isValid() else
+            self.model().index(0, 0)
+        )
         
         keyboardSearchTimeWasValid = self._keyboardSearchTimer.isValid()
         keyboardSearchTimeElapsed = self._keyboardSearchTimer.restart()

eric ide

mercurial