From a6001dc76e3746a6f9c54b00124a5a8116afef3b Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 4 Jul 2025 19:40:43 +0200 Subject: [PATCH] Cleanup: rename a badly named function We used the term "change line" to mean "a line that was added or deleted", but it sounded like a verb in the function name. --- pkg/gui/controllers/patch_building_controller.go | 2 +- pkg/gui/patch_exploring/state.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/patch_building_controller.go b/pkg/gui/controllers/patch_building_controller.go index faddbd5f8..173ee979a 100644 --- a/pkg/gui/controllers/patch_building_controller.go +++ b/pkg/gui/controllers/patch_building_controller.go @@ -134,7 +134,7 @@ func (self *PatchBuildingController) toggleSelection() error { state := self.context().GetState() // Get added/deleted lines in the selected patch range - lineIndicesToToggle := state.ChangeLinesInSelectedPatchRange() + lineIndicesToToggle := state.LineIndicesOfAddedOrDeletedLinesInSelectedPatchRange() if len(lineIndicesToToggle) == 0 { // Only context lines or header lines selected, so nothing to do return nil diff --git a/pkg/gui/patch_exploring/state.go b/pkg/gui/patch_exploring/state.go index acf2b0ef2..416f398f5 100644 --- a/pkg/gui/patch_exploring/state.go +++ b/pkg/gui/patch_exploring/state.go @@ -335,7 +335,7 @@ func (s *State) SelectedPatchRange() (int, int) { } // Returns the line indices of the selected patch range that are changes (i.e. additions or deletions) -func (s *State) ChangeLinesInSelectedPatchRange() []int { +func (s *State) LineIndicesOfAddedOrDeletedLinesInSelectedPatchRange() []int { viewStart, viewEnd := s.SelectedViewRange() patchStart, patchEnd := s.patchLineIndices[viewStart], s.patchLineIndices[viewEnd] lines := s.patch.Lines()