You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An effective way to get an overview of the code is to read the comments without reading the code. Setting comments off with a blank line helps distinguish code from comments and makes it easy for the reader to scan the code or the comment.
Actual
This is a minimal reprex to illustrate the issue, but you can scale this to more complex comments and highly involved code block below each comment.
styler::style_text("# comment-1if (TRUE) { # comment-2 x <- 1 # comment-3 a <- 3}# comment-4x + 1")
#> # comment-1#> if (TRUE) {#> # comment-2#> x <- 1#> # comment-3#> a <- 3#> }#> # comment-4#> x + 1
I see the use case, but most people won't want this always. Note that {styler} preserves line breaks around comments in certain situations (search the issues for more context), e.g. in your case,
styler::style_text("# comment-1if (TRUE) { # comment-2 x <- 1 # comment-3 a <- 3}# comment-4x + 1")
#> # comment-1#> if (TRUE) {#> # comment-2#> x <- 1#> #> # comment-3#> a <- 3#> }#> #> # comment-4#> x + 1
Preamble
An effective way to get an overview of the code is to read the comments without reading the code. Setting comments off with a blank line helps distinguish code from comments and makes it easy for the reader to scan the code or the comment.
Actual
This is a minimal reprex to illustrate the issue, but you can scale this to more complex comments and highly involved code block below each comment.
Created on 2022-11-30 with reprex v2.0.2
Expected
Note that this doesn't apply to the comments at the start of the scope.
The text was updated successfully, but these errors were encountered: