Skip to content
Myr

Fix SEGV when trying to render preview but the window is closed

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

Close #677

authored by Junegunn Choi · committed by Junegunn Choi · parent 3b5ae0f · Browse files · 2 files+9 added−3 removed
This commit

State

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

Diff stats

2 files+9 added−3 removed

  • other:+9 added−3 removed

2 files+9 added−3 removed

modified:src/terminal.go+4 added-3 removed
794 unmodified lines
795 return lines796}797798func (t *Terminal) printPreview() {799 if !t.isPreviewEnabled() {800 return801 }802 t.pwindow.Erase()803 skip := t.previewer.offset804 extractColor(t.previewer.text, nil, func(str string, ansi *ansiState) bool {805 if skip > 0 {
35 unmodified lines
841 t.printList()842 t.printPrompt()843 t.printInfo()844 t.printHeader()842 if t.isPreviewEnabled() {843 t.printPreview()845 t.printPreview()844 }846}847848func (t *Terminal) refresh() {849 if !t.suppress {
640 unmodified lines
modified:CHANGELOG.md+5 added
1CHANGELOG2=========340.15.35------6- Added support for more ANSI attributes: dim, underline, blink, and reverse7- Fixed race condition in `toggle-preview`890.15.210------11- Preview window is now scrollable12 - With mouse scroll or with bindable actions
457 unmodified lines