浏览代码

Add "global" option to gadget

pull/21/head
父节点
当前提交
f56ab7de40
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      R/regex_gadget.R

+ 5
- 2
R/regex_gadget.R 查看文件

@@ -71,12 +71,14 @@ regex_gadget <- function(
inline = TRUE,
width = "90%",
choiceValues = list(
"global",
"text_break_lines",
"ignore.case",
"fixed",
"perl",
"useBytes"),
choiceNames = list(
HTML('<span style="color: #337ab7;">Global</span>'),
HTML('<span style="color: #337ab7;">Break Lines</span>'),
HTML('<span style="color: #5cb85c;">Ignore Case</span>'),
HTML('<span style="color: #5cb85c;">Fixed/Literal</span>'),
@@ -213,7 +215,8 @@ regex_gadget <- function(
# invert = 'invert' %in% input$regex_options,
render = FALSE,
escape = TRUE,
exact = FALSE),
exact = FALSE,
global = "global" %in% input$regex_options),
collapse = ""
)
},
@@ -710,7 +713,7 @@ regex_gadget <- function(
if (pattern() != "") {
pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"')
if (any(c("perl", "fixed", "ignore.case", "useBytes") %in% input$regex_options)) {
options <- input$regex_options[input$regex_options != "text_break_lines"]
options <- input$regex_options[!input$regex_options %in% c("text_break_lines", "global")]
options <- paste0(options, "=TRUE", collapse = ", ")
pattern <- paste(pattern, "#", options)
}

正在加载...
取消
保存