stuff
This commit is contained in:
@ -133,10 +133,10 @@
|
||||
projectEditor.setContent(value);
|
||||
}
|
||||
|
||||
function handleNewEmptyFile() {
|
||||
async function handleNewEmptyFile() {
|
||||
const emptyTemplate = templateRegistry.getEmpty();
|
||||
const result = projectEditor.requestSwitch(() =>
|
||||
projectEditor.createNew(emptyTemplate.content),
|
||||
const result = projectEditor.requestSwitch(async () =>
|
||||
await projectEditor.createNew(emptyTemplate.content, emptyTemplate.mode),
|
||||
);
|
||||
|
||||
if (result === "confirm-unsaved") {
|
||||
@ -148,11 +148,11 @@
|
||||
uiState.showTemplateDialog();
|
||||
}
|
||||
|
||||
function handleTemplateSelect(template: CsoundTemplate) {
|
||||
async function handleTemplateSelect(template: CsoundTemplate) {
|
||||
uiState.hideTemplateDialog();
|
||||
|
||||
const result = projectEditor.requestSwitch(() =>
|
||||
projectEditor.createNew(template.content),
|
||||
const result = projectEditor.requestSwitch(async () =>
|
||||
await projectEditor.createNew(template.content, template.mode),
|
||||
);
|
||||
|
||||
if (result === "confirm-unsaved") {
|
||||
@ -181,11 +181,6 @@
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
if (projectEditor.isNewUnsavedBuffer) {
|
||||
uiState.showSaveAsDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
await projectEditor.save();
|
||||
}
|
||||
|
||||
@ -208,14 +203,8 @@
|
||||
}
|
||||
|
||||
async function handleSwitchSave() {
|
||||
const result = await projectEditor.confirmSaveAndSwitch();
|
||||
|
||||
if (result === "show-save-as") {
|
||||
uiState.hideUnsavedChangesDialog();
|
||||
uiState.showSaveAsDialog();
|
||||
} else {
|
||||
uiState.hideUnsavedChangesDialog();
|
||||
}
|
||||
await projectEditor.confirmSaveAndSwitch();
|
||||
uiState.hideUnsavedChangesDialog();
|
||||
}
|
||||
|
||||
function handleSwitchDiscard() {
|
||||
|
||||
Reference in New Issue
Block a user