Skip to content

Commit 457c7e2

Browse files
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.
1 parent 208f934 commit 457c7e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/processing/app/Base.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -821,9 +821,8 @@ protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocati
821821
if (!file.exists()) return null;
822822

823823
// Cycle through open windows to make sure that it's not already open.
824-
String path = file.getAbsolutePath();
825824
for (Editor editor : editors) {
826-
if (editor.getSketch().getMainFilePath().equals(path)) {
825+
if (editor.getSketch().getPrimaryFile().getFile().equals(file)) {
827826
editor.toFront();
828827
return editor;
829828
}

0 commit comments

Comments
 (0)