diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-04-17 17:29:53 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-04-17 17:29:53 +0000 |
commit | 9957a53c3d6cad360297306214c13d804d99bdbf (patch) | |
tree | cfb07495cf6fc76a7b314c25d21cc2c2179e6ab4 /plugins/MirLua/src/mlua.cpp | |
parent | 563a5c7cdbdafd3991d4a542bb32224a3ab0816d (diff) |
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
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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);
|