Skip to content

Commit

Permalink
feat(fuzzyhelp): improve browser opening behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
atusy committed Mar 28, 2024
1 parent 891c8d1 commit 522140a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/fuzzyhelp.R
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,21 @@ fuzzyhelp_bg_view <- function(viewer) {
fuzzyhelp_bg_start <- function(app, server, viewer) {
writeLines("", .env$fuzzyhelp_url) # Ensure content is empty
callr::r_bg(
function(..., .env, base_viewer) {
function(..., .env, base_viewer, base_options) {
do.call(options, base_options)
viewer <- function(url) {
writeLines(url, .env$fuzzyhelp_url)
base_viewer(url)
}
shiny::runGadget(..., viewer = viewer)
},
args = list(app = app, server = server, .env = .env, base_viewer = viewer),
args = list(
app = app,
server = server,
.env = .env,
base_viewer = viewer,
base_options = options()
),
env = Sys.getenv(),
package = TRUE
)
Expand Down

0 comments on commit 522140a

Please sign in to comment.