From 3dbcac857858af49883d782f7d39f5394d8ea1f0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 20 Aug 2020 23:32:53 -0400 Subject: Fixed keypress handler regression when compiling with modern MinGW-w64. For some reason, modern MinGW-w64 GCC always returns boolean true unless compiling with debug symbols. Most typing into Scintilla widgets was not working at all. This does not occur on older versions of MinGW GCC. --- src/textadept.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index 2d9c06a8..aee6d173 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1899,8 +1899,11 @@ static void notified(Scintilla *view, int _, SCNotification *n, void *L) { } #if GTK -/** Signal for a Scintilla keypress. */ -static bool keypress(GtkWidget *_, GdkEventKey *event, void *L) { +/** + * Signal for a Scintilla keypress. + * Note: cannot use bool return value due to modern i686-w64-mingw32-gcc issue. + */ +static int keypress(GtkWidget *_, GdkEventKey *event, void *L) { return emit( L, "keypress", LUA_TNUMBER, event->keyval, LUA_TBOOLEAN, event->state & GDK_SHIFT_MASK, -- cgit v1.2.3