Skip to content

Wrap long lines#414

Merged
lorenzwalthert merged 1 commit into
r-lib:line-withfrom
krivit:line_width
Apr 22, 2019
Merged

Wrap long lines#414
lorenzwalthert merged 1 commit into
r-lib:line-withfrom
krivit:line_width

Conversation

@lorenzwalthert

@lorenzwalthert lorenzwalthert commented Aug 2, 2018

Copy link
Copy Markdown
Collaborator

Reference: #390.

@lorenzwalthert

lorenzwalthert commented Aug 12, 2018

Copy link
Copy Markdown
Collaborator Author
  • rebasing on master and resolve merge conflicts.
  • apply styler to the PR.
  • replace base R calls to apply() and friends with purrr equivalents.
  • replace the repeat() and while() statements with recursions.
  • documenting with roxygen.
  • adding unit tests and thinking of exceptions.
  • some minor code refactoring (i.e. don't define functions within functions, function re-naming, exposing of the width argument).

@lorenzwalthert

Copy link
Copy Markdown
Collaborator Author

Potential problems with the current implementation are noted in
#247 (comment)

@krlmlr

krlmlr commented Sep 18, 2018

Copy link
Copy Markdown
Member

I'm seeing:

styler::style_text("1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1")
#> 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
#> 
#>   1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
#>   + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

Created on 2018-09-18 by the reprex package (v0.2.1)

All lines must end in a + .

@krlmlr

krlmlr commented Sep 18, 2018

Copy link
Copy Markdown
Member

Moreover, the following loops indefinitely:

styler::style_text('styler::style_text("1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1")')

lorenzwalthert added a commit that referenced this pull request Nov 18, 2018
@lorenzwalthert lorenzwalthert merged commit f498570 into r-lib:line-with Apr 22, 2019
@lorenzwalthert

Copy link
Copy Markdown
Collaborator Author

Ok, merging this now (not into master, just into the r-lib devel branch). Thanks @krivit.

@pat-s

pat-s commented Mar 20, 2020

Copy link
Copy Markdown
Contributor

Has the line-with branch ever been tried out in practice? I would be willing to though it would need a rebase with master - and I am afraid to run into merge conflicts :)

@lorenzwalthert

Copy link
Copy Markdown
Collaborator Author

Let's continue this discussion in #496.

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.

4 participants