aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/ext/menu.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/ext/menu.lua')
-rw-r--r--core/ext/menu.lua13
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 = {