mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Fall back to WithWaitingStatus if item is scrolled out of view
This commit is contained in:
@ -97,3 +97,16 @@ func (self *ListContextTrait) OnSearchSelect(selectedLineIdx int) error {
|
||||
self.GetList().SetSelectedLineIdx(selectedLineIdx)
|
||||
return self.HandleFocus(types.OnFocusOpts{})
|
||||
}
|
||||
|
||||
func (self *ListContextTrait) IsItemVisible(item types.HasUrn) bool {
|
||||
startIdx, length := self.GetViewTrait().ViewPortYBounds()
|
||||
selectionStart := self.ViewIndexToModelIndex(startIdx)
|
||||
selectionEnd := self.ViewIndexToModelIndex(startIdx + length)
|
||||
for i := selectionStart; i < selectionEnd; i++ {
|
||||
iterItem := self.GetList().GetItem(i)
|
||||
if iterItem != nil && iterItem.URN() == item.URN() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user