From e672ee07c4b97fa205db0a5c75f69d9f8310eaac Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 4 Mar 2008 22:05:52 -0500 Subject: Fixed bugs with tonumber(cocoa_dialog(...)) in various files. Instead of the extra overhead when calling tonumber(), add the --no-newline option and do a direct string comparison. --- core/events.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/events.lua') diff --git a/core/events.lua b/core/events.lua index 732b5d50..fffa5aca 100644 --- a/core/events.lua +++ b/core/events.lua @@ -372,11 +372,12 @@ add_handler('quit', end end if any then - if tonumber( cocoa_dialog( 'yesno-msgbox', { + if cocoa_dialog( 'yesno-msgbox', { title = 'Save?', text = 'Save changes before quitting?', - ['informative-text'] = list..'\nYou will have to save changes manually.' - } ) ) ~= 2 then return false end + ['informative-text'] = list..'\nYou will have to save changes manually.', + ['no-newline'] = true + } ) ~= '2' then return false end end textadept.io.save_session() return true -- cgit v1.2.3