diff options
author | 2012-03-08 17:52:03 -0500 | |
---|---|---|
committer | 2012-03-08 17:52:03 -0500 | |
commit | 6c5bda943d87c629e3fbeaa9178d5fdcb96134c5 (patch) | |
tree | df62c55f8b3d97ddb9846471c5f39750231f65d8 /src/textadept.c | |
parent | ffd8c1c91946ee5d23d0003b494610efde00f24c (diff) | |
download | textadept-6c5bda943d87c629e3fbeaa9178d5fdcb96134c5.tar.gz textadept-6c5bda943d87c629e3fbeaa9178d5fdcb96134c5.zip |
`_G.timeout()` accepts fractional seconds now; src/textadept.c
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |