Skip to content

Commit 803a0ee

Browse files
author
Federico Fissore
committed
Merge branch 'saveas_to_parent_folder_mac' of https://github.com/delftswa2014/Arduino into delftswa2014-saveas_to_parent_folder_mac
2 parents 6f7164a + 58581e2 commit 803a0ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/src/processing/app/Sketch.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,14 @@ protected boolean saveAs() throws IOException {
647647
fd.setDirectory(Base.getSketchbookFolder().getAbsolutePath());
648648
} else {
649649
// default to the parent folder of where this was
650-
fd.setDirectory(data.getFolder().getParentFile().getAbsolutePath());
650+
// on macs a .getParentFile() method is required
651+
652+
if (OSUtils.isMacOS()) {
653+
fd.setSelectedFile(data.getFolder().getParentFile());
654+
} else {
655+
fd.setSelectedFile(data.getFolder());
656+
}
657+
651658
}
652659
String oldName = data.getName();
653660
fd.setFile(oldName);

0 commit comments

Comments
 (0)