aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:05:52 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:05:52 -0500
commite672ee07c4b97fa205db0a5c75f69d9f8310eaac (patch)
tree9a026d4edd3c840b49c2b2c79115d143285903f1 /core/file_io.lua
parent4187ba40e77ee91ae99b6fb6356cced2eb717d7e (diff)
downloadtextadept-e672ee07c4b97fa205db0a5c75f69d9f8310eaac.tar.gz
textadept-e672ee07c4b97fa205db0a5c75f69d9f8310eaac.zip
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.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 5788c509..496afebd 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -137,11 +137,12 @@ end
-- @usage buffer:close()
function close(buffer)
textadept.check_focused_buffer(buffer)
- if buffer.dirty and tonumber( cocoa_dialog( 'yesno-msgbox', {
+ if buffer.dirty and cocoa_dialog( 'yesno-msgbox', {
title = 'Save?',
text = 'Save changes before closing?',
- ['informative-text'] = 'You will have to save changes manually.'
- } ) ) ~= 2 then return false end
+ ['informative-text'] = 'You will have to save changes manually.',
+ ['no-newline'] = true
+ } ) ~= '2' then return false end
buffer:delete()
return true
end