diff --git a/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt b/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt index 83ebdf14441a..3c3c96ead547 100644 --- a/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt +++ b/platform/searchEverywhere/frontend/src/ui/SePopupContentPane.kt @@ -988,9 +988,8 @@ class SePopupContentPane( private fun autoSelectIndex(searchPattern: String, isEndEvent: Boolean) { val indexToSelect = selectionListener.getIndexToSelect(getMaxVisibleRowCount(), searchPattern, textField.isInitialSearchPattern, isEndEvent) - if (indexToSelect != -1 && indexToSelect < resultListModel.size()) { + if (indexToSelect != -1 && indexToSelect < resultListModel.size() && indexToSelect != resultList.selectedIndex) { resultList.autoSelectIndex(indexToSelect) - ScrollingUtil.ensureIndexIsVisible(resultList, resultList.selectedIndex, 1) } } diff --git a/platform/searchEverywhere/frontend/src/ui/SeResultJBList.kt b/platform/searchEverywhere/frontend/src/ui/SeResultJBList.kt index 56cea1bffb6b..f0a33dc29e0e 100644 --- a/platform/searchEverywhere/frontend/src/ui/SeResultJBList.kt +++ b/platform/searchEverywhere/frontend/src/ui/SeResultJBList.kt @@ -8,10 +8,8 @@ import javax.swing.ListModel @ApiStatus.Internal class SeResultJBList(model: ListModel) : JBList(model) { - - private var _isAutoSelectionChange: Boolean = false - val isAutoSelectionChange: Boolean - get() = _isAutoSelectionChange + var isAutoSelectionChange: Boolean = false + private set /** * Returns the number of items in the result list, excluding the loading indicator. @@ -31,8 +29,8 @@ class SeResultJBList(model: ListModel) : JBList(model @RequiresEdt fun autoSelectIndex(index: Int) { - _isAutoSelectionChange = true + isAutoSelectionChange = true selectedIndex = index - _isAutoSelectionChange = false + isAutoSelectionChange = false } } \ No newline at end of file