Skip to content

Wrong brace indention with two consecutive braces and strict = FALSE #430

Closed

Description

@lorenzwalthert

Migrated from #428.

Activity

  1. lorenzwalthert commented on Oct 14, 2018

    @lorenzwalthert
    CollaboratorAuthor
    text <- '
    eventReactive({
    
        code()
    },
        {
        code()
        }
        )
        '
    
    styler::style_text(text, strict = FALSE)
    #> 
    #> eventReactive({
    #> 
    #>   code()
    #> },    {
    #>   code()
    #> }
    #> )

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

  2. lorenzwalthert commented on Oct 14, 2018

    @lorenzwalthert
    CollaboratorAuthor

    This seems tricky to resolve because it would require to determine indention level of the first { / } based on whether the whole expression ends on the same line as the first { / }. I.e. it seems as the correct code would be as follows for the two cases:

    eventReactive({
        code()
      },
      {
        code()
      }
    )

    vs.

    eventReactive({
      code()
    })
  3. lorenzwalthert commented on Oct 14, 2018

    @lorenzwalthert
    CollaboratorAuthor

    Also, we have a postponed issue about simplification of indent indices computation (#76) which we'd better resolve first.

  4. lorenzwalthert commented on Apr 25, 2019

    @lorenzwalthert
    CollaboratorAuthor

    Actually, this is pretty much a special case of #485 as I see it now.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions