Skip to content

Commit

Permalink
Don't save the completion state at setcompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Oct 27, 2011
1 parent 15c6be3 commit 84fc80a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linenoise.c
Expand Up @@ -43,7 +43,10 @@ static int l_linenoise(lua_State *L)
{
const char *prompt = luaL_checkstring(L, 1);

completionState = L;
lua_pushstring(L, linenoise(prompt));
completionState = NULL;

return 1;
}

Expand Down Expand Up @@ -96,7 +99,6 @@ static int l_setcompletion(lua_State *L)
lua_pushvalue(L, 1);
completionFuncRef = luaL_ref(L, LUA_REGISTRYINDEX);
linenoiseSetCompletionCallback(completionCallbackWrapper);
completionState = L;

return 0;
}
Expand Down

0 comments on commit 84fc80a

Please sign in to comment.