diff --git a/Sources/CodeEditTextView/TextView/TextView+Delete.swift b/Sources/CodeEditTextView/TextView/TextView+Delete.swift index 0161b13a..e8d6ecce 100644 --- a/Sources/CodeEditTextView/TextView/TextView+Delete.swift +++ b/Sources/CodeEditTextView/TextView/TextView+Delete.swift @@ -51,6 +51,7 @@ extension TextView { ) { /// Extend each selection by a distance specified by `destination`, then update both storage and the selection. for textSelection in selectionManager.textSelections { + guard textSelection.range.isEmpty else { continue } let extendedRange = selectionManager.rangeOfSelection( from: textSelection.range.location, direction: direction,