Skip to content

comments and line-breaks #89

Closed
Closed

Description

@lorenzwalthert

Comments will currently not be moved to the end of a line if we change line breaks.

a <- function(x) # 
{
  x + 1
}

becomes

a <- function(x) # {
  x + 1
}

Which is really not what we want 😩. I think we talked about this case @krlmlr, but I just forgot about it.

Activity

  1. lorenzwalthert commented on Jul 25, 2017

    @lorenzwalthert
    CollaboratorAuthor

    Any ideas how to solve that? Maybe we can use the pre_visitor to move the comment into the next child (top position) if there is no line break after the comment and then deal with it once we get to the child?

  2. krlmlr commented on Jul 25, 2017

    @krlmlr
    Member

    I'm fine with just leaving the code as is, i.e. don't strip newlines if the preceding token is a comment.

  3. added 2 commits that reference this issue on Jul 27, 2017
    59c25ee
    57ff203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions