MCPcopy
hub / github.com/rgburke/grv / splitDiffStatsFileLine

Method splitDiffStatsFileLine

cmd/grv/diff_view.go:875–887  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

873}
874
875func (diffView *DiffView) splitDiffStatsFileLine(line string) (filePart, changePart string, err error) {
876 sepIndex := strings.LastIndex(line, "|")
877
878 if sepIndex == -1 || sepIndex >= len(line)-1 {
879 err = fmt.Errorf("Unable to determine file path from line: %v", line)
880 return
881 }
882
883 filePart = line[0:sepIndex]
884 changePart = line[sepIndex+1:]
885
886 return
887}
888
889func selectDiffLine(diffView *DiffView, action Action) (err error) {
890 diffLines, ok := diffView.diffs[diffView.activeDiff]

Callers 3

setVariablesMethod · 0.95
selectDiffLineFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected