aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-11 10:38:28 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commit07b8e9d8a293d63fd9c1059968b53ad396e9f013 (patch)
tree8da02e24e203efbb8772fde0f0689aac87e31574 /main.c
parentb7074021b7bfb0932b889b9560dd22df31cef818 (diff)
downloadvis-07b8e9d8a293d63fd9c1059968b53ad396e9f013.tar.gz
vis-07b8e9d8a293d63fd9c1059968b53ad396e9f013.tar.xz
cleanup vis event interface
This removes the function pointer interface which was adding needless complexity and making it difficult to add new events. Now if new events are only meant for lua they only need to be added to the lua interface. This will also have a minor reduction in runtime memory usage and produce a smaller binary. The only runtime difference is that QUIT happens after all windows have been closed and their files freed.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/main.c b/main.c
index 8aa31c6..41726df 100644
--- a/main.c
+++ b/main.c
@@ -2213,26 +2213,7 @@ static void signal_handler(int signum, siginfo_t *siginfo, void *context) {
}
int main(int argc, char *argv[]) {
-
- VisEvent event = {
- .init = vis_lua_init,
- .start = vis_lua_start,
- .quit = vis_lua_quit,
- .mode_insert_input = vis_lua_mode_insert_input,
- .mode_replace_input = vis_lua_mode_replace_input,
- .file_open = vis_lua_file_open,
- .file_save_pre = vis_lua_file_save_pre,
- .file_save_post = vis_lua_file_save_post,
- .file_close = vis_lua_file_close,
- .win_open = vis_lua_win_open,
- .win_close = vis_lua_win_close,
- .win_highlight = vis_lua_win_highlight,
- .win_status = vis_lua_win_status,
- .term_csi = vis_lua_term_csi,
- .ui_draw = vis_lua_ui_draw,
- };
-
- vis = vis_new(ui_term_new(), &event);
+ vis = vis_new(ui_term_new());
if (!vis)
return EXIT_FAILURE;