diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-21 11:50:51 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-21 11:50:51 -0500 |
commit | dd91d6c72625cc7ed2ec5954a5cbca35fd7655d4 (patch) | |
tree | 4b1e52098e3fdbb9a36395c33ad057b7cbaf0d01 /main.c | |
parent | 3d86329abd754319a36459f8eb3e4bce6efffe1e (diff) |
split file selector into its own thing
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -60,6 +60,7 @@ static void die(char const *fmt, ...) { #if _WIN32 INT WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) { + (void)hInstance; (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow; int argc = 0; LPWSTR* wide_argv = CommandLineToArgvW(GetCommandLineW(), &argc); char** argv = malloc(argc * sizeof *argv); @@ -204,8 +205,7 @@ int main(int argc, char **argv) { } if (fs_file_exists(starting_filename)) { - buffer_load_file(buffer, starting_filename); - if (buffer_haserr(buffer)) + if (!buffer_load_file(buffer, starting_filename)) die("Error loading file: %s", buffer_geterr(buffer)); } else { buffer_new_file(buffer, starting_filename); @@ -346,6 +346,8 @@ int main(int argc, char **argv) { die("%s", ted_geterr(ted)); } } + + menu_update(ted, ted->menu); u32 key_modifier = (u32)ctrl_down << KEY_MODIFIER_CTRL_BIT | (u32)shift_down << KEY_MODIFIER_SHIFT_BIT |