aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 0aef64b8..a8a29c7c 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1100,6 +1100,7 @@ static int lbuffer_delete(lua_State *L) {
/** `_G.buffer_new()` Lua function. */
static int lbuffer_new(lua_State *L) {
+ if (initing) luaL_error(L, "cannot create buffers during initialization");
new_buffer(0);
lua_getfield(L, LUA_REGISTRYINDEX, "ta_buffers");
return (lua_rawgeti(L, -1, lua_rawlen(L, -1)), 1);