aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c8
1 files changed, 8 insertions, 0 deletions
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;
}