From 341b490b5981de164958eaf83fdf1ade9f85c764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 15 Apr 2016 21:13:41 +0200 Subject: vis-lua: add file.size to return file size in bytes --- vis-lua.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index f3ec125..b21bca6 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -657,6 +657,11 @@ static int file_index(lua_State *L) { } return 1; } + + if (strcmp(key, "size") == 0) { + lua_pushunsigned(L, text_size(file->text)); + return 1; + } } return index_common(L); -- cgit v1.2.3