[gnome-builder] project-tree: save buffer first when renaming file



commit abf0c33ab6b0eb4944b4376e9fbe00ed41464828
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 11 17:01:21 2020 -0700

    project-tree: save buffer first when renaming file

 src/plugins/project-tree/gbp-project-tree-pane-actions.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/project-tree/gbp-project-tree-pane-actions.c 
b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
index e2965e233..b111cfcbc 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane-actions.c
+++ b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
@@ -246,11 +246,16 @@ close_matching_pages (GtkWidget *widget,
   if (!IDE_IS_EDITOR_PAGE (page))
     return;
 
-  if (!(this_file = ide_editor_page_get_file (IDE_EDITOR_PAGE (page))))
+  this_file = ide_editor_page_get_file (IDE_EDITOR_PAGE (page));
+  if (this_file == NULL)
     return;
 
   if (g_file_equal (this_file, file))
-    gtk_widget_destroy (widget);
+    {
+      IdeBuffer *buffer = ide_editor_page_get_buffer (IDE_EDITOR_PAGE (page));
+      ide_buffer_save_file_async (buffer, NULL, NULL, NULL, NULL, NULL);
+      gtk_widget_destroy (widget);
+    }
 }
 
 #define DEFINE_ACTION_HANDLER(short_name, BODY)                       \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]