about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-05 12:03:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-11-05 12:03:27 -0700
commitffaf456654bdf836526771801d64c6d85f4c7a54 (patch)
tree51ab7c10889370ee898fa30a670603f6feef1ff8 /src
parentac6c9319f9af3e5d047842b78859980184699d77 (diff)
downloadteliva-ffaf456654bdf836526771801d64c6d85f4c7a54.tar.gz
ohh, that word 'index' was key
Diffstat (limited to 'src')
-rw-r--r--src/lcurseslib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lcurseslib.c b/src/lcurseslib.c
index 042c7d8..ce8ec0e 100644
--- a/src/lcurseslib.c
+++ b/src/lcurseslib.c
@@ -112,6 +112,10 @@ static const luaL_Reg curses_window_methods[] =
 
 LUALIB_API int luaopen_curses (lua_State *L) {
   luaL_newmetatable(L, "curses:window");
+  /* metatable.__index = metatable */
+  lua_pushstring(L, "__index");
+  lua_pushvalue(L, -2);
+  lua_settable(L, -3);
   luaL_register(L, NULL, curses_window_methods);
   luaL_register(L, "curses", curseslib);
   /* save main window on registry */