aboutsummaryrefslogtreecommitdiff
path: root/src/textadept.c
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-08-22 18:23:48 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-08-22 18:23:48 -0400
commitcf9d617f13c38c27271eb88fd61a9495bca514d8 (patch)
treed71e22e9a7160abfcb1ad8475a1d6d2ff4f7e341 /src/textadept.c
parente78ff8b5f6fb724c34cc8e599e6b60592a3b8fe2 (diff)
downloadtextadept-cf9d617f13c38c27271eb88fd61a9495bca514d8.tar.gz
textadept-cf9d617f13c38c27271eb88fd61a9495bca514d8.zip
Fixed crashes introduced by r2915.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/textadept.c b/src/textadept.c
index fdbd07c1..7b8ef5f7 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1067,9 +1067,10 @@ static int delete_buffer_lua(lua_State *L) {
sptr_t doc = SS(view, SCI_GETDOCPOINTER, 0, 0);
if (lua_getfield(L, LUA_REGISTRYINDEX, "ta_buffers"), lua_rawlen(L, -1) == 1)
new_buffer(0);
- if (view == focused_view)
- goto_doc(L, focused_view, -1, true), emit(L, "buffer_after_switch", -1);
- return (delete_buffer(doc), emit(L, "buffer_deleted", -1), 0);
+ if (view == focused_view) goto_doc(L, focused_view, -1, true);
+ delete_buffer(doc), emit(L, "buffer_deleted", -1);
+ if (view == focused_view) emit(L, "buffer_after_switch", -1);
+ return 0;
}
/** `_G.buffer_new()` Lua function. */