aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-12-30 15:31:28 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2008-12-30 15:31:28 -0500
commit9cb41cfba6d7f96fbdcb781c3188858e6615a2ff (patch)
treed1761dbd94f19152233e9ee33ade815ad43ae2a0 /core
parent61b7a0f0f089198bbad771a7024fffd605259d49 (diff)
downloadtextadept-9cb41cfba6d7f96fbdcb781c3188858e6615a2ff.tar.gz
textadept-9cb41cfba6d7f96fbdcb781c3188858e6615a2ff.zip
Use table.concat instead of multiple string concats; core/events.lua
Diffstat (limited to 'core')
-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