Skip to content
Myr

Fix selection changed on terminal resize (#2306)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by E.L.K · committed by GitHub · parent 82791f7 · Browse files · 1 file+6 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−8 removed

  • other:+6 added−8 removed

1 file+6 added−8 removed

modified:src/terminal.go+6 added-8 removed
2630 unmodified lines
2631 }2632}26332634func (t *Terminal) constrain() {2635 // count of items to display allowed by filtering2636 count := t.merger.Length()2637 // count of lines can be displayed2638 height := t.maxItems()2637 diffpos := t.cy - t.offset26392640 t.cy = util.Constrain(t.cy, 0, count-1)2640 t.offset = util.Constrain(t.offset, t.cy-height+1, t.cy)2641 // Adjustment2642 if count-t.offset < height {2643 t.offset = util.Max(0, count-height)2644 t.cy = util.Constrain(t.offset+diffpos, 0, count-1)2645 }2646 t.offset = util.Max(0, t.offset)26412642 minOffset := t.cy - height + 12643 maxOffset := util.Max(util.Min(count-height, t.cy), 0)2644 t.offset = util.Constrain(t.offset, minOffset, maxOffset)2645}26462647func (t *Terminal) vmove(o int, allowCycle bool) {2648 if t.layout != layoutDefault {
30 unmodified lines