(diffView *DiffView, action Action)
| 887 | } |
| 888 | |
| 889 | func selectDiffLine(diffView *DiffView, action Action) (err error) { |
| 890 | diffLines, ok := diffView.diffs[diffView.activeDiff] |
| 891 | if !ok { |
| 892 | return |
| 893 | } |
| 894 | |
| 895 | lineIndex := diffView.activeViewPos.ActiveRowIndex() |
| 896 | if lineIndex >= diffView.rows() { |
| 897 | return |
| 898 | } |
| 899 | |
| 900 | diffLine := diffLines.lines[lineIndex] |
| 901 | |
| 902 | if diffLine.lineType != dltDiffStatsFile { |
| 903 | return |
| 904 | } |
| 905 | |
| 906 | filePart, _, err := diffView.splitDiffStatsFileLine(diffLine.line) |
| 907 | if err != nil { |
| 908 | return |
| 909 | } |
| 910 | |
| 911 | filePart = strings.TrimRight(filePart, " ") |
| 912 | |
| 913 | for lineIndex++; lineIndex < uint(len(diffLines.lines)); lineIndex++ { |
| 914 | diffLine = diffLines.lines[lineIndex] |
| 915 | |
| 916 | if diffLine.lineType == dltGitDiffHeaderDiff && strings.Contains(diffLine.line, filePart) { |
| 917 | break |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | if lineIndex >= uint(len(diffLines.lines)) { |
| 922 | return fmt.Errorf("Unable to find diff for file: %v", filePart) |
| 923 | } |
| 924 | |
| 925 | diffView.activeViewPos.SetActiveRowIndex(lineIndex) |
| 926 | diffView.setVariables() |
| 927 | defer diffView.channels.UpdateDisplay() |
| 928 | |
| 929 | _, err = diffView.AbstractWindowView.HandleAction(Action{ActionType: ActionCenterView}) |
| 930 | return |
| 931 | } |
nothing calls this directly
no test coverage detected