diff options
author | 2009-01-27 13:14:24 -0500 | |
---|---|---|
committer | 2009-01-27 13:14:24 -0500 | |
commit | 94a974b31e106526ae9e626425580560221cb7a7 (patch) | |
tree | a7bf66c411b55881a9d94124832725e781e8a485 /src/lua_interface.c | |
parent | bcf630f108fcb957b0a908b258fe3a644e189ceb (diff) | |
download | textadept-94a974b31e106526ae9e626425580560221cb7a7.tar.gz textadept-94a974b31e106526ae9e626425580560221cb7a7.zip |
Encapsulate cec_store so it's not global.
Diffstat (limited to 'src/lua_interface.c')
-rw-r--r-- | src/lua_interface.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c index 745ce368..69033bf3 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -826,18 +826,19 @@ bool l_cec_get_completions_for(const char *entry_text) { /** * Populates the Command Entry Completion with the contents of a Lua table at * the stack top. + * @param store The GtkListStore to populate. * @see l_cec_get_completions_for */ -void l_cec_populate() { +void l_cec_populate(GtkListStore *store) { GtkTreeIter iter; if (!lua_istable(lua, -1)) return warn("command_entry.get_completions_for return not a table."); - gtk_list_store_clear(cec_store); + gtk_list_store_clear(store); lua_pushnil(lua); while (lua_next(lua, -2)) { if (lua_type(lua, -1) == LUA_TSTRING) { - gtk_list_store_append(cec_store, &iter); - gtk_list_store_set(cec_store, &iter, 0, lua_tostring(lua, -1), -1); + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, lua_tostring(lua, -1), -1); } else warn("command_entry.get_completions_for: string value expected."); lua_pop(lua, 1); // value } |