aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-12-23 21:46:47 +0100
committerMichael Muré <batolettre@gmail.com>2018-12-23 21:46:47 +0100
commit94b28b68e57cf683731467b73b3ba777d1e4f86d (patch)
tree491a67e1d148fb661c0137b180d8251ea5ee3cc3 /bug
parent7454b9505ae2d680293d3d00d72df14f36f4e616 (diff)
downloadgit-bug-94b28b68e57cf683731467b73b3ba777d1e4f86d.tar.gz
termui: display an explicit placeholder for empty messages
Diffstat (limited to 'bug')
-rw-r--r--bug/timeline.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bug/timeline.go b/bug/timeline.go
index 2f879209..a84c45e4 100644
--- a/bug/timeline.go
+++ b/bug/timeline.go
@@ -1,6 +1,8 @@
package bug
import (
+ "strings"
+
"github.com/MichaelMure/git-bug/util/git"
)
@@ -67,3 +69,8 @@ func (c *CommentTimelineItem) Append(comment Comment) {
func (c *CommentTimelineItem) Edited() bool {
return len(c.History) > 1
}
+
+// MessageIsEmpty return true is the message is empty or only made of spaces
+func (c *CommentTimelineItem) MessageIsEmpty() bool {
+ return len(strings.TrimSpace(c.Message)) == 0
+}