1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-23 00:39:13 +02:00

Bump git-todo-parser

This commit is contained in:
Gustavo Krieger
2023-07-02 00:52:25 -03:00
parent cff9850374
commit 87fe30d50d
8 changed files with 19 additions and 21 deletions

View File

@ -5,9 +5,9 @@ import (
"strings"
)
func Write(f io.Writer, todos []Todo) error {
func Write(f io.Writer, todos []Todo, commentChar byte) error {
for _, todo := range todos {
if err := writeTodo(f, todo); err != nil {
if err := writeTodo(f, todo, commentChar); err != nil {
return err
}
}
@ -15,7 +15,7 @@ func Write(f io.Writer, todos []Todo) error {
return nil
}
func writeTodo(f io.Writer, todo Todo) error {
func writeTodo(f io.Writer, todo Todo, commentChar byte) error {
var sb strings.Builder
if todo.Command != Comment {
sb.WriteString(todo.Command.String())
@ -26,7 +26,7 @@ func writeTodo(f io.Writer, todo Todo) error {
return nil
case Comment:
sb.WriteString(CommentChar)
sb.WriteByte(commentChar)
sb.WriteString(todo.Comment)
case Break: