Skip to content

Commit

Permalink
added a pmax to fix the issue for MilesMcBain#140
Browse files Browse the repository at this point in the history
  • Loading branch information
muschellij2 committed Oct 13, 2024
1 parent eea741d commit 9f30db2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/tribble_paste.R
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ nslash_str <- function(char_vec){
#' @return char_vec left-padded with spaces to char_length.
#'
pad_to <-function(char_vec, char_length){
paste0(strrep(" ",char_length - nchar(char_vec)),char_vec)
paste0(strrep(" ", pmax(0, char_length - nchar(char_vec))),char_vec)
}

#' render_type
Expand Down Expand Up @@ -453,7 +453,7 @@ rstudio_context <- function(){
output_context <- list()
output_context$indent_head <- FALSE #head already at cursor
output_context$output_mode <- "rstudioapi"
output_context$nspc <-
output_context$nspc <-
rstudioapi::readRStudioPreference("num_spaces_for_tab", 4)
context <- rstudioapi::getActiveDocumentContext()
context_row <- context$selection[[1]]$range$start["row"]
Expand Down

0 comments on commit 9f30db2

Please sign in to comment.