mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-28 05:58:36 +00:00
macos: address some feedback
This commit is contained in:
@@ -132,8 +132,8 @@ struct TerminalQuery: EntityStringQuery, EnumerableEntityQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all our surfaces
|
// Get all our surfaces
|
||||||
return controllers.reduce([]) { result, c in
|
return controllers.flatMap {
|
||||||
result + (c.surfaceTree.root?.leaves() ?? [])
|
$0.surfaceTree.root?.leaves() ?? []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,9 +5,9 @@ enum GhosttyIntentError: Error, CustomLocalizedStringResourceConvertible {
|
|||||||
|
|
||||||
var localizedStringResource: LocalizedStringResource {
|
var localizedStringResource: LocalizedStringResource {
|
||||||
switch self {
|
switch self {
|
||||||
case .appUnavailable: return "The Ghostty app isn't properly initialized."
|
case .appUnavailable: "The Ghostty app isn't properly initialized."
|
||||||
case .surfaceNotFound: return "The terminal no longer exists."
|
case .surfaceNotFound: "The terminal no longer exists."
|
||||||
case .permissionDenied: return "Ghostty doesn't allow Shortcuts."
|
case .permissionDenied: "Ghostty doesn't allow Shortcuts."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,14 +34,14 @@ extension Array where Element == String {
|
|||||||
func helper(index: Int, accumulated: [UnsafePointer<Int8>?], body: ([UnsafePointer<Int8>?]) throws -> T) rethrows -> T {
|
func helper(index: Int, accumulated: [UnsafePointer<Int8>?], body: ([UnsafePointer<Int8>?]) throws -> T) rethrows -> T {
|
||||||
if index == count {
|
if index == count {
|
||||||
return try body(accumulated)
|
return try body(accumulated)
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return try self[index].withCString { cStr in
|
return try self[index].withCString { cStr in
|
||||||
var newAccumulated = accumulated
|
var newAccumulated = accumulated
|
||||||
newAccumulated.append(cStr)
|
newAccumulated.append(cStr)
|
||||||
return try helper(index: index + 1, accumulated: newAccumulated, body: body)
|
return try helper(index: index + 1, accumulated: newAccumulated, body: body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return try helper(index: 0, accumulated: [], body: body)
|
return try helper(index: 0, accumulated: [], body: body)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user