From 928a55e2433a780d75f997ecc1f9ff956b6220d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 20 Aug 2016 16:08:48 +0200 Subject: vis-lua: add win:draw() function --- README.md | 1 + vis-lua.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 2264013..c88f5f7 100644 --- a/README.md +++ b/README.md @@ -625,6 +625,7 @@ At this time there exists no API stability guarantees. - `viewport` a range denoting the currently visible area of the window - `width` and `height`, readonly, query window dimension - `status(left [,right])` set the content of the window status bar + - `draw()` redraw window content - `cursor` - `line` (1 based), `col` (1 based) - `to(line, col)` diff --git a/vis-lua.c b/vis-lua.c index 5aff161..56949fe 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -934,6 +934,13 @@ static int window_status(lua_State *L) { return 0; } +static int window_draw(lua_State *L) { + Win *win = obj_ref_check(L, 1, "vis.window"); + if (win) + view_draw(win->view); + return 0; +} + static const struct luaL_Reg window_funcs[] = { { "__index", window_index }, { "__newindex", window_newindex }, @@ -942,6 +949,7 @@ static const struct luaL_Reg window_funcs[] = { { "style_define", window_style_define }, { "style", window_style }, { "status", window_status }, + { "draw", window_draw }, { NULL, NULL }, }; -- cgit v1.2.3