--- a/eric6/QScintilla/EditorOutline.py Wed Sep 09 18:02:39 2020 +0200 +++ b/eric6/QScintilla/EditorOutline.py Wed Sep 09 18:04:21 2020 +0200 @@ -7,7 +7,7 @@ Module implementing an outline widget for source code navigation of the editor. """ -from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication +from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication, QModelIndex from PyQt5.QtWidgets import QTreeView, QAbstractItemView, QMenu, QApplication from UI.BrowserSortFilterProxyModel import BrowserSortFilterProxyModel @@ -445,3 +445,5 @@ if index.isValid(): self.setCurrentIndex(index) self.scrollTo(index) + else: + self.setCurrentIndex(QModelIndex())