diff options
author | 2010-12-28 21:16:29 -0500 | |
---|---|---|
committer | 2010-12-28 21:16:29 -0500 | |
commit | b4a6d0a685c7f1eb7f180de086bcb336b0bfb343 (patch) | |
tree | e280b315b777bc3acfd9c43c303ae67a3dbd15a0 | |
parent | 239343c9aec7104d2635e5c810987d2cab8ce912 (diff) | |
download | textadept-b4a6d0a685c7f1eb7f180de086bcb336b0bfb343.tar.gz textadept-b4a6d0a685c7f1eb7f180de086bcb336b0bfb343.zip |
Fixed gui.statusbar_text bug; src/textadept.c
-rw-r--r-- | src/textadept.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c index 3fbf46d7..58ede1a6 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -93,7 +93,7 @@ static gbool c_keypress(GtkWidget *, GdkEventKey *, gpointer); // Lua lua_State *lua; int closing = FALSE; -const char *statusbar_text = ""; +char *statusbar_text = 0; static int tVOID = 0, tINT = 1, tLENGTH = 2, /*tPOSITION = 3, tCOLOUR = 4,*/ tBOOL = 5, tKEYMOD = 6, tSTRING = 7, tSTRINGRESULT = 8; @@ -1736,7 +1736,8 @@ static int l_gui_mt_newindex(lua_State *lua) { else if (streq(key, "docstatusbar_text")) set_statusbar_text(lua_tostring(lua, 3), 1); else if (streq(key, "statusbar_text")) { - statusbar_text = !lua_isnil(lua, 3) ? lua_tostring(lua, 3) : ""; + g_free(statusbar_text); + statusbar_text = g_strdup(!lua_isnil(lua, 3) ? lua_tostring(lua, 3) : ""); set_statusbar_text(statusbar_text, 0); } else if (streq(key, "menubar")) { luaL_argcheck(lua, lua_istable(lua, 3), 3, "table of menus expected"); |