Skip to content

Commit

Permalink
Remoal of action tracker references on file removal
Browse files Browse the repository at this point in the history
- Don't reference action tracker and undo pointers in case file is Deleted in the background. That data structure is no longer available.
  • Loading branch information
exsilium committed Oct 2, 2018
1 parent 15b27bc commit d5536d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugins-client/ext.watcher/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ module.exports = ext.register("ext/watcher/watcher", {
file + " has been deleted, or is no longer available.",
"Do you wish to keep the file open in the editor?",
function() { // Yes
// When you keep the file open and re-save, it might get deleted again in the background
// as of now, that second time deletion is not detected FIXME
delete _self.removedPaths[path];
page.$at.undo_ptr = {}; // set undo pointer to non existing change
page.$at.dispatchEvent("afterchange");
winQuestion.hide();
},
function() { // Yes to all
_self.removedPaths = {};
tabEditors.getPages().forEach(function (page) {
page.$at.undo_ptr = {}; // set undo pointer to non existing change
page.$at.dispatchEvent("afterchange");
});
winQuestion.hide();
},
function() { // No
Expand Down

0 comments on commit d5536d3

Please sign in to comment.