Skip to content

Commit 80911be

Browse files
(fix: #32) Fix Deleting Selected Range (#33)
Fix selected range deletion
1 parent 39e5ae3 commit 80911be

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/CodeEditTextView/TextView/TextView+Delete.swift

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extension TextView {
5151
) {
5252
/// Extend each selection by a distance specified by `destination`, then update both storage and the selection.
5353
for textSelection in selectionManager.textSelections {
54+
guard textSelection.range.isEmpty else { continue }
5455
let extendedRange = selectionManager.rangeOfSelection(
5556
from: textSelection.range.location,
5657
direction: direction,

0 commit comments

Comments
 (0)