File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ func (diffView *DiffView) renderEmptyView(win RenderWindow) (err error) {
259
259
return
260
260
}
261
261
262
- // RenderHelpBar does nothing
262
+ // RenderHelpBar renders help information for the diff view
263
263
func (diffView * DiffView ) RenderHelpBar (lineBuilder * LineBuilder ) (err error ) {
264
264
diffView .lock .Lock ()
265
265
defer diffView .lock .Unlock ()
@@ -274,12 +274,15 @@ func (diffView *DiffView) RenderHelpBar(lineBuilder *LineBuilder) (err error) {
274
274
}
275
275
276
276
lineIndex := diffView .viewPos .ActiveRowIndex ()
277
- line := diffLines .lines [lineIndex ]
278
277
279
- if line .lineType == dltDiffStatsFile {
280
- RenderKeyBindingHelp (diffView .ViewID (), lineBuilder , []ActionMessage {
281
- {action : ActionSelect , message : "Jump to file diff" },
282
- })
278
+ if lineIndex < uint (len (diffLines .lines )) {
279
+ line := diffLines .lines [lineIndex ]
280
+
281
+ if line .lineType == dltDiffStatsFile {
282
+ RenderKeyBindingHelp (diffView .ViewID (), lineBuilder , []ActionMessage {
283
+ {action : ActionSelect , message : "Jump to file diff" },
284
+ })
285
+ }
283
286
}
284
287
285
288
return
You can’t perform that action at this time.
0 commit comments