From fdb720e8d0b5adf4fd9269ee9e4381dc0aebdb39 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 21 Sep 2008 20:06:25 -0400 Subject: Adapted lua-dialog file selection to work in Windows; core/file_io.lua --- core/file_io.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/file_io.lua b/core/file_io.lua index 06c2661f..cc12fd28 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -40,14 +40,16 @@ end --- -- Opens a list of files. --- @param filenames A '|' separated list of filenames to open. If none +-- @param filenames A '\n' separated list of filenames to open. If none -- specified, the user is prompted to open files from a dialog. -- @usage textadept.io.open(filename) function open(filenames) filenames = filenames or cocoa_dialog( 'fileselect', { title = 'Open', text = 'Select a file(s) to open', - ['select-multiple'] = true, + -- in Windows, dialog:get_filenames() is unavailable; only allow single + -- selection + ['select-multiple'] = not WIN32 or nil, ['with-directory'] = (buffer.filename or ''):match('.+/') } ) for filename in filenames:gmatch('[^\n]+') do open_helper(filename) end -- cgit v1.2.3