From 82fd6d5adbf7d47e252fd4bc332b6cbd6a1a159b Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Wed, 1 Feb 2017 01:44:05 +0300 Subject: [PATCH] don't loose right selection during the focus ping-pong from the path field --- .../ide/util/projectWizard/ProjectSettingsStepBase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/projectWizard/ProjectSettingsStepBase.java b/platform/lang-impl/src/com/intellij/ide/util/projectWizard/ProjectSettingsStepBase.java index 6273dfad4860..6012a67b3d49 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/projectWizard/ProjectSettingsStepBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/projectWizard/ProjectSettingsStepBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -297,7 +297,9 @@ public class ProjectSettingsStepBase extends AbstractActionWithPanel implements myLocationField.setText(projectLocation); final int index = projectLocation.lastIndexOf(File.separator); if (index > 0) { - myLocationField.getTextField().select(index + 1, projectLocation.length()); + JTextField textField = myLocationField.getTextField(); + textField.select(index + 1, projectLocation.length()); + textField.putClientProperty(DialogWrapperPeer.HAVE_INITIAL_SELECTION, true); } final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();