mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-16 23:33:39 -05:00
@@ -1060,11 +1060,11 @@ func (t *Terminal) UpdateProgress(progress float32) {
|
|||||||
// UpdateList updates Merger to display the list
|
// UpdateList updates Merger to display the list
|
||||||
func (t *Terminal) UpdateList(merger *Merger) {
|
func (t *Terminal) UpdateList(merger *Merger) {
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
var prevIndex int32 = -1
|
prevIndex := minItem.Index()
|
||||||
reset := t.revision != merger.Revision()
|
reset := t.revision != merger.Revision()
|
||||||
if !reset && t.track != trackDisabled {
|
if !reset && t.track != trackDisabled {
|
||||||
if t.merger.Length() > 0 {
|
if t.merger.Length() > 0 {
|
||||||
prevIndex = t.merger.Get(t.cy).item.Index()
|
prevIndex = t.currentIndex()
|
||||||
} else if merger.Length() > 0 {
|
} else if merger.Length() > 0 {
|
||||||
prevIndex = merger.First().item.Index()
|
prevIndex = merger.First().item.Index()
|
||||||
}
|
}
|
||||||
@@ -4121,7 +4121,7 @@ func (t *Terminal) constrain() {
|
|||||||
// count of lines can be displayed
|
// count of lines can be displayed
|
||||||
height := t.maxItems()
|
height := t.maxItems()
|
||||||
|
|
||||||
t.cy = util.Constrain(t.cy, 0, count-1)
|
t.cy = util.Constrain(t.cy, 0, util.Max(0, count-1))
|
||||||
|
|
||||||
minOffset := util.Max(t.cy-height+1, 0)
|
minOffset := util.Max(t.cy-height+1, 0)
|
||||||
maxOffset := util.Max(util.Min(count-height, t.cy), 0)
|
maxOffset := util.Max(util.Min(count-height, t.cy), 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user