summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-28 03:53:26 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-28 04:12:06 +0200
commit745e758394e8b6e6118c920b79d333c73f5470ea (patch)
tree6010a10b78814066ba9995cf8e65e7efebe6a18e /degesch.c
parentb60bdf119a15856567729b33f328f7c770e3c1ce (diff)
downloadxK-745e758394e8b6e6118c920b79d333c73f5470ea.tar.gz
xK-745e758394e8b6e6118c920b79d333c73f5470ea.tar.xz
xK-745e758394e8b6e6118c920b79d333c73f5470ea.zip
degesch: add Lua API for screen size retrieval
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index 8b1ee4e..828857f 100644
--- a/degesch.c
+++ b/degesch.c
@@ -9807,6 +9807,14 @@ lua_plugin_connect (lua_State *L)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static int
+lua_plugin_get_screen_size (lua_State *L)
+{
+ lua_pushinteger (L, g_terminal.lines);
+ lua_pushinteger (L, g_terminal.columns);
+ return 2;
+}
+
+static int
lua_ctx_gc (lua_State *L)
{
return lua_weak_gc (L, &lua_ctx_info);
@@ -9826,8 +9834,9 @@ static luaL_Reg lua_plugin_library[] =
{ "connect", lua_plugin_connect },
// And these are methods:
+
+ { "get_screen_size", lua_plugin_get_screen_size },
{ "__gc", lua_ctx_gc },
- // TODO: get_prompt_ignore_markers()
{ NULL, NULL },
};