Skip to content
Myr

Redraw preview scrollbar when window width changes

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 3148b0f · Browse files · 1 file+5 added−2 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+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:src/terminal.go+5 added-2 removed
143 unmodified lines
144 final bool145 following resumableState146 spinner string147 bar []bool148 xw [2]int149}150151type previewed struct {152 version int64
704 unmodified lines
857 reqBox: util.NewEventBox(),858 initialPreviewOpts: opts.Preview,859 previewOpts: opts.Preview,860 activePreviewOpts: &opts.Preview,860 previewer: previewer{0, []string{}, 0, false, true, disabledState, "", []bool{}},861 previewer: previewer{0, []string{}, 0, false, true, disabledState, "", []bool{}, [2]int{0, 0}},862 previewed: previewed{0, 0, 0, false, false, false, false},863 previewBox: previewBox,864 eventBox: eventBox,865 mutex: sync.Mutex{},
1976 unmodified lines
28422843func (t *Terminal) renderPreviewScrollbar(yoff int, barLength int, barStart int) {2844 height := t.pwindow.Height()2845 w := t.pborder.Width()2846 xw := [2]int{t.pwindow.Left(), t.pwindow.Width()}2847 redraw := false2846 if len(t.previewer.bar) != height {2848 if len(t.previewer.bar) != height || t.previewer.xw != xw {2849 redraw = true2850 t.previewer.bar = make([]bool, height)2851 t.previewer.xw = xw2852 }2853 xshift := -1 - t.borderWidth2854 if !t.activePreviewOpts.border.HasRight() {2855 xshift = -1
2426 unmodified lines