aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-02-29 19:37:02 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2008-02-29 19:37:02 -0500
commitced0910d0837c1d073d85145f23772c7f209da5a (patch)
tree0831c213e5e8f2ddb02ddb04839c999e2b3667b1
parent9cbcaa8f4d21eb3ad3132b323e012bc8a4dcc663 (diff)
downloadtextadept-ced0910d0837c1d073d85145f23772c7f209da5a.tar.gz
textadept-ced0910d0837c1d073d85145f23772c7f209da5a.zip
Fixed empty buffer.filename bug in save_as(); core/file_io.lua
-rw-r--r--core/file_io.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index ed2b8c55..25fe2c0e 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -102,8 +102,8 @@ function save_as(buffer, filename)
if not filename then
filename = cocoa_dialog( 'filesave', {
title = 'Save',
- ['with-directory'] = buffer.filename:match('.+/'),
- ['with-file'] = buffer.filename:match('[^/]+$'),
+ ['with-directory'] = (buffer.filename or ''):match('.+/'),
+ ['with-file'] = (buffer.filename or ''):match('[^/]+$'),
['no-newline'] = true
} )
end