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