mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
(IDEA-167955) Find: Ctrl+F on selected word doesn't pre-select text in search field if Find bar is open
This commit is contained in:
@@ -308,8 +308,11 @@ public class SearchReplaceComponent extends EditorHeaderComponent implements Dat
|
||||
|
||||
private void updateSearchComponent(@NotNull String textToSet) {
|
||||
if (!updateTextComponent(true)) {
|
||||
if (!mySearchTextComponent.getText().equals(textToSet)) {
|
||||
String existingText = mySearchTextComponent.getText();
|
||||
if (!existingText.equals(textToSet)) {
|
||||
mySearchTextComponent.setText(textToSet);
|
||||
// textToSet should be selected even if we have no selection before (if we have the selection then setText will remain it)
|
||||
if (existingText.length() == 0) mySearchTextComponent.selectAll();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -340,8 +343,10 @@ public class SearchReplaceComponent extends EditorHeaderComponent implements Dat
|
||||
|
||||
private void updateReplaceComponent(@NotNull String textToSet) {
|
||||
if (!updateTextComponent(false)) {
|
||||
if (!myReplaceTextComponent.getText().equals(textToSet)) {
|
||||
String existingText = myReplaceTextComponent.getText();
|
||||
if (!existingText.equals(textToSet)) {
|
||||
myReplaceTextComponent.setText(textToSet);
|
||||
if (existingText.length() == 0) myReplaceTextComponent.selectAll();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user