From bef8cf3218ddfe36fd451233c49488bf0a2c1484 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Mon, 3 Mar 2025 22:19:40 +0100 Subject: [PATCH] save note when it is detached --- application/notebook.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } } -- 2.43.5