diff options
-rw-r--r-- | core/.gui.luadoc | 2 | ||||
-rw-r--r-- | src/lua_interface.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/.gui.luadoc b/core/.gui.luadoc index 9173b6e2..9e2d5ddf 100644 --- a/core/.gui.luadoc +++ b/core/.gui.luadoc @@ -14,7 +14,7 @@ module('gui') -- * `menubar`: A table of GTK menus defining a menubar (write-only). -- * `context_menu`: A GTK menu defining the editor's context menu. -- * `clipboard_text`: The text on the clipboard (read-only). --- * `statusbar_text`: The text displayed by the statusbar (write-only). +-- * `statusbar_text`: The text displayed by the statusbar. -- * `docstatusbar_text`: The text displayed by the doc statusbar (write-only). -- * `size`: The size of the Textadept window (`{ width, height}`). diff --git a/src/lua_interface.c b/src/lua_interface.c index 97d7ca8f..8a996e70 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -25,7 +25,7 @@ lua_State *lua; int closing = FALSE; -const char *statusbar_text = 0; +const char *statusbar_text = ""; static int tVOID = 0, tINT = 1, tLENGTH = 2, /*tPOSITION = 3, tCOLOUR = 4,*/ tBOOL = 5, tKEYMOD = 6, tSTRING = 7, tSTRINGRESULT = 8; @@ -926,7 +926,7 @@ 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_tostring(lua, 3); + statusbar_text = !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"); |