From 9cb41cfba6d7f96fbdcb781c3188858e6615a2ff Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 30 Dec 2008 15:31:28 -0500 Subject: Use table.concat instead of multiple string concats; core/events.lua --- core/events.lua | 7 ++++--- 1 file 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 -- cgit v1.2.3