From 7d7fe4134b5b49f1b9118c0f0bb12fd180cf1806 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Thu, 28 Jan 2021 17:45:10 -0500 Subject: [PATCH] Add editing menu, enable find/replace, ignore formatted text on paste --- Shared/WriteFreely_MultiPlatformApp.swift | 2 ++ macOS/PostEditor/MacEditorTextView.swift | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Shared/WriteFreely_MultiPlatformApp.swift b/Shared/WriteFreely_MultiPlatformApp.swift index c05344a..bca2dd9 100644 --- a/Shared/WriteFreely_MultiPlatformApp.swift +++ b/Shared/WriteFreely_MultiPlatformApp.swift @@ -94,6 +94,8 @@ struct WriteFreely_MultiPlatformApp: App { #endif } } + ToolbarCommands() + TextEditingCommands() } #if os(macOS) diff --git a/macOS/PostEditor/MacEditorTextView.swift b/macOS/PostEditor/MacEditorTextView.swift index 96bacc9..e5f8808 100644 --- a/macOS/PostEditor/MacEditorTextView.swift +++ b/macOS/PostEditor/MacEditorTextView.swift @@ -140,7 +140,8 @@ final class CustomTextView: NSView { layoutManager.addTextContainer(textContainer) let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 8.5 + let lineHeightMultiple: CGFloat = 1.5 + paragraphStyle.lineHeightMultiple = lineHeightMultiple let textView = NSTextView(frame: .zero, textContainer: textContainer) textView.autoresizingMask = .width @@ -158,6 +159,9 @@ final class CustomTextView: NSView { textView.minSize = NSSize(width: 0, height: contentSize.height) textView.textColor = NSColor.labelColor textView.allowsUndo = true + textView.usesFindPanel = true + textView.isAutomaticDashSubstitutionEnabled = false + textView.isRichText = false return textView }()