GtkSourceIter: libgedit-gtksourceview 300 Reference Manual

## GtkSourceIter GtkSourceIter — GtkTextIter utility functions |

## Functions

void | gtk_source_iter_get_leading_spaces_end_boundary ()
void | gtk_source_iter_get_trailing_spaces_start_boundary ()
gchar * | gtk_source_iter_get_line_indentation ()
gboolean | gtk_source_iter_starts_string ()
gboolean | gtk_source_iter_ends_string ()

## Includes

    #include <gtksourceview/gtksource.h>

## Description

GtkTextIter utility functions.

## Functions

### gtk_source_iter_get_leading_spaces_end_boundary ()

    void
    gtk_source_iter_get_leading_spaces_end_boundary
                                   (const GtkTextIter *iter,
                                    GtkTextIter *leading_end);

Gets the boundary, on `iter` 's line, between leading whitespaces (indentation) and the text.

#### Parameters

iter | the input GtkTextIter. |
leading_end | the output. | [out][not optional]

Since: 299.6

### gtk_source_iter_get_trailing_spaces_start_boundary ()

    void
    gtk_source_iter_get_trailing_spaces_start_boundary
                                   (const GtkTextIter *iter,
                                    GtkTextIter *trailing_start);

Gets the boundary, on `iter` 's line, between the end of the text and trailing whitespaces.

#### Parameters

iter | the input GtkTextIter. |
trailing_start | the output. | [out][not optional]

Since: 299.6

### gtk_source_iter_get_line_indentation ()

    gchar *
    gtk_source_iter_get_line_indentation (const GtkTextIter *iter);

Gets the indentation, as a string, of the line at `iter` . `iter` can be anywhere in the line.

Possible use-case: to implement an action that inserts some text in a GtkTextBuffer. If the text to insert spans multiple lines, it is sometimes desired to keep the same indentation level.

#### Parameters

iter | a GtkTextIter. |

#### Returns

the line indentation at `iter` .

[transfer full]

Since: 299.6

### gtk_source_iter_starts_string ()

    gboolean
    gtk_source_iter_starts_string (const GtkTextIter *iter,
                                   const gchar *str,
                                   GtkTextIter *match_end);

#### Parameters

iter | a GtkTextIter. |
str | a non-empty UTF-8 string. |
match_end | output for the GtkTextIter located at the end of `str` . This output parameter is set only when this function returns `TRUE`. | [out][optional]

#### Returns

`TRUE` if and only if `str` is found at (exactly) the `iter` position.

Since: 299.6

### gtk_source_iter_ends_string ()

    gboolean
    gtk_source_iter_ends_string (const GtkTextIter *iter,
                                 const gchar *str,
                                 GtkTextIter *match_start);

#### Parameters

iter | a GtkTextIter. |
str | a non-empty UTF-8 string. |
match_start | output for the GtkTextIter located at the start of `str` . This output parameter is set only when this function returns `TRUE`. | [out][optional]

#### Returns

`TRUE` if and only if `str` ends at (exactly) the `iter` position.

Since: 299.6