Commit 0953a117 authored by Christian Hergert's avatar Christian Hergert

buffer: add GtkSourceBuffer::cursor-moved signal

This is commonly implemented in subclasses, so it seems reasonable to add
it upstream within GtkSourceBuffer directly now that it will not collide
with subclasses.
parent 33e5e881
......@@ -136,6 +136,7 @@
enum
{
CURSOR_MOVED,
HIGHLIGHT_UPDATED,
SOURCE_MARK_UPDATED,
UNDO,
......@@ -370,6 +371,21 @@ gtk_source_buffer_class_init (GtkSourceBufferClass *klass)
g_object_class_install_properties (object_class, N_PROPERTIES, buffer_properties);
/**
* GtkSourceBuffer::cursor-moved:
* @buffer: a #GtkSourceBuffer
*
* The "cursor-moved" signal is emitted when then insertion mark has moved.
*
* Since: 5.0
*/
buffer_signals[CURSOR_MOVED] =
g_signal_new_class_handler ("cursor-moved",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* GtkSourceBuffer::highlight-updated:
* @buffer: the buffer that received the signal
......@@ -971,6 +987,8 @@ static void
cursor_moved (GtkSourceBuffer *buffer)
{
queue_bracket_highlighting_update (buffer);
g_signal_emit (buffer, buffer_signals[CURSOR_MOVED], 0);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment