@@ -55,7 +55,7 @@ switch_repo_addin <- function()
5555 cur_sel <- " "
5656 # Default empty message for functions
5757 alt_fun_msg <- em(
58- " Select the name of a function in an editor" ,
58+ " Select the name of a known function in an editor" ,
5959 " before calling this addin if you want help on it..."
6060 )
6161
@@ -257,6 +257,10 @@ switch_repo_addin <- function()
257257
258258 server <- function (input , output , session ) {
259259
260+ observeEvent(input $ cancel , {
261+ stopApp(NULL )
262+ })
263+
260264 observeEvent(input $ done , {
261265 # Save selection of engine and language
262266 svMisc :: assign_temp(" sdd_help_engine" , input $ engine )
@@ -308,12 +312,17 @@ switch_repo_addin <- function()
308312 message <- warning_message
309313 }
310314
311- context <- try(suppressMessages(get_help(message )), silent = TRUE )
312- if (inherits(context , " try-error" )) {
313- message(" Error while invoking help: " , context )
314- } else if (is.null(context ) || ! length(context ) || ! is.list(context )) {
315+ # context <- try(suppressMessages(get_help(message)), silent = TRUE)
316+ # if (inherits(context, "try-error")) {
317+ # stop("Error while invoking help: ", context)
318+ # } else if (is.null(context) || !length(context) || !is.list(context)) {
319+ # # User cancelled or nothing selected
320+ # return(invisible())
321+ # }
322+ context <- get_help(message )
323+ if (is.null(context ) || ! length(context ) || ! is.list(context )) {
315324 # User cancelled or nothing selected
316- invisible ( return ())
325+ return ( invisible ())
317326 }
318327
319328 # Possibly escape "
0 commit comments