[gnome-builder] highlight-engine: be resilient against GtkSourceBuffer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] highlight-engine: be resilient against GtkSourceBuffer
- Date: Thu, 21 May 2015 08:20:48 +0000 (UTC)
commit 0ef0202de3c6968398cc2bf163b3c58f49e2234d
Author: Christian Hergert <christian hergert me>
Date: Thu May 21 01:20:14 2015 -0700
highlight-engine: be resilient against GtkSourceBuffer
libide/ide-highlight-engine.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libide/ide-highlight-engine.c b/libide/ide-highlight-engine.c
index 6230f5a..ccd6a03 100644
--- a/libide/ide-highlight-engine.c
+++ b/libide/ide-highlight-engine.c
@@ -668,10 +668,13 @@ static void
ide_highlight_engine_set_buffer (IdeHighlightEngine *self,
IdeBuffer *buffer)
{
- g_return_if_fail (IDE_IS_HIGHLIGHT_ENGINE (self));
- g_return_if_fail (IDE_IS_BUFFER (buffer));
+ g_assert (IDE_IS_HIGHLIGHT_ENGINE (self));
+ g_assert (!buffer || GTK_IS_TEXT_BUFFER (buffer));
- if (self->buffer != buffer)
+ /*
+ * We can get GtkSourceBuffer intermittently here.
+ */
+ if (!buffer || IDE_IS_BUFFER (buffer))
{
egg_signal_group_set_target (self->signal_group, buffer);
g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_BUFFER]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]