egslava
02/24/2016, 3:01 PMval start : Int get() = editor.selectionStart
val end : Int get() = editor.selectionEnd
val selection: Boolean get() = start != end
fun delete(start: Int, end: Int) = editor.text.delete(start, end)
And think in way of context of these functions.