diff options
author | 2010-03-23 06:42:09 -0400 | |
---|---|---|
committer | 2010-03-23 06:42:09 -0400 | |
commit | 025d0b188daae6f5d8210883407a70fbb8e8a085 (patch) | |
tree | 0515e0df6a128da45f9ca751ebcf18619f2e5fe5 /core/ext | |
parent | b2d5d12254f9b1212aaf2174befe8ab54486841d (diff) | |
download | textadept-025d0b188daae6f5d8210883407a70fbb8e8a085.tar.gz textadept-025d0b188daae6f5d8210883407a70fbb8e8a085.zip |
Open help browser-agnostically for all platforms.
Diffstat (limited to 'core/ext')
-rw-r--r-- | core/ext/menu.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/ext/menu.lua b/core/ext/menu.lua index b8391d6b..703910e7 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -325,15 +325,14 @@ local function set_lexer(lexer) end local function open_webpage(url) local cmd - if not WIN32 then - cmd = - string.format('"%s" "file://%s"', not MAC and 'firefox' or 'open', url) + if WIN32 then + cmd = string.format('start "" "%s"', url) + local p = io.popen(cmd) + if not p then error(l.MENU_BROWSER_ERROR..url) else p:close() end else - cmd = - string.format('"%s" %s', - 'c:/program files/internet explorer/iexplore.exe', url) + cmd = string.format(MAC and 'open "file://%s"' or 'xdg-open "%s"', url) + if os.execute(cmd) ~= 0 then error(l.MENU_BROWSER_ERROR..url) end end - if os.execute(cmd) ~= 0 then error(l.MENU_BROWSER_ERROR) end end local actions = { |