Skip to content

Commit deffbdb

Browse files
authored
fix(windows): don't use default args if user args were provided (#64)
Previously, the "start" and "explorer.exe" args would always be added to the args list when on Windows, irrespective of whether the user overrode the open_browser_args in the plugin config or not. This made it impossible to configure a custom browser opening command not involving "start" and "explorer.exe". This commit changes the behavior to be more consistent with the open_browser_app config, i.e. if the user provides args overrides, use exactly what the user specifies and nothing else, which gives freedom back to Windows users.
1 parent cf6ed6b commit deffbdb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/gx/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ local function get_open_browser_app()
7979
end
8080

8181
-- get the args for opening the webbrowser
82-
local function get_open_browser_args(args)
82+
local function get_open_browser_args()
83+
local args = {}
8384
if sysname == "Windows_NT" then
84-
local win_args = { "start", "explorer.exe" }
85-
return helper.concat_tables(win_args, args)
85+
args = { "start", "explorer.exe" }
8686
end
8787
return args
8888
end
@@ -93,7 +93,7 @@ local function with_defaults(options)
9393

9494
return {
9595
open_browser_app = options.open_browser_app or get_open_browser_app(),
96-
open_browser_args = get_open_browser_args(options.open_browser_args or {}),
96+
open_browser_args = options.open_browser_args or get_open_browser_args(),
9797
handlers = options.handlers or {},
9898
handler_options = {
9999
search_engine = options.handler_options.search_engine or "google",

0 commit comments

Comments
 (0)