From c6b75e9e62576817af4a3115611f028a1e6aaa1f Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 25 Jun 2008 23:58:00 -0400 Subject: Reverted treating lua_dialog as a program; adds Lua as an unwanted dependency. --- core/init.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'core/init.lua') diff --git a/core/init.lua b/core/init.lua index 3869adf9..3acd3875 100644 --- a/core/init.lua +++ b/core/init.lua @@ -6,6 +6,7 @@ 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. @@ -30,13 +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(_HOME..'/core/lua_dialog.lua '..kind..args) - local out = p:read('*all') - p:close() - return out + return lua_dialog.run(args) end -- cgit v1.2.3