aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-09-21 20:06:25 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2008-09-21 20:06:25 -0400
commitfdb720e8d0b5adf4fd9269ee9e4381dc0aebdb39 (patch)
treeaca24d610cff92e0709c1f21e87f5ab1278a30ea /core/file_io.lua
parenta0799c95fa737a76a9e03156b42a4871ec4dd2dc (diff)
downloadtextadept-fdb720e8d0b5adf4fd9269ee9e4381dc0aebdb39.tar.gz
textadept-fdb720e8d0b5adf4fd9269ee9e4381dc0aebdb39.zip
Adapted lua-dialog file selection to work in Windows; core/file_io.lua
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua6
1 files 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