@@ -223,7 +223,7 @@ func (self *LocalCommitsContext) RefForAdjustingLineNumberInDiff() string {
223
223
}
224
224
225
225
func (self * LocalCommitsContext ) ModelSearchResults (searchStr string , caseSensitive bool ) []gocui.SearchPosition {
226
- return searchModelCommits (caseSensitive , self .GetCommits (), self .ColumnPositions (), searchStr )
226
+ return searchModelCommits (caseSensitive , self .GetCommits (), self .ColumnPositions (), self . ModelIndexToViewIndex , searchStr )
227
227
}
228
228
229
229
func (self * LocalCommitsViewModel ) SetLimitCommits (value bool ) {
@@ -266,7 +266,9 @@ func shouldShowGraph(c *ContextCommon) bool {
266
266
return false
267
267
}
268
268
269
- func searchModelCommits (caseSensitive bool , commits []* models.Commit , columnPositions []int , searchStr string ) []gocui.SearchPosition {
269
+ func searchModelCommits (caseSensitive bool , commits []* models.Commit , columnPositions []int ,
270
+ modelToViewIndex func (int ) int , searchStr string ,
271
+ ) []gocui.SearchPosition {
270
272
if columnPositions == nil {
271
273
// This should never happen. We are being called at a time where our
272
274
// entire view content is scrolled out of view, so that we didn't draw
@@ -283,7 +285,7 @@ func searchModelCommits(caseSensitive bool, commits []*models.Commit, columnPosi
283
285
// searching for a commit hash that is longer than the truncated hash
284
286
// that we render. So we just set the XStart and XEnd values to the
285
287
// start and end of the commit hash column, which is the second one.
286
- result := gocui.SearchPosition {XStart : columnPositions [1 ], XEnd : columnPositions [2 ] - 1 , Y : idx }
288
+ result := gocui.SearchPosition {XStart : columnPositions [1 ], XEnd : columnPositions [2 ] - 1 , Y : modelToViewIndex ( idx ) }
287
289
return result , strings .Contains (normalize (commit .Hash ()), searchStr ) ||
288
290
strings .Contains (normalize (commit .Name ), searchStr ) ||
289
291
strings .Contains (normalize (commit .ExtraInfo ), searchStr ) // allow searching for tags
0 commit comments