aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2018-03-17 15:02:03 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2018-03-17 15:02:03 -0400
commit742ac9b76067848e8796b5404f7c44dbdb4b86ff (patch)
tree5779fe53484f3486073a7981d84100cc908c9c89 /src
parent1f5d8afacfcfe9441a327cbc6d51a4b1dc2b1049 (diff)
Fixed initialization errors not showing in the terminal version.
A blank screen was shown instead.
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c16
1 files 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);