MCPcopy
hub / github.com/jesseduffield/lazygit / formatLineAux

Method formatLineAux

pkg/commands/patch/format.go:131–146  ·  view source on GitHub ↗

'selected' means you've got it highlighted with your cursor 'included' means the line has been included in the patch (only applicable when building a patch)

(str string, textStyle style.TextStyle, included bool)

Source from the content-addressed store, hash-verified

129// 'included' means the line has been included in the patch (only applicable when
130// building a patch)
131func (self *patchPresenter) formatLineAux(str string, textStyle style.TextStyle, included bool) string {
132 if self.plain {
133 return str
134 }
135
136 firstCharStyle := textStyle
137 if included {
138 firstCharStyle = firstCharStyle.MergeStyle(style.BgGreen)
139 }
140
141 if len(str) < 2 {
142 return firstCharStyle.Sprint(str)
143 }
144
145 return firstCharStyle.Sprint(str[:1]) + textStyle.Sprint(str[1:])
146}

Callers 2

formatMethod · 0.95
formatLineMethod · 0.95

Calls 2

MergeStyleMethod · 0.80
SprintMethod · 0.65

Tested by

no test coverage detected