aboutsummaryrefslogtreecommitdiff
path: root/QuickLook
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 00:11:21 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 00:19:39 +0100
commitfa681bfcf5cbfcc711fb0ab10f3fd74ac83bf18c (patch)
tree2dce2e95bab08f773246b450ac50227f8e8f57da /QuickLook
parent0d5e6636405dbe332c33c0fb82c7ccccb20f96cb (diff)
Apply formatting rules
Diffstat (limited to 'QuickLook')
-rw-r--r--QuickLook/PreviewViewController.swift12
1 files changed, 7 insertions, 5 deletions
diff --git a/QuickLook/PreviewViewController.swift b/QuickLook/PreviewViewController.swift
index ecacee0..9dbc5f2 100644
--- a/QuickLook/PreviewViewController.swift
+++ b/QuickLook/PreviewViewController.swift
@@ -1,10 +1,10 @@
import Cocoa
import Quartz
-import SwiftUI
-import WmapParser
import SwiftTreeSitter
import SwiftTreeSitterLayer
+import SwiftUI
import TreeSitterWmap
+import WmapParser
class PreviewViewController: NSViewController, QLPreviewingController {
@@ -29,7 +29,7 @@ class PreviewViewController: NSViewController, QLPreviewingController {
await MainActor.run {
// Clear any existing subviews and force cleanup
- view.subviews.forEach { subview in
+ for subview in view.subviews {
if let hostingView = subview as? NSHostingView<AnyView> {
hostingView.rootView = AnyView(EmptyView())
}
@@ -91,7 +91,7 @@ class PreviewViewController: NSViewController, QLPreviewingController {
deinit {
// Cleanup when view controller is deallocated
- view.subviews.forEach { subview in
+ for subview in view.subviews {
if let hostingView = subview as? NSHostingView<AnyView> {
hostingView.rootView = AnyView(EmptyView())
}
@@ -197,7 +197,9 @@ struct QuickLookTextEditor: NSViewRepresentable {
textStorage.addAttribute(.foregroundColor, value: NSColor.textColor, range: fullRange)
// Apply tree-sitter highlighting
- guard let highlights = try? rootLayer.highlights(in: fullRange, provider: content.predicateTextProvider)
+ guard
+ let highlights = try? rootLayer.highlights(
+ in: fullRange, provider: content.predicateTextProvider)
else { return }
for highlight in highlights {