mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03: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:
@ -77,20 +77,13 @@ func prepareMarshalledConfig(buffer bytes.Buffer) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setComment(yamlNode *yaml.Node, description string) {
|
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
|
// Workaround for the way yaml formats the HeadComment if it contains
|
||||||
// blank lines: it renders these without a leading "#", but we want a
|
// blank lines: it renders these without a leading "#", but we want a
|
||||||
// leading "#" even on blank lines. However, yaml respects it if the
|
// leading "#" even on blank lines. However, yaml respects it if the
|
||||||
// HeadComment already contains a leading "#", so we prefix all lines
|
// HeadComment already contains a leading "#", so we prefix all lines
|
||||||
// (including blank ones) with "#".
|
// (including blank ones) with "#".
|
||||||
yamlNode.HeadComment = strings.Join(
|
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 == "" {
|
if s == "" {
|
||||||
return "#" // avoid trailing space on blank lines
|
return "#" // avoid trailing space on blank lines
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user