Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Removed extra empty line in render for Multiline (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Pecos Martinez authored and AlecAivazis committed Jan 25, 2019
1 parent 49e2fbe commit 3389f2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion multiline.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ var MultilineQuestionTemplate = `
{{- color "green+hb"}}{{ QuestionIcon }} {{color "reset"}}
{{- color "default+hb"}}{{ .Message }} {{color "reset"}}
{{- if .ShowAnswer}}
{{- "\n"}}{{color "cyan"}}{{.Answer}}{{color "reset"}}{{"\n"}}
{{- "\n"}}{{color "cyan"}}{{.Answer}}{{color "reset"}}
{{- if .Answer }}{{ "\n" }}{{ end }}
{{- else }}
{{- if .Default}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}}
{{- color "cyan"}}[Enter 2 empty lines to finish]{{color "reset"}}
Expand Down
2 changes: 1 addition & 1 deletion multiline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestMultilineRender(t *testing.T) {
"Test Multiline answer output",
Multiline{Message: "What is your favorite month:"},
MultilineTemplateData{Answer: "October", ShowAnswer: true},
fmt.Sprintf("%s What is your favorite month: \nOctober\n", core.QuestionIcon),
fmt.Sprintf("%s What is your favorite month: \nOctober", core.QuestionIcon),
},
{
"Test Multiline question output without default but with help hidden",
Expand Down

0 comments on commit 3389f2f

Please sign in to comment.