Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/present: .play snippet don't handle inserted newlines when using the Enter key. #9011
Before filing a bug, please check whether it has been fixed since the latest release. Search the issue tracker and check that you're running the latest version of Go: Run "go version" and compare against http://golang.org/doc/devel/release.html If a newer version of Go exists, install it and retry what you did to reproduce the problem. Thanks. What does 'go version' print? go version go1.3.3 linux/amd64 What steps reproduce the problem? Using the following configuration: - OS: Arch Linux - Web browser: Chrome Version 38.0.2125.104 (64-bit) - Keyboard layout: US Internationl AltGr Unicode combining 1. Edit the code in a present ".play" snippet. 2. Add a new code line by using Enter (not shift enter). 3. Click Run... If possible, include a link to a program on play.golang.org. What happened? The compiler don't detect the newline added by Enter, and the snippet compilation fails. E.g.: prog.go:10: syntax error: unexpected name, expecting semicolon or newline or } [process exited with non-zero status] Program exited. What should have happened instead? The newline should have been detected, and the program should have compiled. Please provide any additional information below. I tested to use Chrome Inspect elements, and I can see that using "shift+Enter" and "Enter", have slightly different effect on the edited HTML. Adding a line with Shift + Enter works, and the snippet runs. Adding a file with just Enter, creates a new "<pre>", element, and the snipet don't run (unless semicolons are manually adde to the end of the line).