Fixing file edit status; modified build options
This commit is contained in:
@@ -13,7 +13,10 @@
|
|||||||
"electron-start": "electron . --trace-warnings --start-as=build --ipc-port=4588",
|
"electron-start": "electron . --trace-warnings --start-as=build --ipc-port=4588",
|
||||||
"electron-pack": "ng build --base-href ./ && electron-builder --dir",
|
"electron-pack": "ng build --base-href ./ && electron-builder --dir",
|
||||||
"electron-dist": "ng build --base-href ./ && electron-builder",
|
"electron-dist": "ng build --base-href ./ && electron-builder",
|
||||||
"electron-dist-linux": "ng build --base-href ./ && electron-builder --linux deb zip AppImage",
|
"electron-dist-appimage-linux": "ng build --base-href ./ && electron-builder --linux AppImage",
|
||||||
|
"electron-dist-deb-linux": "ng build --base-href ./ && electron-builder --linux deb",
|
||||||
|
"electron-dist-zip-linux": "ng build --base-href ./ && electron-builder --linux zip",
|
||||||
|
"electron-dist-all-linux": "ng build --base-href ./ && electron-builder --linux deb zip AppImage",
|
||||||
"electron-dist-all": "ng build --base-href ./ && electron-builder -mwl",
|
"electron-dist-all": "ng build --base-href ./ && electron-builder -mwl",
|
||||||
"electron-concurrently": "concurrently 'ng serve' 'electron . --trace-warnings --start-as=ng-serve'",
|
"electron-concurrently": "concurrently 'ng serve' 'electron . --trace-warnings --start-as=ng-serve'",
|
||||||
"ng-serve": "ng serve",
|
"ng-serve": "ng serve",
|
||||||
|
|||||||
@@ -314,11 +314,14 @@ export class CodeViewBase {
|
|||||||
protected saveFile() {
|
protected saveFile() {
|
||||||
if (!this.activeFile) {
|
if (!this.activeFile) {
|
||||||
this.saveFileAs();
|
this.saveFileAs();
|
||||||
|
this.activeFile.session.getUndoManager().markClean();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const text = this.activeFile.session.getValue();
|
const text = this.activeFile.session.getValue();
|
||||||
window.fs.saveFile(this.activeFile.path, text);
|
window.fs.saveFile(this.activeFile.path, text);
|
||||||
|
this.activeFile.session.getUndoManager().markClean();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected saveFileAs() {
|
protected saveFileAs() {
|
||||||
|
|||||||
@@ -227,8 +227,10 @@ export class CodeViewComponent extends CodeViewBase {
|
|||||||
|
|
||||||
if (!this.activeFile) return;
|
if (!this.activeFile) return;
|
||||||
|
|
||||||
|
const isClean = this.activeFile.session.getUndoManager().isClean();
|
||||||
|
const hasUndo = this.activeFile.session.getUndoManager().hasUndo();
|
||||||
let message = new ServiceMessage();
|
let message = new ServiceMessage();
|
||||||
message.action = "file-changed";
|
message.action = (!isClean && hasUndo) ? "file-changed" : "file-unmodified";
|
||||||
message.filePath = this.activeFile.path;
|
message.filePath = this.activeFile.path;
|
||||||
this.tabsService.sendMessage(message);
|
this.tabsService.sendMessage(message);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,12 +55,15 @@ export class TabsComponent {
|
|||||||
this.tabsService.getMessage$().pipe(
|
this.tabsService.getMessage$().pipe(
|
||||||
takeUntilDestroyed(this.#destroyRef)
|
takeUntilDestroyed(this.#destroyRef)
|
||||||
).subscribe((message: ServiceMessage) => {
|
).subscribe((message: ServiceMessage) => {
|
||||||
let elm = document.querySelector(`[title="${message.filePath}"]`);
|
let elm = document.querySelector(`.tab[title="${message.filePath}"]`);
|
||||||
|
|
||||||
switch ( message.action ) {
|
switch ( message.action ) {
|
||||||
case "create-tab":
|
case "create-tab":
|
||||||
this.createTab(message.fileName, message.fileUUID, message.filePath);
|
this.createTab(message.fileName, message.fileUUID, message.filePath);
|
||||||
break;
|
break;
|
||||||
|
case "file-unmodified":
|
||||||
|
elm.classList.remove("file-changed");
|
||||||
|
break;
|
||||||
case "file-changed":
|
case "file-changed":
|
||||||
elm.classList.add("file-changed");
|
elm.classList.add("file-changed");
|
||||||
elm.classList.remove("file-deleted");
|
elm.classList.remove("file-deleted");
|
||||||
|
|||||||
Reference in New Issue
Block a user