[gnome-builder] code: ensure empty temporary files are saved to disk



commit 5b6ef9f875e89dbaa79c05d4c342fa711a5c207b
Author: Christian Hergert <chergert redhat com>
Date:   Sat Apr 6 09:50:11 2019 -0700

    code: ensure empty temporary files are saved to disk
    
    If the user sets a file to be saved, then we want to ensure that even
    empty temporary files get a new file on disk.
    
    Fixes #876

 src/libide/code/ide-buffer.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 224832445..5978216c8 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -1541,6 +1541,10 @@ ide_buffer_save_file_async (IdeBuffer            *self,
     {
       _ide_buffer_set_file (self, file);
       self->is_temporary = FALSE;
+
+      /* The buffer might be empty, so mark it as modified so we really save */
+      gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (self), TRUE);
+
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_IS_TEMPORARY]);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TITLE]);
     }


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