aboutsummaryrefslogtreecommitdiff
path: root/core/events.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/events.lua')
-rw-r--r--core/events.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/events.lua b/core/events.lua
index 4d3d3e23..6236c25c 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -515,18 +515,19 @@ add_handler('view_switch',
add_handler('quit',
function() -- prompts for confirmation if any buffers are dirty; saves session
local any = false
- local list = 'The following buffers are unsaved:\n\n'
+ local list = { 'The following buffers are unsaved:\n' }
for _, buffer in ipairs(textadept.buffers) do
if buffer.dirty then
- list = list..(buffer.filename or 'Untitled')..'\n'
+ list[#list + 1] = buffer.filename or 'Untitled'
any = true
end
end
if any then
+ list[#list + 1] = '\nYou will have to save changes manually.\n'
if cocoa_dialog( 'yesno-msgbox', {
title = 'Save?',
text = 'Save changes before quitting?',
- ['informative-text'] = list..'\nYou will have to save changes manually.',
+ ['informative-text'] = table.concat(list, '\n'),
['no-newline'] = true
} ) ~= '2' then return false end
end