Skip to content
Myr

Avoid unnecessary redraw of preview window

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

Close #1455

authored by Junegunn Choi · committed by Junegunn Choi · parent 61feee6 · Browse files · 1 file+8 added−4 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+8 added−4 removed

  • other:+8 added−4 removed

1 file+8 added−4 removed

modified:src/terminal.go+8 added-4 removed
1530 unmodified lines
1531 t.killPreview(code)1532 }15331534 go func() {1535 var focused *Item1535 var focusedIndex int32 = minItem.Index()1536 var version int64 = -11537 for {1538 t.reqBox.Wait(func(events *util.Events) {1539 defer events.Clear()
8 unmodified lines
1548 case reqInfo:1549 t.printInfo()1550 case reqList:1551 t.printList()1552 currentFocus := t.currentItem()1553 if currentFocus != focused || version != t.version {1552 var currentIndex int32 = minItem.Index()1553 currentItem := t.currentItem()1554 if currentItem != nil {1555 currentIndex = currentItem.Index()1556 }1557 if focusedIndex != currentIndex || version != t.version {1558 version = t.version1555 focused = currentFocus1559 focusedIndex = currentIndex1560 if t.isPreviewEnabled() {1561 _, list := t.buildPlusList(t.preview.command, false)1562 t.cancelPreview()1563 t.previewBox.Set(reqPreviewEnqueue, list)
477 unmodified lines