From: Olaf Wintermann Date: Mon, 3 Mar 2025 21:19:40 +0000 (+0100) Subject: save note when it is detached X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=bef8cf3218ddfe36fd451233c49488bf0a2c1484;p=note.git save note when it is detached --- diff --git a/application/notebook.c b/application/notebook.c index 106bb14..2982877 100644 --- a/application/notebook.c +++ b/application/notebook.c @@ -139,8 +139,13 @@ void notebookmodel_attach_note(NotebookModel *model, Note *note) { } void notebookmodel_detach_current_note(NotebookModel *model) { - if(model->current_note && model->current_note->model) { - ui_detach_document2(model->ctx, model->current_note->model); + if(model->current_note) { + if(model->current_note->model->modified) { + note_save(model->window->obj, model, model->current_note); + } + if(model->current_note->model) { + ui_detach_document2(model->ctx, model->current_note->model); + } model->current_note = NULL; } }