macOS: implement cmd+[0-9] to goto tab

This is my attempt at fixing #63. It works! But:

1. The `NotificationCenter` subscription is triggered once for every
   open tab. That's obviously wrong. But I'm not sure and could use some
   pointers where else to put the subscription. That leads me to...
2. I'm _not_ knowledgable in Swift/AppKit/SwiftUI, so I might have put
   the wrong/right things in the wrong/right places. For example: wasn't
   sure what's to be handled in Swift and what's to be handled by the
   core in Zig.

Would love some pointers :)
This commit is contained in:
Thorsten Ball
2023-07-01 17:12:55 +02:00
committed by Mitchell Hashimoto
parent cb775b5d56
commit 6ff3f62e3a
5 changed files with 58 additions and 1 deletions

View File

@@ -238,6 +238,7 @@ typedef void (*ghostty_runtime_write_clipboard_cb)(void *, const char *);
typedef void (*ghostty_runtime_new_split_cb)(void *, ghostty_split_direction_e);
typedef void (*ghostty_runtime_close_surface_cb)(void *, bool);
typedef void (*ghostty_runtime_focus_split_cb)(void *, ghostty_split_focus_direction_e);
typedef void (*ghostty_runtime_goto_tab_cb)(void *, int32_t);
typedef struct {
void *userdata;
@@ -249,6 +250,7 @@ typedef struct {
ghostty_runtime_new_split_cb new_split_cb;
ghostty_runtime_close_surface_cb close_surface_cb;
ghostty_runtime_focus_split_cb focus_split_cb;
ghostty_runtime_goto_tab_cb goto_tab_cb;
} ghostty_runtime_config_s;
//-------------------------------------------------------------------