Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use last for length 2 vectors with ansi_collapse() when sep2 not used #718

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

rundel
Copy link
Contributor

@rundel rundel commented Aug 15, 2024

This addresses #681 - rather than always using the sep2 separator the new code does the following for the vector length 2 case:

  • If last is non-default (i.e. not ", and") and sep2 is default (i.e. " and ") use last rather than sep2 when collapsing

  • Otherwise use sep2 when collapsing

R/glue.R Outdated Show resolved Hide resolved
@gaborcsardi
Copy link
Member

Thank you! In the end I chose a different approach, but your PR has very helpful, still.

@gaborcsardi gaborcsardi merged commit 8d707ba into r-lib:main Aug 28, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants