DeleteSurroundingTextCommand

Class

Common
class DeleteSurroundingTextCommand(val lengthBeforeCursor: Int, val lengthAfterCursor: Int) :
    EditCommand

Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Before and after refer to the order of the characters in the string, not to their visual representation.

See deleteSurroundingText(https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#deleteSurroundingText(int,%2520int)).

Parameters

lengthBeforeCursorThe number of characters in UTF-16 before the cursor to be deleted. Must be non-negative.
lengthAfterCursorThe number of characters in UTF-16 after the cursor to be deleted. Must be non-negative.