Skip to content

Commit

Permalink
reset file after the editor/viewer got closed, fixes problem with not…
Browse files Browse the repository at this point in the history
… opening the same file
  • Loading branch information
peuter committed Nov 25, 2019
1 parent ca30a35 commit 00c525f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions source/class/cv/ui/manager/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ qx.Class.define('cv.ui.manager.Main', {
selectionIndex = openFiles.indexOf(openFile);
}
openFiles.remove(openFile);
var currentHandler = this._stack.getSelection()[0];
if (qx.Class.hasInterface(currentHandler.constructor, cv.ui.manager.editor.IEditor)) {
// reset the handlers file
currentHandler.resetFile();
}
if (this.getOpenFiles().length === 0) {
this._stack.resetSelection();
this.__actionDispatcher.resetFocusedWidget();
Expand All @@ -445,6 +450,7 @@ qx.Class.define('cv.ui.manager.Main', {
if (oldModel) {
oldModel.dispose();
}
// dispose the
}
},

Expand Down
5 changes: 4 additions & 1 deletion source/class/cv/ui/manager/editor/Source.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ qx.Class.define('cv.ui.manager.editor.Source', {
},

_applyContent: function(value) {
var model = this._editor.getModel();
var file = this.getFile();
if (!file) {
return;
}
var model = this._editor.getModel();
if (this._workerWrapper) {
this._workerWrapper.open(file, value);
}
Expand Down

0 comments on commit 00c525f

Please sign in to comment.