aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-08-09 22:10:34 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-08-09 22:10:34 -0400
commit87b3554813d86c0837755433f6d70ada01609e8e (patch)
treeb74b8e2d69eb04a3c4bbd52841a9068f33b6a987 /src
parentdd40438201488113a5f2b5899caf31ffe1258a92 (diff)
Fixed regression involving SCNotifications and text.
This affects SCN_URIDROPPED among others.
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c5
1 files changed, 3 insertions, 2 deletions
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");