Fixing file edit status; modified build options
This commit is contained in:
@@ -314,11 +314,14 @@ export class CodeViewBase {
|
||||
protected saveFile() {
|
||||
if (!this.activeFile) {
|
||||
this.saveFileAs();
|
||||
this.activeFile.session.getUndoManager().markClean();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const text = this.activeFile.session.getValue();
|
||||
window.fs.saveFile(this.activeFile.path, text);
|
||||
this.activeFile.session.getUndoManager().markClean();
|
||||
}
|
||||
|
||||
protected saveFileAs() {
|
||||
|
||||
@@ -227,8 +227,10 @@ export class CodeViewComponent extends CodeViewBase {
|
||||
|
||||
if (!this.activeFile) return;
|
||||
|
||||
const isClean = this.activeFile.session.getUndoManager().isClean();
|
||||
const hasUndo = this.activeFile.session.getUndoManager().hasUndo();
|
||||
let message = new ServiceMessage();
|
||||
message.action = "file-changed";
|
||||
message.action = (!isClean && hasUndo) ? "file-changed" : "file-unmodified";
|
||||
message.filePath = this.activeFile.path;
|
||||
this.tabsService.sendMessage(message);
|
||||
});
|
||||
|
||||
@@ -55,12 +55,15 @@ export class TabsComponent {
|
||||
this.tabsService.getMessage$().pipe(
|
||||
takeUntilDestroyed(this.#destroyRef)
|
||||
).subscribe((message: ServiceMessage) => {
|
||||
let elm = document.querySelector(`[title="${message.filePath}"]`);
|
||||
let elm = document.querySelector(`.tab[title="${message.filePath}"]`);
|
||||
|
||||
switch ( message.action ) {
|
||||
case "create-tab":
|
||||
this.createTab(message.fileName, message.fileUUID, message.filePath);
|
||||
break;
|
||||
case "file-unmodified":
|
||||
elm.classList.remove("file-changed");
|
||||
break;
|
||||
case "file-changed":
|
||||
elm.classList.add("file-changed");
|
||||
elm.classList.remove("file-deleted");
|
||||
|
||||
Reference in New Issue
Block a user