From 020ad62aa38e87f2fe8bb5faab496e3e1ca99733 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 30 Dec 2008 19:31:34 -0500 Subject: Fixes to recognize Windows path separators. --- core/file_io.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/file_io.lua') 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 -- cgit v1.2.3