From 6c5bda943d87c629e3fbeaa9178d5fdcb96134c5 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 8 Mar 2012 17:52:03 -0500 Subject: `_G.timeout()` accepts fractional seconds now; src/textadept.c --- src/textadept.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index e98d18c1..8aa35935 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1871,7 +1871,7 @@ static gboolean emit_timeout(gpointer data) { } static int ltimeout(lua_State *L) { - int timeout = luaL_checkinteger(L, 1); + double timeout = luaL_checknumber(L, 1); luaL_argcheck(L, timeout > 0, 1, "timeout must be > 0"); luaL_argcheck(L, lua_isfunction(L, 2), 2, "function expected"); int n = lua_gettop(L); @@ -1882,7 +1882,7 @@ static int ltimeout(lua_State *L) { lua_pushvalue(L, i); refs[i - 2] = luaL_ref(L, LUA_REGISTRYINDEX); } - g_timeout_add_seconds(timeout, emit_timeout, (gpointer)refs); + g_timeout_add(timeout * 1000, emit_timeout, (gpointer)refs); return 0; } -- cgit v1.2.3