aboutsummaryrefslogtreecommitdiffstats
path: root/input/input.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-08 21:25:06 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-08 21:25:06 +0200
commitad9e35e302fe62556414f20ba04933d9c4597681 (patch)
treecb86b108693b7ea60bfdd37bbe549e9d2f25c13a /input/input.go
parent1017f8c6cbfc4d567bd48c9ed28bd53a0f337eea (diff)
downloadgit-bug-ad9e35e302fe62556414f20ba04933d9c4597681.tar.gz
termui: add the previous title in the template when editing
Diffstat (limited to 'input/input.go')
-rw-r--r--input/input.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/input/input.go b/input/input.go
index 530106e2..2986fae5 100644
--- a/input/input.go
+++ b/input/input.go
@@ -102,14 +102,15 @@ func BugCommentEditorInput(repo repository.Repo) (string, error) {
return message, nil
}
-const bugTitleTemplate = `
+const bugTitleTemplate = `%s
# Please enter the new title. Only one line will used.
# Lines starting with '#' will be ignored, and an empty title aborts the operation.
`
-func BugTitleEditorInput(repo repository.Repo) (string, error) {
- raw, err := LaunchEditorWithTemplate(repo, messageFilename, bugTitleTemplate)
+func BugTitleEditorInput(repo repository.Repo, preTitle string) (string, error) {
+ template := fmt.Sprintf(bugTitleTemplate, preTitle)
+ raw, err := LaunchEditorWithTemplate(repo, messageFilename, template)
if err != nil {
return "", err