From 742ac9b76067848e8796b5404f7c44dbdb4b86ff Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 17 Mar 2018 15:02:03 -0400 Subject: Fixed initialization errors not showing in the terminal version. A blank screen was shown instead. --- src/textadept.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/textadept.c b/src/textadept.c index 0b325dbd..05891890 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1397,17 +1397,11 @@ static int lL_dofile(lua_State *L, const char *filename) { stpcpy_(stpcpy_(stpcpy_(file, textadept_home), "/"), filename); int ok = (luaL_dofile(L, file) == LUA_OK); if (!ok) { -#if GTK - GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, "%s\n", - lua_tostring(L, -1)); - gtk_dialog_run(GTK_DIALOG(dialog)), gtk_widget_destroy(dialog); -#elif CURSES - WINDOW *win = newwin(0, 0, 1, 0); - wprintw(win, lua_tostring(L, -1)), wrefresh(win); - getch(), delwin(win); -#endif + const char *argv[] = { + "--title", "Initialization Error", "--informative-text", + lua_tostring(L, -1), "--no-cancel", "--icon", "gtk-dialog-error" + }; + free(gtdialog(GTDIALOG_OK_MSGBOX, 7, argv)); lua_settop(L, 0); } free(file); -- cgit v1.2.3