apprt/embedded: ghostty_surface_binding_action can now run any action

This commit is contained in:
Mitchell Hashimoto
2023-08-30 21:46:38 -07:00
parent 17e46bf0f4
commit c71979804e
4 changed files with 31 additions and 24 deletions

View File

@@ -140,11 +140,17 @@ extension Ghostty {
}
func newTab(surface: ghostty_surface_t) {
ghostty_surface_binding_action(surface, GHOSTTY_BINDING_NEW_TAB, nil)
let action = "new_tab"
if (!ghostty_surface_binding_action(surface, action, UInt(action.count))) {
AppDelegate.logger.warning("action failed action=\(action)")
}
}
func newWindow(surface: ghostty_surface_t) {
ghostty_surface_binding_action(surface, GHOSTTY_BINDING_NEW_WINDOW, nil)
let action = "new_window"
if (!ghostty_surface_binding_action(surface, action, UInt(action.count))) {
AppDelegate.logger.warning("action failed action=\(action)")
}
}
func split(surface: ghostty_surface_t, direction: ghostty_split_direction_e) {