fix(edit-file-vim) check is file changed on close

This commit is contained in:
coderaiser 2018-06-06 17:04:08 +03:00
parent b5ff6695e1
commit e2cdcbd5ce
2 changed files with 4 additions and 3 deletions

View file

@ -14,6 +14,7 @@ CloudCmd.EditFileVim = function EditFileVimProto(callback) {
bindKeys: false,
beforeClose: () => {
Events.rmKey(listener);
CloudCmd.EditFile.isChanged();
}
};

View file

@ -29,7 +29,7 @@ CloudCmd.EditFile = function EditFileProto(callback) {
const ConfigView = {
beforeClose: () => {
exec.ifExist(Menu, 'hide');
isChanged();
EditFile.isChanged();
}
};
@ -182,7 +182,7 @@ CloudCmd.EditFile = function EditFileProto(callback) {
MSG_CHANGED = 'Do you want to save changes to ' + name + '?';
}
function isChanged() {
EditFile.isChanged = () => {
const editor = CloudCmd.Edit.getEditor();
const is = editor.isChanged();
@ -194,7 +194,7 @@ CloudCmd.EditFile = function EditFileProto(callback) {
.then(() => {
editor.save();
});
}
};
init(callback);