diff options
author | 2008-02-29 19:37:02 -0500 | |
---|---|---|
committer | 2008-02-29 19:37:02 -0500 | |
commit | ced0910d0837c1d073d85145f23772c7f209da5a (patch) | |
tree | 0831c213e5e8f2ddb02ddb04839c999e2b3667b1 | |
parent | 9cbcaa8f4d21eb3ad3132b323e012bc8a4dcc663 (diff) | |
download | textadept-ced0910d0837c1d073d85145f23772c7f209da5a.tar.gz textadept-ced0910d0837c1d073d85145f23772c7f209da5a.zip |
Fixed empty buffer.filename bug in save_as(); core/file_io.lua
-rw-r--r-- | core/file_io.lua | 4 |
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 |