diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 80d356d..592fb19 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -296,7 +296,6 @@ static void     gtk_text_view_set_attributes_from_style (GtkTextView        *tex
 static void     gtk_text_view_ensure_layout          (GtkTextView        *text_view);
 static void     gtk_text_view_destroy_layout         (GtkTextView        *text_view);
 static void     gtk_text_view_check_keymap_direction (GtkTextView        *text_view);
-static void     gtk_text_view_reset_im_context       (GtkTextView        *text_view);
 static void     gtk_text_view_start_selection_drag   (GtkTextView        *text_view,
                                                       const GtkTextIter  *iter,
                                                       GdkEventButton     *event);
@@ -6552,9 +6551,22 @@ gtk_text_view_destroy_layout (GtkTextView *text_view)
     }
 }
 
-static void
+/**
+ * gtk_text_view_reset_im_context:
+ * @text_view: a #GtkTextView
+ *
+ * Reset the input method context of the text view if needed.
+ *
+ * This can be necessary in the case where modifying the buffer
+ * would confuse on-going input method behavior.
+ *
+ * Since: 2.20
+ **/
+void
 gtk_text_view_reset_im_context (GtkTextView *text_view)
 {
+  g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
+
   if (text_view->need_im_reset)
     {
       text_view->need_im_reset = FALSE;
