From 9957a53c3d6cad360297306214c13d804d99bdbf Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 17 Apr 2016 17:29:53 +0000 Subject: MirLua: added function interpolate into string module: print(string.interpolate('some {1} string', 'cool')) git-svn-id: http://svn.miranda-ng.org/main/trunk@16704 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/MirLua/src/mlua.cpp') diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 8a9b0ce87c..afa7d7b04c 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -61,7 +61,11 @@ void CMLua::Load() lua_pushstring(L, "__mod"); lua_pushcfunction(L, luaM_interpolate); lua_rawset(L, -3); - lua_pop(L, 2); + lua_pushstring(L, "__index"); + lua_rawget(L, -2); + lua_pushcfunction(L, luaM_interpolate); + lua_setfield(L, -2, "interpolate"); + lua_pop(L, 3); lua_atpanic(L, luaM_atpanic); -- cgit v1.2.3