Add editing menu, enable find/replace, ignore formatted text on paste

This commit is contained in:
Angelo Stavrow 2021-01-28 17:45:10 -05:00
parent 89261831bc
commit 7d7fe4134b
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 7 additions and 1 deletions

View File

@ -94,6 +94,8 @@ struct WriteFreely_MultiPlatformApp: App {
#endif
}
}
ToolbarCommands()
TextEditingCommands()
}
#if os(macOS)

View File

@ -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
}()