mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
Use 64-bit integer for preview version
This commit is contained in:
parent
a1f06ae27f
commit
03c4f04246
@ -43,7 +43,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type previewer struct {
|
type previewer struct {
|
||||||
version int
|
version int64
|
||||||
lines []string
|
lines []string
|
||||||
offset int
|
offset int
|
||||||
enabled bool
|
enabled bool
|
||||||
@ -53,7 +53,7 @@ type previewer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type previewed struct {
|
type previewed struct {
|
||||||
version int
|
version int64
|
||||||
numLines int
|
numLines int
|
||||||
offset int
|
offset int
|
||||||
filled bool
|
filled bool
|
||||||
@ -284,7 +284,7 @@ type previewRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type previewResult struct {
|
type previewResult struct {
|
||||||
version int
|
version int64
|
||||||
lines []string
|
lines []string
|
||||||
offset int
|
offset int
|
||||||
spinner string
|
spinner string
|
||||||
@ -1752,7 +1752,7 @@ func (t *Terminal) Loop() {
|
|||||||
|
|
||||||
if t.hasPreviewer() {
|
if t.hasPreviewer() {
|
||||||
go func() {
|
go func() {
|
||||||
version := 0
|
var version int64
|
||||||
for {
|
for {
|
||||||
var items []*Item
|
var items []*Item
|
||||||
var commandTemplate string
|
var commandTemplate string
|
||||||
@ -1813,7 +1813,7 @@ func (t *Terminal) Loop() {
|
|||||||
eofChan <- true
|
eofChan <- true
|
||||||
}()
|
}()
|
||||||
// Goroutine 2 periodically requests rendering
|
// Goroutine 2 periodically requests rendering
|
||||||
go func(version int) {
|
go func(version int64) {
|
||||||
lines := []string{}
|
lines := []string{}
|
||||||
spinner := makeSpinner(t.unicode)
|
spinner := makeSpinner(t.unicode)
|
||||||
spinnerIndex := -1 // Delay initial rendering by an extra tick
|
spinnerIndex := -1 // Delay initial rendering by an extra tick
|
||||||
@ -1855,7 +1855,7 @@ func (t *Terminal) Loop() {
|
|||||||
}(version)
|
}(version)
|
||||||
}
|
}
|
||||||
// Goroutine 3 is responsible for cancelling running preview command
|
// Goroutine 3 is responsible for cancelling running preview command
|
||||||
go func(version int) {
|
go func(version int64) {
|
||||||
timer := time.NewTimer(previewDelayed)
|
timer := time.NewTimer(previewDelayed)
|
||||||
Loop:
|
Loop:
|
||||||
for {
|
for {
|
||||||
@ -1976,7 +1976,7 @@ func (t *Terminal) Loop() {
|
|||||||
case reqPreviewRefresh:
|
case reqPreviewRefresh:
|
||||||
t.printPreview()
|
t.printPreview()
|
||||||
case reqPreviewDelayed:
|
case reqPreviewDelayed:
|
||||||
t.previewer.version = value.(int)
|
t.previewer.version = value.(int64)
|
||||||
t.printPreviewDelayed()
|
t.printPreviewDelayed()
|
||||||
case reqPrintQuery:
|
case reqPrintQuery:
|
||||||
exit(func() int {
|
exit(func() int {
|
||||||
|
Loading…
Reference in New Issue
Block a user