Skip to content

Commit 117332d

Browse files
Merge pull request #17 from tkeithblack/master
Fixed crash when inserting text and multiple images.
2 parents faebe27 + b2fdc83 commit 117332d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Views/InputTextView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ open class InputTextView: UITextView {
347347
attachments.forEach { (attachment) in
348348
let (range, image) = attachment
349349
if curLocation < range.location {
350-
let textRange = NSMakeRange(curLocation, range.location)
350+
let textRange = NSMakeRange(curLocation, range.location-curLocation)
351351
let text = attributedText.attributedSubstring(from: textRange).string.trimmingCharacters(in: .whitespacesAndNewlines)
352352
if !text.isEmpty {
353353
components.append(text)

0 commit comments

Comments
 (0)