diff options
-rw-r--r-- | core/events.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/events.lua b/core/events.lua index 7deac1a2..3e79e931 100644 --- a/core/events.lua +++ b/core/events.lua @@ -398,6 +398,15 @@ add_handler('view_after_switch', handle('update_ui') end) +textadept.events.add_handler('buffer_new', + function() -- close initial 'Untitled' buffer + local b = textadept.buffers[1] + if #textadept.buffers == 2 and not (b.filename or b._type or b.dirty) then + view:goto_buffer(1, true) + buffer:close() + end + end) + add_handler('quit', function() -- prompts for confirmation if any buffers are dirty local any = false |