Skip to content
Myr

Use 64-bit integer for preview version

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 a1f06ae · Browse files · 1 file+7 added−7 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+7 added−7 removed

  • other:+7 added−7 removed

1 file+7 added−7 removed

modified:src/terminal.go+7 added-7 removed
41 unmodified lines
42 jumpAcceptEnabled43)4445type previewer struct {46 version int46 version int6447 lines []string48 offset int49 enabled bool50 scrollable bool
1 unmodified line
52 spinner string53}5455type previewed struct {56 version int56 version int6457 numLines int58 offset int59 filled bool60}
222 unmodified lines
283 list []*Item284}285286type previewResult struct {287 version int287 version int64288 lines []string289 offset int290 spinner string291}
1459 unmodified lines
1751 }17521753 if t.hasPreviewer() {1754 go func() {1755 version := 01755 var version int641756 for {1757 var items []*Item1758 var commandTemplate string1759 var pwindow tui.Window
52 unmodified lines
1812 }1813 eofChan <- true1814 }()1815 // Goroutine 2 periodically requests rendering1816 go func(version int) {1816 go func(version int64) {1817 lines := []string{}1818 spinner := makeSpinner(t.unicode)1819 spinnerIndex := -1 // Delay initial rendering by an extra tick1820 ticker := time.NewTicker(previewChunkDelay)
33 unmodified lines
1854 reapChan <- true1855 }(version)1856 }1857 // Goroutine 3 is responsible for cancelling running preview command1858 go func(version int) {1858 go func(version int64) {1859 timer := time.NewTimer(previewDelayed)1860 Loop:1861 for {1862 select {
112 unmodified lines
1975 t.printPreview()1976 case reqPreviewRefresh:1977 t.printPreview()1978 case reqPreviewDelayed:1979 t.previewer.version = value.(int)1979 t.previewer.version = value.(int64)1980 t.printPreviewDelayed()1981 case reqPrintQuery:1982 exit(func() int {1983 t.printer(string(t.input))
539 unmodified lines