mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
macos: swiftlint 'vertical_whitespace' rule
This commit is contained in:
@@ -27,7 +27,6 @@ disabled_rules:
|
||||
- unused_enumerated
|
||||
- unused_optional_binding
|
||||
- vertical_parameter_alignment
|
||||
- vertical_whitespace
|
||||
|
||||
identifier_name:
|
||||
min_length: 1
|
||||
|
||||
@@ -43,7 +43,6 @@ func requestIntentPermission() async -> Bool {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PermissionRequest.show(
|
||||
"com.mitchellh.ghostty.shortcutsPermission",
|
||||
message: "Allow Shortcuts to interact with Ghostty?",
|
||||
|
||||
@@ -48,7 +48,6 @@ struct QuickTerminalSize {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// This is an almost direct port of th Zig function QuickTerminalSize.calculate
|
||||
func calculate(position: QuickTerminalPosition, screenDimensions: CGSize) -> CGSize {
|
||||
let dims = CGSize(width: screenDimensions.width, height: screenDimensions.height)
|
||||
|
||||
@@ -728,7 +728,6 @@ extension SplitTree.Node {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Calculate the bounds of all views in this subtree based on split ratios
|
||||
func calculateViewBounds(in bounds: CGRect) -> [(view: ViewType, bounds: CGRect)] {
|
||||
switch self {
|
||||
|
||||
@@ -855,7 +855,6 @@ class BaseTerminalController: NSWindowController,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func cellSizeDidChange(to: NSSize) {
|
||||
guard derivedConfig.windowStepResize else { return }
|
||||
// Stage manager can sometimes present windows in such a way that the
|
||||
@@ -1294,7 +1293,6 @@ class BaseTerminalController: NSWindowController,
|
||||
ghostty.splitToggleZoom(surface: surface)
|
||||
}
|
||||
|
||||
|
||||
@IBAction func splitMoveFocusPrevious(_ sender: Any) {
|
||||
splitMoveFocus(direction: .previous)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
|
||||
/// The configuration derived from the Ghostty config so we don't need to rely on references.
|
||||
private(set) var derivedConfig: DerivedConfig
|
||||
|
||||
|
||||
/// The notification cancellable for focused surface property changes.
|
||||
private var surfaceAppearanceCancellables: Set<AnyCancellable> = []
|
||||
|
||||
|
||||
@@ -192,4 +192,3 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -340,7 +340,6 @@ class TitlebarTabsVenturaTerminalWindow: TerminalWindow {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// HACK: hide the "collapsed items" marker from the toolbar if it's present.
|
||||
// idk why it appears in macOS 15.0+ but it does... so... make it go away. (sigh)
|
||||
private func hideToolbarOverflowButton() {
|
||||
|
||||
@@ -312,7 +312,6 @@ extension Ghostty {
|
||||
ghostty_app_set_focus(app, false)
|
||||
}
|
||||
|
||||
|
||||
// MARK: Ghostty Callbacks (macOS)
|
||||
|
||||
static func closeSurface(_ userdata: UnsafeMutableRawPointer?, processAlive: Bool) {
|
||||
@@ -782,7 +781,6 @@ extension Ghostty {
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -819,7 +817,6 @@ extension Ghostty {
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -848,7 +845,6 @@ extension Ghostty {
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -914,7 +910,6 @@ extension Ghostty {
|
||||
assertionFailure()
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -969,7 +964,6 @@ extension Ghostty {
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -991,7 +985,6 @@ extension Ghostty {
|
||||
object: surfaceView
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1014,7 +1007,6 @@ extension Ghostty {
|
||||
object: surfaceView
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1296,7 +1288,6 @@ extension Ghostty {
|
||||
object: surfaceView
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1324,7 +1315,6 @@ extension Ghostty {
|
||||
)
|
||||
return true
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
return false
|
||||
@@ -1349,7 +1339,6 @@ extension Ghostty {
|
||||
userInfo: ["mode": mode]
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1382,7 +1371,6 @@ extension Ghostty {
|
||||
surfaceView.showUserNotification(title: title, body: body)
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1609,7 +1597,6 @@ extension Ghostty {
|
||||
guard let surfaceView = self.surfaceView(from: surface) else { return }
|
||||
surfaceView.setCursorShape(shape)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1638,7 +1625,6 @@ extension Ghostty {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1664,7 +1650,6 @@ extension Ghostty {
|
||||
let buffer = Data(bytes: v.url!, count: v.len)
|
||||
surfaceView.hoverUrl = String(data: buffer, encoding: .utf8)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1684,7 +1669,6 @@ extension Ghostty {
|
||||
guard let surfaceView = self.surfaceView(from: surface) else { return }
|
||||
surfaceView.initialSize = NSSize(width: Double(v.width), height: Double(v.height))
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -1706,7 +1690,6 @@ extension Ghostty {
|
||||
object: surfaceView
|
||||
)
|
||||
|
||||
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
@@ -2086,7 +2069,6 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: User Notifications
|
||||
|
||||
/// Handle a received user notification. This is called when a user notification is clicked or dismissed by the user
|
||||
|
||||
@@ -110,4 +110,3 @@ private struct BouncingProgressBar: View {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -286,8 +286,6 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// This is the resize overlay that shows on top of a surface to show the current
|
||||
// size during a resize operation.
|
||||
struct SurfaceResizeOverlay: View {
|
||||
|
||||
@@ -873,7 +873,6 @@ extension Ghostty {
|
||||
ghostty_surface_mouse_button(surface, GHOSTTY_MOUSE_RELEASE, button.cMouseButton, mods)
|
||||
}
|
||||
|
||||
|
||||
override func rightMouseDown(with event: NSEvent) {
|
||||
guard let surface = self.surface else { return super.rightMouseDown(with: event) }
|
||||
|
||||
@@ -1495,7 +1494,6 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@IBAction func pasteAsPlainText(_ sender: Any?) {
|
||||
guard let surface = self.surface else { return }
|
||||
let action = "paste_from_clipboard"
|
||||
|
||||
@@ -27,5 +27,4 @@ extension String {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user