Skip to content

Commit

Permalink
Undo the ansi_collapse() fix
Browse files Browse the repository at this point in the history
Will have a different workaround.
  • Loading branch information
gaborcsardi committed Aug 28, 2024
1 parent 31f9c6c commit 53b1c8a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions R/glue.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,8 @@ collapse_head_notrim <- function(x, trunc, sep, sep2, last, ellipsis) {

lnx <- length(x)

if (lnx == 1L)
return(x)
if (lnx == 2L) {
# Handle the case where last is changed and sep2 is not
if (sep2 == " and " & last != ", and ")
return(paste0(x, collapse = last))
else
return(paste0(x, collapse = sep2))
}
if (lnx == 1L) return(x)
if (lnx == 2L) return(paste0(x, collapse = sep2))
if (lnx <= trunc) {
# no truncation
return(paste0(
Expand Down

0 comments on commit 53b1c8a

Please sign in to comment.