Skip to content

Commit

Permalink
Apply newline attribute only to \n and not all newline chars like sof…
Browse files Browse the repository at this point in the history
…t-return (#328)
  • Loading branch information
rajdeep authored Jul 15, 2024
1 parent 50d742e commit 21a098d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Proton/Sources/ObjC/PRTextStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ - (void)replaceCharactersInRange:(NSRange)range withAttributedString:(NSAttribut
// To maintain a consistent state of attributes, adding newline attributes to
// all newline characters in the replacement string.
NSArray<NSValue*> *newlineRangeValues =
[replacementString.string rangesOfCharacterSet:[NSCharacterSet newlineCharacterSet]];
[replacementString.string rangesOfCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@"\n"]];
for (NSValue *newlineRangeValue in newlineRangeValues) {
[replacementString addAttribute:[[PREditorContentName blockContentTypeName] rawValue]
value:[PREditorContentName newlineName]
Expand Down

0 comments on commit 21a098d

Please sign in to comment.