File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ - (NSString *)stringForLine:(int)rowIndex {
3939 // UITextView won’t render a massive line of spaces (e.g. an empty nano screen), so add a newline
4040 // if the line ends with a space
4141 if (rowIndex != self.rowCount - 1 && unicharBuffer[width - 1 ] == ' ' ) {
42+ if (unicharBuffer[width - 2 ] == ' ' ) {
43+ // TODO: this is crazy. there has to be a better way to stop spaces from being collapsed
44+ unicharBuffer[width - 2 ] = 0xA0 ; // non-breaking space
45+ }
4246 unicharBuffer[width - 1 ] = ' \n ' ;
4347 }
4448
@@ -69,6 +73,7 @@ - (NSMutableAttributedString *)attributedString {
6973
7074 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc ] init ];
7175 paragraphStyle.alignment = NSTextAlignmentLeft;
76+ paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
7277 paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
7378
7479 NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc ] initWithString: allLines attributes: @{
You can’t perform that action at this time.
0 commit comments