aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua6
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