Skip to content

A whitespace after if(){}else{} is not showing #711

Description

@yousuketto

A whitespace after if(condition) {...} else {...} is not showing.

Reproduction

scalaVersion = "2.13.12"
sbt-twirl version: 1.6.2 (Reproduced in 1.6.0-M1+38-e141ce17-SNAPSHOT, Not reproduced in "1.6.0-M1+35-de50d09a-SNAPSHOT)

code

$ cat src/main/twirl/com/github/yousuketto/sample.scala.txt
@(b: Boolean)
You got @if(b) {a pullrequest} else {pullrequests} from someone.

Execute in sbt console

scala> com.github.yousuketto.txt.sample(false)
val res0: play.twirl.api.TxtFormat.Appendable =
You got pullrequestsfrom someone.

scala> com.github.yousuketto.txt.sample(true)
val res1: play.twirl.api.TxtFormat.Appendable =
You got a pullrequestfrom someone.

scala>

Expected

scala> com.github.yousuketto.txt.sample(true)
val res0: play.twirl.api.TxtFormat.Appendable =
You got a pullrequest from someone.

scala> com.github.yousuketto.txt.sample(true)
val res1: play.twirl.api.TxtFormat.Appendable =
You got a pullrequest from someone.

scala>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions