diff options
author | 2019-07-30 17:19:57 -0400 | |
---|---|---|
committer | 2019-07-30 17:19:57 -0400 | |
commit | 2cea55c6e65e4ea7f735655b45d917b76e8b7945 (patch) | |
tree | c774bad437062eab22f8ebbea3e22937b15bc136 /src | |
parent | e1c41c53c4bb7bf6ef5770dce93e4cda21fb1a8e (diff) |
Fail more gracefully when attempting to create buffers on init.
Diffstat (limited to 'src')
-rw-r--r-- | src/textadept.c | 1 |
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); |