mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(edit-file-vim) check is file changed on close
This commit is contained in:
parent
b5ff6695e1
commit
e2cdcbd5ce
2 changed files with 4 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ CloudCmd.EditFileVim = function EditFileVimProto(callback) {
|
|||
bindKeys: false,
|
||||
beforeClose: () => {
|
||||
Events.rmKey(listener);
|
||||
CloudCmd.EditFile.isChanged();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue