Skip to content

Commit 6b95125

Browse files
committed
lint:fix
1 parent 8bd6a0b commit 6b95125

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

Package.resolved

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/CodeEditSourceEditor/CodeEditSourceEditor/CodeEditSourceEditor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
5353
/// - showMinimap: Whether to show the minimap
5454
/// - reformatAtColumn: The column to reformat at
5555
/// - showReformattingGuide: Whether to show the reformatting guide
56-
/// - invisibleCharactersConfig: Configuration for displaying invisible characters. Defaults to an empty object.
56+
/// - invisibleCharactersConfig: Configuration for displaying invisible characters. Defaults to an empty object.
5757
public init(
5858
_ text: Binding<String>,
5959
language: CodeLanguage,

Sources/CodeEditSourceEditor/Controller/TextViewController.swift

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,21 +331,16 @@ public class TextViewController: NSViewController { // swiftlint:disable:this ty
331331
self.showMinimap = showMinimap
332332
self.reformatAtColumn = reformatAtColumn
333333
self.showReformattingGuide = showReformattingGuide
334-
self.invisibleCharactersCoordinator = InvisibleCharactersCoordinator(
335-
config: invisibleCharactersConfig,
336-
indentOption: indentOption,
337-
theme: theme,
338-
font: font
339-
)
334+
335+
invisibleCharactersCoordinator = .init(config: .empty, indentOption: indentOption, theme: theme, font: font)
340336
self.invisibleCharactersConfig = invisibleCharactersConfig
341337

342338
super.init(nibName: nil, bundle: nil)
343339

344-
let platformGuardedSystemCursor: Bool
345-
if #available(macOS 14, *) {
346-
platformGuardedSystemCursor = useSystemCursor
340+
let platformGuardedSystemCursor: Bool = if #available(macOS 14, *) {
341+
useSystemCursor
347342
} else {
348-
platformGuardedSystemCursor = false
343+
false
349344
}
350345

351346
if let idx = highlightProviders.firstIndex(where: { $0 is TreeSitterClient }),
@@ -417,4 +412,4 @@ public class TextViewController: NSViewController { // swiftlint:disable:this ty
417412
}
418413
localEvenMonitor = nil
419414
}
420-
}
415+
} // swiftlint:disable:this file_length

Sources/CodeEditSourceEditor/InvisibleCharacters/InvisibleCharactersConfig.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public struct InvisibleCharactersConfig: Equatable, Hashable, Sendable, Codable
3030
self.showLineEndings = showLineEndings
3131
self.warningCharacters = warningCharacters
3232
}
33-
33+
3434
/// Determines what characters should trigger a custom drawing action.
3535
func triggerCharacters() -> Set<UInt16> {
3636
var set = Set<UInt16>()
@@ -52,7 +52,7 @@ public struct InvisibleCharactersConfig: Equatable, Hashable, Sendable, Codable
5252

5353
return set
5454
}
55-
55+
5656
/// Some commonly used whitespace symbols in their unichar representation.
5757
public enum Symbols {
5858
public static let space: UInt16 = 0x20

Sources/CodeEditSourceEditor/InvisibleCharacters/InvisibleCharactersCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class InvisibleCharactersCoordinator: InvisibleCharactersDelegate {
6464
size: font.pointSize
6565
) ?? font
6666
}
67-
67+
6868
/// Determines if the textview should clear cached styles.
6969
func invisibleStyleShouldClearCache() -> Bool {
7070
if needsCacheClear {
@@ -73,7 +73,7 @@ final class InvisibleCharactersCoordinator: InvisibleCharactersDelegate {
7373
}
7474
return false
7575
}
76-
76+
7777
/// Determines the replacement style for a character found in a line fragment. Returns the style the text view
7878
/// should use to emphasize or replace the character.
7979
///

0 commit comments

Comments
 (0)