From a65b51f92a80fcbc46f1f176ddcf6a37eefcca02 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 15 Apr 2015 20:20:01 -0400 Subject: Allow undocumented `events.MODIFIED` to emit position and length. --- core/events.lua | 3 ++- src/textadept.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/events.lua b/core/events.lua index 7d7bdb1d..a1e2dd24 100644 --- a/core/events.lua +++ b/core/events.lua @@ -325,7 +325,8 @@ local scnotifications = { [c.SCN_SAVEPOINTLEFT] = {'save_point_left'}, [c.SCN_DOUBLECLICK] = {'double_click', 'position', 'line', 'modifiers'}, [c.SCN_UPDATEUI] = {'update_ui', 'updated'}, - [c.SCN_MODIFIED] = {'modified', 'modification_type'}, -- undocumented + -- SCN_MODIFIED is undocumented. + [c.SCN_MODIFIED] = {'modified', 'modification_type', 'position', 'length'}, [c.SCN_MARGINCLICK] = {'margin_click', 'margin', 'position', 'modifiers'}, [c.SCN_USERLISTSELECTION] = { 'user_list_selection', 'wParam', 'text', 'position' diff --git a/src/textadept.c b/src/textadept.c index bf8ea078..262ed651 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1892,7 +1892,7 @@ static void lL_notify(lua_State *L, struct SCNotification *n) { lua_pushinteger(L, n->modificationType); lua_setfield(L, -2, "modification_type"); lua_pushstring(L, n->text), lua_setfield(L, -2, "text"); - //lua_pushinteger(L, n->length), lua_setfield(L, -2, "length"); + 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"); lua_pushinteger(L, n->wParam), lua_setfield(L, -2, "wParam"); -- cgit v1.2.3