Skip to content

Commit

Permalink
fix(windows): don't use default args if user args were provided (#64)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hungyiloo authored Jul 21, 2024
1 parent cf6ed6b commit deffbdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/gx/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ local function get_open_browser_app()
end

-- get the args for opening the webbrowser
local function get_open_browser_args(args)
local function get_open_browser_args()
local args = {}
if sysname == "Windows_NT" then
local win_args = { "start", "explorer.exe" }
return helper.concat_tables(win_args, args)
args = { "start", "explorer.exe" }
end
return args
end
Expand All @@ -93,7 +93,7 @@ local function with_defaults(options)

return {
open_browser_app = options.open_browser_app or get_open_browser_app(),
open_browser_args = get_open_browser_args(options.open_browser_args or {}),
open_browser_args = options.open_browser_args or get_open_browser_args(),
handlers = options.handlers or {},
handler_options = {
search_engine = options.handler_options.search_engine or "google",
Expand Down

0 comments on commit deffbdb

Please sign in to comment.