delete_surrounding


Description:

public virtual signal void delete_surrounding (int offset, uint n_chars)

Emitted when the input method wants to delete the context surrounding the cursor.

If offset is a negative value, it means a position before the start of the selection, or before the cursor if there is no selection. The text to be deleted can include part of the selection. If n_chars is 0, nothing is deleted and the cursor is moved by offset.

Both offset and n_chars are counted in UTF-16 code units, not in characters: a character outside the Basic Multilingual Plane, like most emoji, counts as 2. Note that the indexes passed to notify_surrounding are in bytes instead.

Parameters:

offset

the offset of the text to be deleted from the start of the selection, in UTF-16 code units

n_chars

the number of UTF-16 code units to be deleted