vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 868fb876687e5307f1214e0ab9a4540d2b2046be parent 8a24283087bb85d134db51ab4b171d01e11da6d5 Author: Marc André Tanner <mat@brain-dump.org> Date: Sat, 20 Aug 2016 16:08:48 +0200 vis-lua: add win:draw() function Diffstat:
| M | README.md | | | 1 | + |
| M | vis-lua.c | | | 8 | ++++++++ |
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git 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 @@ -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 }, };