Browse Source

Also send replacement to console if text is entered

tags/v0.2.0
Garrick Aden-Buie 8 years ago
parent
commit
47bdb2ae1a
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      R/regex_gadget.R

+ 6
- 1
R/regex_gadget.R View File

@@ -279,9 +279,14 @@ regex_gadget <- function(text = NULL,

# ---- Server - Tab - Exit ----
observeEvent(input$done, {
# browser()
if (pattern() != "") {
pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"')
if ("regexFn_replacement" %in% names(input) && replacement() != "") {
pattern <- paste0(
pattern, "\n",
'replacement <- "', escape_backslash(replacement()), '"'
)
}
rstudioapi::sendToConsole(pattern, FALSE)
}
stopApp()

Loading…
Cancel
Save