diff options
author | 2008-06-25 23:58:00 -0400 | |
---|---|---|
committer | 2008-06-25 23:58:00 -0400 | |
commit | c6b75e9e62576817af4a3115611f028a1e6aaa1f (patch) | |
tree | b9fbb5813672c77218843fd3a9ef79aa8bf49c76 | |
parent | 9f9d632e4eafd3af7a7ca21ac06263bc592ed479 (diff) | |
download | textadept-c6b75e9e62576817af4a3115611f028a1e6aaa1f.tar.gz textadept-c6b75e9e62576817af4a3115611f028a1e6aaa1f.zip |
Reverted treating lua_dialog as a program; adds Lua as an unwanted dependency.
-rw-r--r-- | core/init.lua | 12 | ||||
-rw-r--r-- | osx.patch | 35 |
2 files changed, 31 insertions, 16 deletions
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 @@ -1,15 +1,32 @@ diff -r b49f6c4c060a core/init.lua ---- a/core/init.lua Wed Jun 25 23:32:05 2008 -0400 -+++ b/core/init.lua Wed Jun 25 23:40:15 2008 -0400 -@@ -35,7 +35,7 @@ - args = args..' --'..k - if type(v) == 'string' then args = args..' "'..v..'"' end +--- a/core/init.lua Tue Jun 24 18:43:59 2008 -0400 ++++ b/core/init.lua Wed Jun 25 14:44:26 2008 -0400 +@@ -6,7 +6,6 @@ require 'iface' + require 'iface' + require 'events' + require 'file_io' +-require 'lua_dialog' + + --- + -- Checks if the buffer being indexed is the currently focused buffer. +@@ -31,10 +30,13 @@ end + -- used. + -- @return string CocoaDialog result. + function cocoa_dialog(kind, opts) +- local args = { kind } ++ local args = '' + for k, v in pairs(opts) do +- args[#args + 1] = '--'..k +- if type(v) == 'string' then args[#args + 1] = v end ++ args = args..' --'..k ++ if type(v) == 'string' then args = args..' "'..v..'"' end end -- local p = io.popen(_HOME..'/core/lua_dialog.lua '..kind..args) +- return lua_dialog.run(args) + local p = io.popen('CocoaDialog '..kind..args) - local out = p:read('*all') - p:close() - return out ++ local out = p:read('*all') ++ p:close() ++ return out + end diff -r b49f6c4c060a src/Makefile --- a/src/Makefile Tue Jun 24 18:43:59 2008 -0400 +++ b/src/Makefile Wed Jun 25 14:44:26 2008 -0400 |