Skip to content

Commit

Permalink
Enforcing path normalization when opening files/folders
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Jul 21, 2017
1 parent e59a95f commit 15cbcdf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const Utils = {

open ( filepath, isTextDocument = true ) {

filepath = path.normalize ( filepath );

const fileuri = vscode.Uri.file ( filepath );

if ( isTextDocument ) {
Expand Down Expand Up @@ -136,7 +138,11 @@ const Utils = {

open ( folderpath, inNewWindow? ) {

vscode.commands.executeCommand ( 'vscode.openFolder', vscode.Uri.parse ( `file://${folderpath}` ), inNewWindow );
folderpath = path.normalize ( folderpath );

const folderuri = vscode.Uri.file ( folderpath );

vscode.commands.executeCommand ( 'vscode.openFolder', folderuri, inNewWindow );

},

Expand Down

0 comments on commit 15cbcdf

Please sign in to comment.