From a5b1cbfb22ade244dfbd2d60eec93f442695afc6 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Tue, 21 May 2024 16:35:47 +0200 Subject: [PATCH] [lvcs] install shortcuts for the next or previous actions only for content search These actions navigate through matches in the diff panel and are useless for the filter by file. follow-up: 2ce96bcb97736957bfb90a2e70ca05fada3f3d02 GitOrigin-RevId: cdb58b7ba8f07a5759ffadd7177705c61de65ee7 --- .../intellij/platform/lvcs/impl/ui/ActivityView.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/lvcs-impl/src/com/intellij/platform/lvcs/impl/ui/ActivityView.kt b/platform/lvcs-impl/src/com/intellij/platform/lvcs/impl/ui/ActivityView.kt index 6f5444ed4215..5ac7ae07789a 100644 --- a/platform/lvcs-impl/src/com/intellij/platform/lvcs/impl/ui/ActivityView.kt +++ b/platform/lvcs-impl/src/com/intellij/platform/lvcs/impl/ui/ActivityView.kt @@ -213,12 +213,14 @@ class ActivityView(private val project: Project, gateway: IdeaGateway, val activ val searchTextArea = SearchTextArea(textArea, true) searchTextArea.setBorder(JBUI.Borders.compound(IdeBorderFactory.createBorder(SideBorder.RIGHT), searchTextArea.border)) - dumbAwareAction { selectNextOccurence(true) }.registerCustomShortcutSet(Utils.shortcutSetOf( - Utils.shortcutsOf(IdeActions.ACTION_FIND_NEXT) + Utils.shortcutsOf(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN) - ), searchTextArea) - dumbAwareAction { selectNextOccurence(false) }.registerCustomShortcutSet(Utils.shortcutSetOf( - Utils.shortcutsOf(IdeActions.ACTION_FIND_PREVIOUS) + Utils.shortcutsOf(IdeActions.ACTION_EDITOR_MOVE_CARET_UP) - ), searchTextArea) + if (model.filterKind == FilterKind.CONTENT) { + dumbAwareAction { selectNextOccurence(true) }.registerCustomShortcutSet(Utils.shortcutSetOf( + Utils.shortcutsOf(IdeActions.ACTION_FIND_NEXT) + Utils.shortcutsOf(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN) + ), searchTextArea) + dumbAwareAction { selectNextOccurence(false) }.registerCustomShortcutSet(Utils.shortcutSetOf( + Utils.shortcutsOf(IdeActions.ACTION_FIND_PREVIOUS) + Utils.shortcutsOf(IdeActions.ACTION_EDITOR_MOVE_CARET_UP) + ), searchTextArea) + } dumbAwareAction { IdeFocusManager.getInstance(project).requestFocus(searchTextArea.textArea, true) }.registerCustomShortcutSet(Utils.shortcutSetOf(Utils.shortcutsOf(IdeActions.ACTION_FIND)), activityList)