Browse Source

degesch: add Lua API for screen size retrieval

tags/v0.9.5
parent
commit
745e758394
Signed by: p <p.janouch@gmail.com> GPG Key ID: B715679E3A361BE6
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      degesch.c

+ 10
- 1
degesch.c View File

@@ -9806,6 +9806,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)
{
@@ -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 },
};



Loading…
Cancel
Save