From ad78389dc31ef1073cf6138f80ccbaf732d1a6f7 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Tue, 2 Feb 2021 10:06:53 -0500 Subject: [PATCH] Set typingAttributes for Mac post editor --- macOS/PostEditor/MacEditorTextView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macOS/PostEditor/MacEditorTextView.swift b/macOS/PostEditor/MacEditorTextView.swift index e5f8808..ee3d7d7 100644 --- a/macOS/PostEditor/MacEditorTextView.swift +++ b/macOS/PostEditor/MacEditorTextView.swift @@ -140,8 +140,8 @@ final class CustomTextView: NSView { layoutManager.addTextContainer(textContainer) let paragraphStyle = NSMutableParagraphStyle() - let lineHeightMultiple: CGFloat = 1.5 - paragraphStyle.lineHeightMultiple = lineHeightMultiple + let lineSpacing: CGFloat = 8.5 + paragraphStyle.lineSpacing = lineSpacing let textView = NSTextView(frame: .zero, textContainer: textContainer) textView.autoresizingMask = .width @@ -162,6 +162,7 @@ final class CustomTextView: NSView { textView.usesFindPanel = true textView.isAutomaticDashSubstitutionEnabled = false textView.isRichText = false + textView.typingAttributes = [.paragraphStyle: paragraphStyle, .font: font] // H/T Daniel Jalkut return textView }()