aboutsummaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-10-04 21:47:01 +0200
committerGitHub <noreply@github.com>2018-10-04 21:47:01 +0200
commit43db2c77348016d9bc05c713765b2b58534c7c39 (patch)
tree3a80c4fe5599acb47dae61f61bd8f2ce0a80fa0a /input
parentf464363213ce7315d1f3ea10138450a4ca7432d3 (diff)
parent97afd6b68a0f358a0c8b88c9e22cd7c57080a3ad (diff)
downloadgit-bug-43db2c77348016d9bc05c713765b2b58534c7c39.tar.gz
Merge pull request #60 from adamslc/commentedit
termui: add the ability to edit comments
Diffstat (limited to 'input')
-rw-r--r--input/input.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/input/input.go b/input/input.go
index 6a7c8c7c..07148acc 100644
--- a/input/input.go
+++ b/input/input.go
@@ -78,7 +78,7 @@ func BugCreateEditorInput(repo repository.RepoCommon, preTitle string, preMessag
return title, message, nil
}
-const bugCommentTemplate = `
+const bugCommentTemplate = `%s
# Please enter the comment message. Lines starting with '#' will be ignored,
# and an empty message aborts the operation.
@@ -86,8 +86,9 @@ const bugCommentTemplate = `
// BugCommentEditorInput will open the default editor in the terminal with a
// template for the user to fill. The file is then processed to extract a comment.
-func BugCommentEditorInput(repo repository.RepoCommon) (string, error) {
- raw, err := launchEditorWithTemplate(repo, messageFilename, bugCommentTemplate)
+func BugCommentEditorInput(repo repository.RepoCommon, preMessage string) (string, error) {
+ template := fmt.Sprintf(bugCommentTemplate, preMessage)
+ raw, err := launchEditorWithTemplate(repo, messageFilename, template)
if err != nil {
return "", err