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

Commit b4abc5a

Browse files
authored
Merge pull request #15096 from niteskum/WinPathIssueWithExtEditor
Path is converted to windows style when opening with external editor in win
2 parents 406b44c + ee9ede2 commit b4abc5a

File tree

1 file changed

+8
-1
lines changed
  • src/extensions/default/OpenWithExternalApplication

1 file changed

+8
-1
lines changed

src/extensions/default/OpenWithExternalApplication/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ define(function (require, exports, module) {
4848

4949
var extensionToExtApplicationMap = {};
5050

51+
function convertUnixPathToWindowsPath(path) {
52+
if (brackets.platform === "win" && path && path[1] === ":" && path[2] === "/") {
53+
path = path.replace(RegExp('/','g'), '\\');
54+
}
55+
return path;
56+
}
57+
5158
function _openWithExternalApplication(event, path) {
5259
_nodeDomain.exec("open", {
53-
path: path,
60+
path: convertUnixPathToWindowsPath(path),
5461
app: extensionToExtApplicationMap[FileUtils.getFileExtension(path).toLowerCase()]
5562
});
5663
}

0 commit comments

Comments
 (0)