mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
New editor on MacOSX: CMD+E uses selection to find next entry. Fixes #3147
This commit is contained in:
parent
d71f2738c4
commit
65e0d8b547
@ -1422,7 +1422,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
if (find == null) {
|
||||
find = new FindReplace(Editor.this);
|
||||
}
|
||||
if (!OSUtils.isMacOS() && getSelectedText() != null) {
|
||||
if (!OSUtils.isMacOS()) {
|
||||
find.setFindText(getSelectedText());
|
||||
}
|
||||
find.setLocationRelativeTo(Editor.this);
|
||||
@ -1458,11 +1458,8 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
if (find == null) {
|
||||
find = new FindReplace(Editor.this);
|
||||
}
|
||||
if (getSelectedText() != null) {
|
||||
find.setFindText(getSelectedText());
|
||||
}
|
||||
find.setLocationRelativeTo(Editor.this);
|
||||
find.setVisible(true);
|
||||
find.setFindText(getSelectedText());
|
||||
find.findNext();
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
@ -439,9 +439,12 @@ public class FindReplace extends JFrame implements ActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void setFindText(String t) {
|
||||
findField.setText(t);
|
||||
findString = t;
|
||||
public void setFindText(String text) {
|
||||
if (text == null) {
|
||||
return;
|
||||
}
|
||||
findField.setText(text);
|
||||
findString = text;
|
||||
}
|
||||
|
||||
public void findNext() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user