Skip to content

Commit

Permalink
fix: integ test failures in file save as
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed May 30, 2024
1 parent 8a199bd commit 4885e37
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,10 @@ define(function (require, exports, module) {
setTimeout(()=>{
fileOpenPromise = FileViewController
.openAndSelectDocument(path, FileViewController.PROJECT_MANAGER);
// always configure editor after file is opened
fileOpenPromise.always(function () {
_configureEditorAndResolve();
});
}, 100); // this is in a timeout as the file tree may not have updated yet after save as
// file created, and we wait for the file watcher events to get triggered so that the file
// selection is updated.
Expand All @@ -1085,12 +1089,11 @@ define(function (require, exports, module) {

// Add new file to workingset, and ensure we now redraw (even if index hasn't changed)
fileOpenPromise = handleFileAddToWorkingSetAndOpen({fullPath: path, paneId: info.paneId, index: info.index, forceRedraw: true});
// always configure editor after file is opened
fileOpenPromise.always(function () {
_configureEditorAndResolve();
});
}

// always configure editor after file is opened
fileOpenPromise.always(function () {
_configureEditorAndResolve();
});
}

// Same name as before - just do a regular Save
Expand Down

0 comments on commit 4885e37

Please sign in to comment.