mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Remove obsolete filtering from setComment
This reverts the change that we made in 3b85307f67
, it is no longer needed
now.
This commit is contained in:
parent
0cc6e39f0f
commit
4845ce1e0f
1 changed files with 1 additions and 8 deletions
|
@ -77,20 +77,13 @@ func prepareMarshalledConfig(buffer bytes.Buffer) []byte {
|
|||
}
|
||||
|
||||
func setComment(yamlNode *yaml.Node, description string) {
|
||||
// Filter out lines containing "[dev]"; this allows us to add developer
|
||||
// documentation to properties that don't get included in the docs
|
||||
lines := strings.Split(description, "\n")
|
||||
lines = lo.Filter(lines, func(s string, _ int) bool {
|
||||
return !strings.Contains(s, "[dev]")
|
||||
})
|
||||
|
||||
// Workaround for the way yaml formats the HeadComment if it contains
|
||||
// blank lines: it renders these without a leading "#", but we want a
|
||||
// leading "#" even on blank lines. However, yaml respects it if the
|
||||
// HeadComment already contains a leading "#", so we prefix all lines
|
||||
// (including blank ones) with "#".
|
||||
yamlNode.HeadComment = strings.Join(
|
||||
lo.Map(lines, func(s string, _ int) string {
|
||||
lo.Map(strings.Split(description, "\n"), func(s string, _ int) string {
|
||||
if s == "" {
|
||||
return "#" // avoid trailing space on blank lines
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue