screen: export tags array

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-11 17:16:46 +02:00
parent abd0216194
commit bcfc3656ab
1 changed files with 9 additions and 0 deletions

View File

@ -247,6 +247,7 @@ luaA_screen_index(lua_State *L)
const char *buf = luaL_checklstring(L, 2, &len); const char *buf = luaL_checklstring(L, 2, &len);
screen_t *s; screen_t *s;
area_t g; area_t g;
int i;
s = lua_touserdata(L, 1); s = lua_touserdata(L, 1);
@ -287,6 +288,14 @@ luaA_screen_index(lua_State *L)
lua_pushnumber(L, g.height); lua_pushnumber(L, g.height);
lua_setfield(L, -2, "height"); lua_setfield(L, -2, "height");
break; break;
case A_TK_TAGS:
lua_newtable(L);
for(i = 0; i < s->tags.len; i++)
{
luaA_tag_userdata_new(L, s->tags.tab[i]);
lua_rawseti(L, -2, i + 1);
}
break;
default: default:
return 0; return 0;
} }