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

Inconsistently setting end of text line break for style_text() #887

Closed
lorenzwalthert opened this issue Dec 28, 2021 · 4 comments
Closed

Comments

@lorenzwalthert
Copy link
Collaborator

REditorSupport/languageserver#462 (comment)

@lorenzwalthert
Copy link
Collaborator Author

I can reproduce the problem with the CRAN version of styler, but in the dev version, it seems already fixed and a duplicate of #865.

@lorenzwalthert
Copy link
Collaborator Author

lorenzwalthert commented Dec 28, 2021

packageVersion('styler')
#> [1] '1.6.2.9000'
library(styler)
cache_clear(ask = FALSE)
cache_info()
#> Size:        0 bytes (0 cached expressions)
#> Last modified:   NA
#> Created: 2021-12-28 13:09:45
#> Location:    /Users/lorenz/Library/Caches/org.R-project.R/R/R.cache/styler/1.6.2.9000
#> Activated:   FALSE
cache_activate()
#> Using cache 1.6.2.9000 at /Users/lorenz/Library/Caches/org.R-project.R/R/R.cache/styler/1.6.2.9000.
as.character(style_text(c("print(1)", "")))
#> [1] "print(1)"
as.character(style_text(c("print(1)", ""))) 
#> [1] "print(1)"
as.character(style_text(c("print(1)", "", "", ""))) 
#> [1] "print(1)"

Created on 2021-12-28 by the reprex package (v2.0.1)

@lorenzwalthert
Copy link
Collaborator Author

@renkun-ken can you confirm?

@renkun-ken
Copy link
Contributor

The latest dev could produce consistent result with the trailing blank line removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants