[gnome-text-editor] window: dont restore empty pages
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] window: dont restore empty pages
- Date: Wed, 22 Dec 2021 04:06:08 +0000 (UTC)
commit 912933ba4b1ea8130d0d06676b1f99d624df6c9e
Author: Christian Hergert <chergert redhat com>
Date: Tue Dec 21 20:06:04 2021 -0800
window: dont restore empty pages
src/editor-window.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/editor-window.c b/src/editor-window.c
index 6d7caec..56e89c7 100644
--- a/src/editor-window.c
+++ b/src/editor-window.c
@@ -98,14 +98,15 @@ static void
remove_page (EditorWindow *self,
EditorPage *page)
{
- EditorDocument *document;
-
g_assert (EDITOR_IS_WINDOW (self));
g_assert (EDITOR_IS_PAGE (page));
/* Track page close for reopening */
- document = editor_page_get_document (page);
- add_closed_document (self, document);
+ if (!editor_page_get_can_discard (page))
+ {
+ EditorDocument *document = editor_page_get_document (page);
+ add_closed_document (self, document);
+ }
editor_session_remove_page (EDITOR_SESSION_DEFAULT, page);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]