diff --git a/client/modules/edit-file-vim.js b/client/modules/edit-file-vim.js index 68398db9..e153ccb4 100644 --- a/client/modules/edit-file-vim.js +++ b/client/modules/edit-file-vim.js @@ -14,6 +14,7 @@ CloudCmd.EditFileVim = function EditFileVimProto(callback) { bindKeys: false, beforeClose: () => { Events.rmKey(listener); + CloudCmd.EditFile.isChanged(); } }; diff --git a/client/modules/edit-file.js b/client/modules/edit-file.js index cfde7b9f..a2f56bd8 100644 --- a/client/modules/edit-file.js +++ b/client/modules/edit-file.js @@ -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);