]> git.lizzy.rs Git - micro.git/blobdiff - internal/buffer/message.go
fix eofnewline not running on files with 1 rune (#1535)
[micro.git] / internal / buffer / message.go
index 065d96668e3adbb9b18362da76afaa01b784131c..ad7e6560f9c96b5e6cd8f2d915d2c3ad606ef658 100644 (file)
@@ -13,13 +13,19 @@ const (
        MTError
 )
 
+// Message represents the information for a gutter message
 type Message struct {
-       Msg        string
+       // The Msg iteslf
+       Msg string
+       // Start and End locations for the message
        Start, End Loc
-       Kind       MsgType
-       Owner      string
+       // The Kind stores the message type
+       Kind MsgType
+       // The Owner of the message
+       Owner string
 }
 
+// NewMessage creates a new gutter message
 func NewMessage(owner string, msg string, start, end Loc, kind MsgType) *Message {
        return &Message{
                Msg:   msg,
@@ -30,6 +36,7 @@ func NewMessage(owner string, msg string, start, end Loc, kind MsgType) *Message
        }
 }
 
+// NewMessageAtLine creates a new gutter message at a given line
 func NewMessageAtLine(owner string, msg string, line int, kind MsgType) *Message {
        start := Loc{-1, line - 1}
        end := start