In `Base.handleOpen()`, compare Files rather than Strings

Comparing a File object automatically takes care of filesystem case
sensitivity, whereas strings do not, so this makes the comparison
slightly more reliable.
This commit is contained in:
Matthijs Kooijman 2015-12-29 17:54:22 +01:00 committed by Martino Facchin
parent 59b70c8373
commit 94754d7841
1 changed files with 1 additions and 2 deletions

View File

@ -816,9 +816,8 @@ public class Base {
if (!file.exists()) return null; if (!file.exists()) return null;
// Cycle through open windows to make sure that it's not already open. // Cycle through open windows to make sure that it's not already open.
String path = file.getAbsolutePath();
for (Editor editor : editors) { for (Editor editor : editors) {
if (editor.getSketch().getMainFilePath().equals(path)) { if (editor.getSketch().getPrimaryFile().getFile().equals(file)) {
editor.toFront(); editor.toFront();
return editor; return editor;
} }