Skip to content

Commit

Permalink
Replace paste(, sep = "") with paste0()
Browse files Browse the repository at this point in the history
  • Loading branch information
jalvesaq committed Apr 24, 2021
1 parent a8505e7 commit 87864f5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion R/nvimcom/R/etags2ctags.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ etags2ctags <- function(etagsfile, ctagsfile){
curaddr <- gsub("\\\\", "\\\\\\\\", curaddr)
curaddr <- gsub("\t", "\\\\t", curaddr)
curaddr <- gsub("/", "\\\\/", curaddr)
curaddr <- paste("/^", curaddr, "$/;\"", sep = "")
curaddr <- paste0("/^", curaddr, "$/;\"")
clines[k] <- paste(curname, curfile, curaddr, sep = "\t")
i <- i + 1
k <- k + 1
Expand Down
8 changes: 4 additions & 4 deletions R/nvimcom/R/nvim.bol.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ nvim.bol <- function(omnilist, packlist, allnames = FALSE) {
if(missing(packlist))
listpack <- loadpack[grep("^package:", loadpack)]
else
listpack <- paste("package:", packlist, sep = "")
listpack <- paste0("package:", packlist)

needunload <- FALSE
for(curpack in listpack){
Expand Down Expand Up @@ -356,8 +356,8 @@ nvim.bol <- function(omnilist, packlist, allnames = FALSE) {
for(obj in obj.list){
ol <- try(nvim.omni.line(obj, curpack, curlib, 0))
if(inherits(ol, "try-error"))
warning(paste("Error while generating omni completion line for: ",
obj, " (", curpack, ", ", curlib, ").\n", sep = ""))
warning(paste0("Error while generating omni completion line for: ",
obj, " (", curpack, ", ", curlib, ").\n"))
}
sink()
# Build list of functions for syntax highlight
Expand Down Expand Up @@ -402,7 +402,7 @@ nvim.bol <- function(omnilist, packlist, allnames = FALSE) {
}
}
writeLines(text = "Finished",
con = paste(Sys.getenv("NVIMR_TMPDIR"), "/nvimbol_finished", sep = ""))
con = paste0(Sys.getenv("NVIMR_TMPDIR"), "/nvimbol_finished"))
return(invisible(NULL))
}

Expand Down
8 changes: 4 additions & 4 deletions R/nvimcom/R/nvim.help.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ nvim.help <- function(topic, w, firstobj, package)
mlen <- try(length(methods(topic)), silent = TRUE)
if(class(mlen) == "integer" && mlen > 0){
for(i in 1:length(objclass)){
newtopic <- paste(topic, ".", objclass[i], sep = "")
newtopic <- paste0(topic, ".", objclass[i])
if(length(utils::help(newtopic))){
topic <- newtopic
break
Expand Down Expand Up @@ -73,7 +73,7 @@ nvim.help <- function(topic, w, firstobj, package)
h <- utils::help(topic, package = as.character(package), help_type = "text")

if(length(h) == 0){
msg <- paste('No documentation for "', topic, '" in loaded packages and libraries.', sep = "")
msg <- paste0('No documentation for "', topic, '" in loaded packages and libraries.')
.C("nvimcom_msg_to_nvim", paste0("RWarningMsg('", msg, "')"), PACKAGE="nvimcom")
return(invisible(NULL))
}
Expand All @@ -85,9 +85,9 @@ nvim.help <- function(topic, w, firstobj, package)
.C("nvimcom_msg_to_nvim", paste0("ShowRDoc('", msg, "')"), PACKAGE="nvimcom")
return(invisible(NULL))
} else {
h <- h[grep(paste("/", package, "/", sep = ""), h)]
h <- h[grep(paste0("/", package, "/"), h)]
if(length(h) == 0){
msg <- paste("Package '", package, "' has no documentation for '", topic, "'", sep = "")
msg <- paste0("Package '", package, "' has no documentation for '", topic, "'")
.C("nvimcom_msg_to_nvim", paste0("RWarningMsg('", msg, "')"), PACKAGE="nvimcom")
return(invisible(NULL))
}
Expand Down
4 changes: 2 additions & 2 deletions R/nvimcom/R/nvim.print.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ nvim.print <- function(object, firstobj)
mlen <- try(length(methods(object)), silent = TRUE)
if(class(mlen) == "integer" && mlen > 0){
for(cls in objclass){
if(exists(paste(object, ".", objclass, sep = ""))){
.newobj <- get(paste(object, ".", objclass, sep = ""))
if(exists(paste0(object, ".", objclass))){
.newobj <- get(paste0(object, ".", objclass))
message(paste0("Note: Printing ", object, ".", objclass))
break
}
Expand Down
2 changes: 1 addition & 1 deletion R/nvimcom/R/nvim.srcdir.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nvim.srcdir <- function(dr = "."){
for(f in list.files(path = dr, pattern = "\\.[RrSsQq]$")){
cat(f, "\n")
source(paste(dr, "/", f, sep = ""))
source(paste0(dr, "/", f))
}
return(invisible(NULL))
}
14 changes: 7 additions & 7 deletions R/nvimcom/R/specialfuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ nvim.args <- function(funcname, txt = "", pkg = NULL, objclass, extrainfo = FALS
mlen <- try(length(methods(funcname)), silent = TRUE) # Still get warns
if(class(mlen) == "integer" && mlen > 0){
for(i in 1:length(objclass)){
funcmeth <- paste(funcname, ".", objclass[i], sep = "")
funcmeth <- paste0(funcname, ".", objclass[i])
if(existsFunction(funcmeth)){
funcname <- funcmeth
frm <- formals(funcmeth)
Expand All @@ -212,7 +212,7 @@ nvim.args <- function(funcname, txt = "", pkg = NULL, objclass, extrainfo = FALS

if(is.na(frm[1])){
if(is.null(pkg)){
deffun <- paste(funcname, ".default", sep = "")
deffun <- paste0(funcname, ".default")
if (existsFunction(deffun) && pkgname[1] != ".GlobalEnv") {
funcname <- deffun
funcmeth <- deffun
Expand All @@ -227,7 +227,7 @@ nvim.args <- function(funcname, txt = "", pkg = NULL, objclass, extrainfo = FALS
idx <- grep(paste0(":", pkg, "$"), search())
if(length(idx)){
ff <- "NULL"
tr <- try(ff <- get(paste(funcname, ".default", sep = ""), pos = idx), silent = TRUE)
tr <- try(ff <- get(paste0(funcname, ".default"), pos = idx), silent = TRUE)
if(class(tr)[1] == "try-error")
ff <- get(funcname, pos = idx)
frm <- formals(ff)
Expand Down Expand Up @@ -301,12 +301,12 @@ nvim.args <- function(funcname, txt = "", pkg = NULL, objclass, extrainfo = FALS
info <- pkgname[1]
if(!is.na(funcmeth)){
if(info != "")
info <- paste(info, ", ", sep = "")
info <- paste(info, "function:", funcmeth, "()", sep = "")
info <- paste0(info, ", ")
info <- paste0(info, "function:", funcmeth, "()")
}
# TODO: Add the method name to the completion menu
# if(info != "")
# res <- paste(res, "\x04", info, sep = "")
# res <- paste0(res, "\x04", info)
}
}

Expand Down Expand Up @@ -393,7 +393,7 @@ nvim_complete_args <- function(rkeyword0, argkey, firstobj = "", pkg = NULL)
res <- nvim.args(rkeyword0, argkey, pkg, objclass, extrainfo = TRUE, sdq = FALSE)
}
writeLines(text = res,
con = paste(Sys.getenv("NVIMR_TMPDIR"), "/args_for_completion", sep = ""))
con = paste0(Sys.getenv("NVIMR_TMPDIR"), "/args_for_completion"))
.C("nvimcom_msg_to_nvim", paste0('FinishArgsCompletion("', argkey, '", "', rkeyword0,'")'), PACKAGE="nvimcom")
return(invisible(NULL))
}

0 comments on commit 87864f5

Please sign in to comment.