Skip to content

Commit f94ad34

Browse files
committed
Revert, there is a better fix
1 parent 3462941 commit f94ad34

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Sources/SwiftTerm/iOS/iOSTerminalView.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,13 +1127,6 @@ open class TerminalView: UIScrollView, UITextInputTraits, UIKeyInput, UIScrollVi
11271127
var rangeStartPosition = rangeToDelete.startPosition
11281128
var rangeStartIndex = rangeStartPosition.offset
11291129
if rangeToDelete.isEmpty {
1130-
// Send this to the server, regardless of our local UITextInput state
1131-
// we can end up in a situation where the does a "previous line", and we refuse to send
1132-
// the backspace, because we think there is nothing to delete.
1133-
//
1134-
// Fixes #399
1135-
self.send ([0x7f])
1136-
11371130
// If there is no selected text, delete the character before the cursor
11381131

11391132
// No delete past the beginning of the text
@@ -1146,6 +1139,7 @@ open class TerminalView: UIScrollView, UITextInputTraits, UIKeyInput, UIScrollVi
11461139
textInputStorage.remove(at: textInputStorage.index(textInputStorage.startIndex, offsetBy: rangeStartIndex))
11471140
rangeStartPosition = TextPosition(offset: rangeStartIndex)
11481141

1142+
self.send ([0x7f])
11491143
} else {
11501144
// Send as many backspaces that are in the range to delete. When on auto-repeat, after a some time
11511145
// pressing the backspace, it will delete chunks of text at a time.

0 commit comments

Comments
 (0)