mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
macos: swiftlint 'for_where' rule (#10909)
This commit is contained in:
@@ -18,7 +18,6 @@ disabled_rules:
|
||||
- type_body_length
|
||||
|
||||
# TODO
|
||||
- for_where
|
||||
- force_cast
|
||||
- multiple_closures_with_trailing_closure
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ extension AppDelegate: Ghostty.Delegate {
|
||||
continue
|
||||
}
|
||||
|
||||
for surface in controller.surfaceTree {
|
||||
if surface.id == id {
|
||||
return surface
|
||||
}
|
||||
for surface in controller.surfaceTree where surface.id == id {
|
||||
return surface
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1076,10 +1076,8 @@ class AppDelegate: NSObject,
|
||||
|
||||
func findSurface(forUUID uuid: UUID) -> Ghostty.SurfaceView? {
|
||||
for c in TerminalController.all {
|
||||
for view in c.surfaceTree {
|
||||
if view.id == uuid {
|
||||
return view
|
||||
}
|
||||
for view in c.surfaceTree where view.id == uuid {
|
||||
return view
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,11 +131,9 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration {
|
||||
// Find the focused surface in surfaceTree
|
||||
if let focusedStr = state.focusedSurface {
|
||||
var foundView: Ghostty.SurfaceView?
|
||||
for view in c.surfaceTree {
|
||||
if view.id.uuidString == focusedStr {
|
||||
foundView = view
|
||||
break
|
||||
}
|
||||
for view in c.surfaceTree where view.id.uuidString == focusedStr {
|
||||
foundView = view
|
||||
break
|
||||
}
|
||||
|
||||
if let view = foundView {
|
||||
|
||||
@@ -52,10 +52,8 @@ extension NSView {
|
||||
return true
|
||||
}
|
||||
|
||||
for subview in subviews {
|
||||
if subview.contains(view) {
|
||||
return true
|
||||
}
|
||||
for subview in subviews where subview.contains(view) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
@@ -67,10 +65,8 @@ extension NSView {
|
||||
return true
|
||||
}
|
||||
|
||||
for subview in subviews {
|
||||
if subview.contains(className: name) {
|
||||
return true
|
||||
}
|
||||
for subview in subviews where contains(className: name) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user