From 87b3554813d86c0837755433f6d70ada01609e8e Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 9 Aug 2020 22:10:34 -0400 Subject: Fixed regression involving SCNotifications and text. This affects SCN_URIDROPPED among others. --- src/textadept.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index fbdb1ece..ace653ed 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1865,8 +1865,9 @@ static void emit_notification(lua_State *L, SCNotification *n) { lua_pushinteger(L, n->modifiers), lua_setfield(L, -2, "modifiers"); lua_pushinteger(L, n->modificationType), lua_setfield(L, -2, "modification_type"); - lua_pushlstring(L, n->text, n->text ? n->length || strlen(n->text) : 0), - lua_setfield(L, -2, "text"); + if (n->text) + lua_pushlstring(L, n->text, n->length ? n->length : strlen(n->text)), + lua_setfield(L, -2, "text"); lua_pushinteger(L, n->length), lua_setfield(L, -2, "length"); // SCN_MODIFIED //lua_pushinteger(L, n->linesAdded), lua_setfield(L, -2, "lines_added"); //lua_pushinteger(L, n->message), lua_setfield(L, -2, "message"); -- cgit v1.2.3