aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:55:46 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2008-03-04 22:55:46 -0500
commit173987ee0e7aad43e1a740205ae3d21b3a96cccb (patch)
tree48b176d8ccfcf312516a15f8ff389a381baf5175
parente672ee07c4b97fa205db0a5c75f69d9f8310eaac (diff)
downloadtextadept-173987ee0e7aad43e1a740205ae3d21b3a96cccb.tar.gz
textadept-173987ee0e7aad43e1a740205ae3d21b3a96cccb.zip
Updated to use new modular lua_dialog.lua; core/init.lua
-rw-r--r--core/init.lua25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/init.lua b/core/init.lua
index 5f349634..3acd3875 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -1,5 +1,13 @@
-- Copyright 2007-2008 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+package.path = _HOME..'/core/?.lua;'..package.path
+package.cpath = _HOME..'/core/?.so;'..package.cpath
+
+require 'iface'
+require 'events'
+require 'file_io'
+require 'lua_dialog'
+
---
-- Checks if the buffer being indexed is the currently focused buffer.
-- This is necessary because any buffer actions are performed in the focused
@@ -23,19 +31,10 @@ end
-- used.
-- @return string CocoaDialog result.
function cocoa_dialog(kind, opts)
- local args = ''
+ local args = { kind }
for k, v in pairs(opts) do
- args = args..' --'..k
- if type(v) == 'string' then args = args..' "'..v..'"' end
+ args[#args + 1] = '--'..k
+ if type(v) == 'string' then args[#args + 1] = v end
end
- local p = io.popen('CocoaDialog '..kind..args)
- local out = p:read('*all')
- p:close()
- return out
+ return lua_dialog.run(args)
end
-
-package.path = _HOME..'/core/?.lua;'..package.path
-
-require 'iface'
-require 'events'
-require 'file_io'