Skip to content

Commit a2f54dc

Browse files
committed
Autoformat code
1 parent 6b185ab commit a2f54dc

15 files changed

+61
-61
lines changed

Sources/RichTextKit/Actions/RichTextAction.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ public extension RichTextAction {
6565
case .undoLatestChange: .richTextActionUndo
6666
}
6767
}
68-
68+
6969
/// The localized title to use in the main menu.
7070
var menuTitle: String {
7171
menuTitleKey.text
7272
}
73-
73+
7474
/// The localized title key to use in the main menu.
7575
var menuTitleKey: RTKL10n {
7676
switch self {
@@ -83,7 +83,7 @@ public extension RichTextAction {
8383
var title: String {
8484
titleKey.text
8585
}
86-
86+
8787
/// The localized action title key.
8888
var titleKey: RTKL10n {
8989
switch self {

Sources/RichTextKit/Alignment/RichTextAlignment.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public extension RichTextAlignment {
5151

5252
/// The standard icon to use for the alignment.
5353
var icon: Image { nativeAlignment.icon }
54-
54+
5555
/// The standard title to use for the alignment.
5656
var title: String { nativeAlignment.title }
57-
57+
5858
/// The standard title key to use for the alignment.
5959
var titleKey: RTKL10n { nativeAlignment.titleKey }
6060

@@ -86,7 +86,7 @@ public extension NSTextAlignment {
8686
var title: String {
8787
titleKey.text
8888
}
89-
89+
9090
/// The standard title key to use for the alignment.
9191
var titleKey: RTKL10n {
9292
switch self {

Sources/RichTextKit/Attributes/RichTextAttributeWriter+Indent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import AppKit
1717
#endif
1818

1919
public extension RichTextAttributeWriter {
20-
20+
2121
/// Set the rich text indent at a certain range.
2222
///
2323
/// Unlike some other attributes, this attribute applies

Sources/RichTextKit/Component/RichTextViewComponent+Attributes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public extension RichTextViewComponent {
1515
if hasSelectedRange {
1616
return richTextAttributes(at: selectedRange)
1717
}
18-
18+
1919
#if macOS
2020
let range = NSRange(location: selectedRange.location - 1, length: 1)
2121
let safeRange = safeRange(for: range)

Sources/RichTextKit/Component/RichTextViewComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Foundation
1818

1919
The protocol implements and extends many other protocols to
2020
provide more features for components with more capabilities.
21-
21+
2222
The protocol for instance extends ``RichTextAttributeReader``
2323
and ``RichTextAttributeWriter`` and adds new functions that
2424
don't require a `range`, since it can use the current range.

Sources/RichTextKit/Images/Image+RichText.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,27 @@ public extension Image {
5353
}
5454

5555
public extension Image {
56-
56+
5757
static func richTextStepFontSize(
5858
_ points: Int
5959
) -> Image {
60-
points < 0 ?
60+
points < 0 ?
6161
.richTextFontSizeDecrease :
6262
.richTextFontSizeIncrease
6363
}
64-
64+
6565
static func richTextStepIndent(
6666
_ points: Double
6767
) -> Image {
68-
points < 0 ?
68+
points < 0 ?
6969
.richTextIndentDecrease :
7070
.richTextIndentIncrease
7171
}
72-
72+
7373
static func richTextStepSuperscript(
7474
_ steps: Int
7575
) -> Image {
76-
steps < 0 ?
76+
steps < 0 ?
7777
.richTextSuperscriptDecrease :
7878
.richTextSuperscriptIncrease
7979
}

Sources/RichTextKit/Keyboard/RichTextKeyboardToolbarMenu.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#if iOS || os(visionOS)
10-
import SwiftUI
10+
import SwiftUI
1111

1212
/**
1313
This keyboard toolbar menu can be used to solve a UI glitch

Sources/RichTextKit/Localization/RTKL10n.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public enum RTKL10n: String, CaseIterable, Identifiable {
3030
actionIndentIncrease,
3131
actionIndentDecrease,
3232
actionPrint,
33-
33+
3434
actionRedoLatestChange,
3535
actionUndoLatestChange,
3636

@@ -66,33 +66,33 @@ public enum RTKL10n: String, CaseIterable, Identifiable {
6666
}
6767

6868
public extension RTKL10n {
69-
69+
7070
static func actionStepFontSize(
7171
_ points: Int
7272
) -> RTKL10n {
7373
points < 0 ?
7474
.actionFontSizeDecrease :
7575
.actionFontSizeIncrease
7676
}
77-
77+
7878
static func actionStepIndent(
7979
_ points: Double
8080
) -> RTKL10n {
8181
points < 0 ?
8282
.actionIndentDecrease :
8383
.actionIndentIncrease
8484
}
85-
85+
8686
static func actionStepSuperscript(
8787
_ steps: Int
8888
) -> RTKL10n {
8989
steps < 0 ?
9090
.actionIndentDecrease :
9191
.actionIndentIncrease
9292
}
93-
93+
9494
static func menuIndent(_ points: Double) -> RTKL10n {
95-
points < 0 ?
95+
points < 0 ?
9696
.menuIndentDecrease :
9797
.menuIndentIncrease
9898
}

Sources/RichTextKit/RichTextEditor.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import SwiftUI
1414

1515
The view uses a platform-specific ``RichTextView`` together
1616
with a ``RichTextContext`` and a ``RichTextCoordinator`` to
17-
make view and context changes sync correctly.
18-
17+
make view and context changes sync correctly.
18+
1919
You can use the provided context to trigger and observe any
2020
changes to the text editor. Note that changing the value of
2121
the `text` binding will not yet update the editor. Until it
@@ -68,10 +68,10 @@ public struct RichTextEditor: ViewRepresentable {
6868
}
6969

7070
public typealias ViewConfiguration = (RichTextViewComponent) -> Void
71-
71+
7272
@ObservedObject
7373
private var context: RichTextContext
74-
74+
7575
private var text: Binding<NSAttributedString>
7676
private let config: RichTextView.Configuration
7777
private var format: RichTextDataFormat
@@ -108,9 +108,9 @@ public struct RichTextEditor: ViewRepresentable {
108108
}
109109

110110
public func updateUIView(_ view: UIViewType, context: Context) {}
111-
111+
112112
#else
113-
113+
114114
public func makeNSView(context: Context) -> some NSView {
115115
textView.setup(with: text.wrappedValue, format: format)
116116
textView.configuration = config

Sources/RichTextKit/RichTextView+Config.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
import SwiftUI
1111

1212
public extension RichTextView {
13-
13+
1414
/**
1515
This type can be used to configure a ``RichTextEditor``.
1616
*/
1717
struct Configuration {
18-
18+
1919
/**
2020
Create a custom configuration.
21-
21+
2222
- Parameters:
2323
- isScrollingEnabled: Whether or not the editor should scroll, by default `true`.
2424
*/
@@ -27,14 +27,14 @@ public extension RichTextView {
2727
) {
2828
self.isScrollingEnabled = isScrollingEnabled
2929
}
30-
30+
3131
/// Whether or not the editor should scroll.
3232
public var isScrollingEnabled: Bool
3333
}
3434
}
3535

3636
public extension RichTextView.Configuration {
37-
37+
3838
/// Get a standard rich text editor configuration.
3939
static var standard: Self { .init() }
4040
}

Sources/RichTextKit/RichTextView_AppKit.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import AppKit
2626
open class RichTextView: NSTextView, RichTextViewComponent {
2727

2828
// MARK: - Properties
29-
29+
3030
/// The configuration to use by the rich text view.
3131
public var configuration: Configuration = .standard
3232

@@ -77,9 +77,9 @@ open class RichTextView: NSTextView, RichTextViewComponent {
7777

7878
return super.performDragOperation(draggingInfo)
7979
}
80-
80+
8181
open override func scrollWheel(with event: NSEvent) {
82-
82+
8383
if configuration.isScrollingEnabled {
8484
return super.scrollWheel(with: event)
8585
}

Sources/RichTextKit/RichTextView_UIKit.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ open class RichTextView: UITextView, RichTextViewComponent {
4747

4848

4949
// MARK: - Properties
50-
50+
5151
/// The configuration to use by the rich text view.
5252
public var configuration: Configuration = .standard {
5353
didSet {
5454
isScrollEnabled = configuration.isScrollingEnabled
5555
}
5656
}
57-
57+
5858
/// The style to use when highlighting text in the view.
5959
public var highlightingStyle: RichTextHighlightingStyle = .standard
6060

Sources/RichTextKit/Styles/RichTextStyle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public extension RichTextStyle {
5151
case .underlined: .richTextStyleUnderline
5252
}
5353
}
54-
54+
5555
/// The localized style title.
5656
var title: String {
5757
titleKey.text
5858
}
59-
59+
6060
/// The localized style title key.
6161
var titleKey: RTKL10n {
6262
switch self {

Sources/RichTextKit/_Deprecated/RichTextAction+Deprecated.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ public extension RichTextAction {
77

88
@available(*, deprecated, renamed: "decreaseFontSize(points:)")
99
static var decrementFontSize: RichTextAction { stepFontSize(points: -1) }
10-
10+
1111
@available(*, deprecated, renamed: "increaseFontSize(points:)")
1212
static var increaseFontSize: RichTextAction {
1313
increaseFontSize()
1414
}
15-
15+
1616
@available(*, deprecated, renamed: "decreaseFontSize(points:)")
1717
static var decreaseFontSize: RichTextAction {
1818
decreaseFontSize()
1919
}
20-
20+
2121
@available(*, deprecated, renamed: "increaseIndent(points:)")
2222
static var increaseIndent: RichTextAction {
2323
increaseIndent()
2424
}
25-
25+
2626
@available(*, deprecated, renamed: "decreaseIndent(points:)")
2727
static var decreaseIndent: RichTextAction {
2828
decreaseIndent()
2929
}
30-
30+
3131
@available(*, deprecated, renamed: "increaseSuperscript(steps:)")
3232
static var increaseSuperscript: RichTextAction {
3333
increaseSuperscript()
3434
}
35-
35+
3636
@available(*, deprecated, renamed: "decreaseSuperscript(steps:)")
3737
static var decreaseSuperscript: RichTextAction {
3838
decreaseSuperscript()

0 commit comments

Comments
 (0)