From 6f01f6891f6654cf1f38907960cd9b96a8bb64d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 27 Nov 2016 21:21:31 +0100 Subject: vis-lua: add file.path property denoting the absolute path to the file Close #407 --- 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 0c13d2d..f533b41 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -1096,6 +1096,11 @@ static int file_index(lua_State *L) { return 1; } + if (strcmp(key, "path") == 0) { + lua_pushstring(L, file->name); + return 1; + } + if (strcmp(key, "lines") == 0) { obj_ref_new(L, file->text, "vis.file.text"); return 1; -- cgit v1.2.3