Various fixes

This commit is contained in:
Ilya Laktyushin
2023-02-06 00:55:17 +04:00
parent b92a46ee58
commit bf94ea75e9
39 changed files with 202 additions and 141 deletions

View File

@@ -418,7 +418,7 @@ public func foldLineBreaks(_ text: NSAttributedString) -> NSAttributedString {
while true {
if let range = remainingString.string.range(of: "\n") {
let mappedRange = NSRange(range, in: remainingString.string)
lines.append(remainingString.attributedSubstring(from: NSRange(location: 0, length: mappedRange.upperBound)))
lines.append(remainingString.attributedSubstring(from: NSRange(location: 0, length: mappedRange.upperBound - 1)))
remainingString.replaceCharacters(in: NSRange(location: 0, length: mappedRange.upperBound), with: "")
} else {
if lines.isEmpty {