Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yousuketto opened this issue Nov 13, 2023 · 2 comments
Closed

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

yousuketto opened this issue Nov 13, 2023 · 2 comments

Comments

@yousuketto
Copy link
Contributor

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>
@mkurz
Copy link
Member

mkurz commented Nov 13, 2023

According to

git log de50d09a..e141ce17

this must be caused by e8b6ceb

@tototoshi or also @yousuketto can you take a look here and provide a pull request if you have time? Also a test would be great, thanks! I may fix that, but have lots of other stuff to do, so it might take a while.

@mkurz
Copy link
Member

mkurz commented Nov 16, 2023

@mkurz mkurz closed this as completed Nov 16, 2023
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

No branches or pull requests

2 participants