-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Path is converted to windows style when opening with external editor in win #15096
Conversation
@@ -48,9 +48,16 @@ define(function (require, exports, module) { | |||
|
|||
var extensionToExtApplicationMap = {}; | |||
|
|||
function convertUnixPathToWindowsPath(path) { | |||
if (brackets.platform === "win") { | |||
path = path.split("/").join("\\"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should write
path = path.replace(/\//g, '\\');
Also since we are converting path to Windows, should we ensure first char is a drive letter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path = path.replace(///g, '\'); this don't work , tried it.
Other suggestion to check first char is a drive done,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this:
FileSystem.isAbsolutePath = function (fullPath) {
return (fullPath[0] === "/" || (fullPath[1] === ":" && fullPath[2] === "/"));
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also checked, and this is working:
'C:/Users/gjha/Desktop/test.js'.replace(/\//g, '\\')
"C:\Users\gjha\Desktop\test.js"
'C:/Users/gjha/Desktop/test.js'.replace(RegExp('/','g'), '\\')
"C:\Users\gjha\Desktop\test.js"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jha-G made changes as above info.
Path is converted to windows style when opening with external editor in win
some Applications like Illustrator can not open file represented in Posix style. so converting path to windows style for windows platform.
@sobisht @narayani28 @jha-G please review.