From 173987ee0e7aad43e1a740205ae3d21b3a96cccb Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 4 Mar 2008 22:55:46 -0500 Subject: Updated to use new modular lua_dialog.lua; core/init.lua --- core/init.lua | 25 ++++++++++++------------- 1 file 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 mitchellcaladbolg.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' -- cgit v1.2.3