R/insertNADefault.R

Defines functions insertNADefault

Documented in insertNADefault

#' Insert `%|%`
#'
#' Inserts [`%|%`][rlang::%|%] at the cursor position.
#'
#' @export
insertNADefault <- function() {
    glyph <- paste0("%|%", " ")
    rstudioapi::insertText(ifelse(nextToSpace(), glyph, prefixSpace(glyph)))
}
konradedgar/extraInserts documentation built on Feb. 20, 2023, 3:39 a.m.