diff --git a/pkg/gui/controllers/list_controller.go b/pkg/gui/controllers/list_controller.go index 27c3f402e..a91074392 100644 --- a/pkg/gui/controllers/list_controller.go +++ b/pkg/gui/controllers/list_controller.go @@ -117,6 +117,11 @@ func (self *ListController) handleLineChangeAux(f func(int), change int) error { if cursorMoved || rangeBefore != rangeAfter { self.context.HandleFocus(types.OnFocusOpts{ScrollSelectionIntoView: true}) + } else { + // If the selection did not change (because, for example, we are at the top of the list and + // press up), we still want to ensure that the selection is visible. This is useful after + // scrolling the selection out of view with the mouse. + self.context.FocusLine(true) } return nil