Skip to content

Commit ed2f83f

Browse files
authored
Adds default tab stops (#362)
* Adds default tab stops * Fixes SwiftLint warning
1 parent c09a14f commit ed2f83f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sources/Runestone/Library/DefaultStringAttributes.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ struct DefaultStringAttributes {
99

1010
func apply(to attributedString: NSMutableAttributedString) {
1111
let paragraphStyle = NSMutableParagraphStyle()
12-
paragraphStyle.tabStops = []
12+
paragraphStyle.tabStops = (0 ..< 20).map { index in
13+
NSTextTab(textAlignment: .natural, location: CGFloat(index) * tabWidth)
14+
}
1315
paragraphStyle.defaultTabInterval = tabWidth
1416
let range = NSRange(location: 0, length: attributedString.length)
1517
let attributes: [NSAttributedString.Key: Any] = [

0 commit comments

Comments
 (0)