aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-10-17 23:56:45 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-10-17 23:56:45 -0400
commitb291fc4dc760ad90749a0692458e601b05906768 (patch)
tree954693826d19df6def77da9e3855b0ab69642b91
parent7ed4ddf2301dca386a363087dc3f091731efb67d (diff)
downloadtextadept-b291fc4dc760ad90749a0692458e601b05906768.tar.gz
textadept-b291fc4dc760ad90749a0692458e601b05906768.zip
Do not allow gui.statusbar_text to be set to nil.
-rw-r--r--core/.gui.luadoc2
-rw-r--r--src/lua_interface.c4
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");