mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Fall back to WithWaitingStatus if item is scrolled out of view
This commit is contained in:
parent
0fd4983c66
commit
f99c59b6d5
6 changed files with 39 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue