From 2052c77111051972d8171d27c8d4c501803e70d6 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 24 Aug 2013 14:26:24 -0400 Subject: Include Scintilla constants in `buffer`s. --- src/textadept.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index e79e5509..3e150bd1 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1293,6 +1293,14 @@ static int lbuf_property(lua_State *L) { (!is_buffer || !newindex) ? 2 : 3); } else lua_pop(L, 2); // non-table, ta_properties + // If the key is a Scintilla constant, return its value. + if (!newindex) { + lua_getfield(L, LUA_REGISTRYINDEX, "ta_constants"); + lua_pushvalue(L, 2), lua_gettable(L, -2); + if (lua_isnumber(L, -1)) return 1; + lua_pop(L, 2); // non-number, ta_constants + } + !newindex ? lua_rawget(L, 1) : lua_rawset(L, 1); return 1; } -- cgit v1.2.3