diff options
author | 2008-12-30 19:31:34 -0500 | |
---|---|---|
committer | 2008-12-30 19:31:34 -0500 | |
commit | 020ad62aa38e87f2fe8bb5faab496e3e1ca99733 (patch) | |
tree | 2dfb9f92124a567f0fcb9c523b3f7386f440f7c4 /core/file_io.lua | |
parent | 9cb41cfba6d7f96fbdcb781c3188858e6615a2ff (diff) | |
download | textadept-020ad62aa38e87f2fe8bb5faab496e3e1ca99733.tar.gz textadept-020ad62aa38e87f2fe8bb5faab496e3e1ca99733.zip |
Fixes to recognize Windows path separators.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 21082f11..252afef2 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -50,7 +50,7 @@ function open(filenames) -- in Windows, dialog:get_filenames() is unavailable; only allow single -- selection ['select-multiple'] = not WIN32 or nil, - ['with-directory'] = (buffer.filename or ''):match('.+/') + ['with-directory'] = (buffer.filename or ''):match('.+[/\\]') } ) for filename in filenames:gmatch('[^\n]+') do open_helper(filename) end end @@ -104,8 +104,8 @@ function save_as(buffer, filename) if not filename then filename = cocoa_dialog( 'filesave', { title = 'Save', - ['with-directory'] = (buffer.filename or ''):match('.+/'), - ['with-file'] = (buffer.filename or ''):match('[^/]+$'), + ['with-directory'] = (buffer.filename or ''):match('.+[/\\]'), + ['with-file'] = (buffer.filename or ''):match('[^/\\]+$'), ['no-newline'] = true } ) end |