macos: address some feedback

This commit is contained in:
Mitchell Hashimoto
2025-06-21 06:42:31 -07:00
parent e4c13cdba8
commit 020976bf88
3 changed files with 12 additions and 12 deletions

View File

@@ -132,8 +132,8 @@ struct TerminalQuery: EntityStringQuery, EnumerableEntityQuery {
}
// Get all our surfaces
return controllers.reduce([]) { result, c in
result + (c.surfaceTree.root?.leaves() ?? [])
return controllers.flatMap {
$0.surfaceTree.root?.leaves() ?? []
}
}
}

View File

@@ -5,9 +5,9 @@ enum GhosttyIntentError: Error, CustomLocalizedStringResourceConvertible {
var localizedStringResource: LocalizedStringResource {
switch self {
case .appUnavailable: return "The Ghostty app isn't properly initialized."
case .surfaceNotFound: return "The terminal no longer exists."
case .permissionDenied: return "Ghostty doesn't allow Shortcuts."
case .appUnavailable: "The Ghostty app isn't properly initialized."
case .surfaceNotFound: "The terminal no longer exists."
case .permissionDenied: "Ghostty doesn't allow Shortcuts."
}
}
}

View File

@@ -34,12 +34,12 @@ extension Array where Element == String {
func helper(index: Int, accumulated: [UnsafePointer<Int8>?], body: ([UnsafePointer<Int8>?]) throws -> T) rethrows -> T {
if index == count {
return try body(accumulated)
} else {
return try self[index].withCString { cStr in
var newAccumulated = accumulated
newAccumulated.append(cStr)
return try helper(index: index + 1, accumulated: newAccumulated, body: body)
}
}
return try self[index].withCString { cStr in
var newAccumulated = accumulated
newAccumulated.append(cStr)
return try helper(index: index + 1, accumulated: newAccumulated, body: body)
}
}