[gnome-builder] buffers: save loaded buffer for applying edits



commit 81e0f9cad6951cf24074bbeb1ce0237252081fe2
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 29 17:46:52 2018 -0700

    buffers: save loaded buffer for applying edits
    
    This fixes an issue when the file to be edited is not currently open.

 src/libide/buffers/ide-buffer-manager.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/libide/buffers/ide-buffer-manager.c b/src/libide/buffers/ide-buffer-manager.c
index a83d6c858..97e284c65 100644
--- a/src/libide/buffers/ide-buffer-manager.c
+++ b/src/libide/buffers/ide-buffer-manager.c
@@ -2131,6 +2131,7 @@ ide_buffer_manager_apply_edits_buffer_loaded (GObject      *object,
   g_autoptr(GError) error = NULL;
   g_autoptr(IdeBuffer) buffer = NULL;
   EditState *state;
+  IdeFile *file;
 
   IDE_ENTRY;
 
@@ -2158,6 +2159,10 @@ ide_buffer_manager_apply_edits_buffer_loaded (GObject      *object,
   if (state->failed)
     IDE_EXIT;
 
+  /* Save the buffer for future use when applying edits */
+  file = ide_buffer_get_file (buffer);
+  g_hash_table_insert (state->buffers, g_object_ref (file), g_object_ref (buffer));
+
   /* If this is the last buffer to load, then we can go apply the edits. */
   if (state->count == 0)
     {


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