From d52198ec5004edef17665b6ba4e5b0f0a7d12cd0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Mon, 8 Feb 2021 12:55:04 -0500 Subject: Expose "lines_added" field for SCN_MODIFIED notifications. Note that connecting to `events.MODIFIED` is still intentionally undocumented. --- src/textadept.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/textadept.c b/src/textadept.c index ece5273e..fe16f120 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1894,16 +1894,17 @@ static void emit_notification(lua_State *L, SCNotification *n) { 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->length), lua_setfield(L, -2, "length"); + 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->listType), lua_setfield(L, -2, "list_type"); + //lua_pushinteger(L, n->wParam), lua_setfield(L, -2, "wParam"); //lua_pushinteger(L, n->lParam), lua_setfield(L, -2, "lParam"); lua_pushinteger(L, n->line + 1), lua_setfield(L, -2, "line"); //lua_pushinteger(L, n->foldLevelNow), lua_setfield(L, -2, "fold_level_now"); //lua_pushinteger(L, n->foldLevelPrev), // lua_setfield(L, -2, "fold_level_prev"); lua_pushinteger(L, n->margin + 1), lua_setfield(L, -2, "margin"); + lua_pushinteger(L, n->listType), lua_setfield(L, -2, "list_type"); lua_pushinteger(L, n->x), lua_setfield(L, -2, "x"); lua_pushinteger(L, n->y), lua_setfield(L, -2, "y"); //lua_pushinteger(L, n->token), lua_setfield(L, -2, "token"); @@ -1912,6 +1913,8 @@ static void emit_notification(lua_State *L, SCNotification *n) { lua_pushinteger(L, n->updated), lua_setfield(L, -2, "updated"); //lua_pushinteger(L, n->listCompletionMethod), // lua_setfield(L, -2, "list_completion_method"); + //lua_pushinteger(L, n->characterSource), + // lua_setfield(L, -2, "character_source"); emit(L, "SCN", LUA_TTABLE, luaL_ref(L, LUA_REGISTRYINDEX), -1); } -- cgit v1.2.3