[gtksourceview/wip/chergert/vim] give warning about double pushing state
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] give warning about double pushing state
- Date: Tue, 2 Nov 2021 22:25:55 +0000 (UTC)
commit 468fec9a548a9d7c4f870b0554e81520df247fba
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 2 15:25:35 2021 -0700
give warning about double pushing state
gtksourceview/vim/gtk-source-vim-state.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index e39b1870..37970a47 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -445,6 +445,14 @@ gtk_source_vim_state_push (GtkSourceVimState *self,
g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (new_state));
g_return_if_fail (gtk_source_vim_state_get_parent (new_state) == NULL);
+ if (priv->child != NULL)
+ {
+ g_warning ("Attempt to push state %s onto %s when it already has a %s",
+ G_OBJECT_TYPE_NAME (new_state),
+ G_OBJECT_TYPE_NAME (self),
+ G_OBJECT_TYPE_NAME (priv->child));
+ }
+
/* Associate the state with our view and set @self as parent to
* hold the ref back to @self. We will not hold a reference to
* @new_state to avoid a circular reference.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]