From fa681bfcf5cbfcc711fb0ab10f3fd74ac83bf18c Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 15 Dec 2025 00:11:21 +0100 Subject: Apply formatting rules --- QuickLook/PreviewViewController.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'QuickLook/PreviewViewController.swift') 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 { 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 { 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 { -- cgit