[gnome-builder] source-view: reapply modelines after buffer save



commit a7d22ba4a103dae3c51af696163b1d03d5e7f49d
Author: Christian Hergert <christian hergert me>
Date:   Wed May 6 15:31:54 2015 -0700

    source-view: reapply modelines after buffer save

 libide/ide-source-view.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 2655745..5185f2b 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -1308,6 +1308,16 @@ ide_source_view__buffer_loaded_cb (IdeSourceView *self,
 }
 
 static void
+ide_source_view__buffer_saved_cb (IdeSourceView *self,
+                                  IdeBuffer     *buffer)
+{
+  g_assert (IDE_IS_SOURCE_VIEW (self));
+  g_assert (IDE_IS_BUFFER (buffer));
+
+  modeline_parser_apply_modeline (GTK_SOURCE_VIEW (self));
+}
+
+static void
 ide_source_view_bind_buffer (IdeSourceView  *self,
                              IdeBuffer      *buffer,
                              EggSignalGroup *group)
@@ -5742,6 +5752,11 @@ ide_source_view_init (IdeSourceView *self)
                                    G_CALLBACK (ide_source_view__buffer_loaded_cb),
                                    self,
                                    G_CONNECT_SWAPPED);
+  egg_signal_group_connect_object (priv->buffer_signals,
+                                   "saved",
+                                   G_CALLBACK (ide_source_view__buffer_saved_cb),
+                                   self,
+                                   G_CONNECT_SWAPPED);
   g_signal_connect_object (priv->buffer_signals,
                            "bind",
                            G_CALLBACK (ide_source_view_bind_buffer),


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