Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit b5d9ffd

Browse files
author
Nitesh Kumar
committed
Binary file should not be opened if associated with external application
1 parent 7f5f064 commit b5d9ffd

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/language/languages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
"jsz", "lib", "mpeg", "mpg", "mp4", "msi", "node", "o", "obj", "odc",
292292
"odb", "odf", "odg", "odp", "ods", "odt", "otf", "pak", "pdb", "pdf",
293293
"pdi", "ppt", "pptx", "psd", "rar", "sdf", "so", "sqlite", "suo", "svgz",
294-
"swf", "tar", "tif", "tiff", "ttf", "woff", "xls", "xlsx", "zip"
294+
"swf", "tar", "tif", "tiff", "ttf", "woff", "xls", "xlsx", "zip", "xd"
295295
],
296296
"isBinary": true
297297
},

src/project/FileTreeView.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,16 @@ define(function (require, exports, module) {
555555
});
556556
}
557557
} else {
558-
this.props.actions.setSelected(this.myPath(),
559-
FileUtils.shouldOpenInExternalApplication(
560-
FileUtils.getFileExtension(this.myPath()).toLowerCase()
561-
));
558+
var language = LanguageManager.getLanguageForPath(this.myPath()),
559+
doNotOpen = false;
560+
if (language && language.isBinary() && "image" !== language.getId() &&
561+
FileUtils.shouldOpenInExternalApplication(
562+
FileUtils.getFileExtension(this.myPath()).toLowerCase()
563+
)
564+
) {
565+
doNotOpen = true;
566+
}
567+
this.props.actions.setSelected(this.myPath(), doNotOpen);
562568
}
563569
e.stopPropagation();
564570
e.preventDefault();

0 commit comments

Comments
 (0)