Virtual Method

IdeIndenterformat

since: 3.32

Declaration

gchar*
format (
  IdeIndenter* self,
  GtkTextView* text_view,
  GtkTextIter* begin,
  GtkTextIter* end,
  gint* cursor_offset,
  GdkEventKey* event
)

Description

This function performs an indentation for the key press activated by event. The implementation is free to move the begin and end iters to swallow adjacent content. The result, a string, is the contents that will replace the content inbetween begin and end.

cursor_offset may be set to jump the cursor starting from end. Negative values are allowed.

If self is NULL, the fallback indenter is used, which tries to mimic the indentation style of GtkSourceView.

Available since: 3.32

Parameters

text_view

Type: GtkTextView

A GtkTextView.

The data is owned by the caller of the function.
begin

Type: GtkTextIter

A GtkTextIter for the beginning region of text to replace.

The data is owned by the caller of the function.
end

Type: GtkTextIter

A GtkTextIter for the end region of text to replace.

The data is owned by the caller of the function.
cursor_offset

Type: gint*

The offset in characters from end to place the cursor. Negative values are okay.

The argument will be set by the function.
event

Type: GdkEventKey

The GdkEventKey that triggered the event.

The data is owned by the caller of the function.

Return value

Type: gchar*

A string containing the replacement text, or NULL.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.
The value is a NUL terminated UTF-8 string.