From 84a25e60d4d049e850f9289ca0bd115755a8ea3c Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 5 Oct 2018 13:58:55 +0300 Subject: [PATCH] IDEA-199540: request focus on tab switching --- .../ide/fileTemplates/impl/AllFileTemplatesConfigurable.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java index a6c4d68f3a34..cb79b5709bf5 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java @@ -359,12 +359,15 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable, Con private void onTabChanged() { applyEditor(myCurrentTab.getSelectedTemplate()); + FileTemplateTab tab = myCurrentTab; final int selectedIndex = myTabbedPane.getSelectedIndex(); if (0 <= selectedIndex && selectedIndex < myTabs.length) { myCurrentTab = myTabs[selectedIndex]; } ((CardLayout)myLeftPanel.getLayout()).show(myLeftPanel, myCurrentTab.getTitle()); onListSelectionChanged(); + // request focus to a list (or tree) later to avoid moving focus to the tabbed pane + if (tab != myCurrentTab) EventQueue.invokeLater(myCurrentTab.getComponent()::requestFocus); } private void onListSelectionChanged() {