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

Function formatView

pkg/commands/patch/format.go:48–59  ·  view source on GitHub ↗

formats the patch for rendering within a view, meaning it's coloured and highlights selected items

(patch *Patch, opts FormatViewOpts)

Source from the content-addressed store, hash-verified

46// formats the patch for rendering within a view, meaning it's coloured and
47// highlights selected items
48func formatView(patch *Patch, opts FormatViewOpts) string {
49 includedLineIndices := opts.IncLineIndices
50 if includedLineIndices == nil {
51 includedLineIndices = set.New[int]()
52 }
53 presenter := &patchPresenter{
54 patch: patch,
55 plain: false,
56 incLineIndices: includedLineIndices,
57 }
58 return presenter.format()
59}
60
61func (self *patchPresenter) format() string {
62 // if we have no changes in our patch (i.e. no additions or deletions) then

Callers 1

FormatViewMethod · 0.85

Calls 1

formatMethod · 0.95

Tested by

no test coverage detected