Fix SEGV when trying to render preview but the window is closed
Close #677
This commit is contained in:
parent
3b5ae0f8a2
commit
957c12e7d7
@ -1,6 +1,11 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
0.15.3
|
||||
------
|
||||
- Added support for more ANSI attributes: dim, underline, blink, and reverse
|
||||
- Fixed race condition in `toggle-preview`
|
||||
|
||||
0.15.2
|
||||
------
|
||||
- Preview window is now scrollable
|
||||
|
@ -796,6 +796,9 @@ func numLinesMax(str string, max int) int {
|
||||
}
|
||||
|
||||
func (t *Terminal) printPreview() {
|
||||
if !t.isPreviewEnabled() {
|
||||
return
|
||||
}
|
||||
t.pwindow.Erase()
|
||||
skip := t.previewer.offset
|
||||
extractColor(t.previewer.text, nil, func(str string, ansi *ansiState) bool {
|
||||
@ -839,9 +842,7 @@ func (t *Terminal) printAll() {
|
||||
t.printPrompt()
|
||||
t.printInfo()
|
||||
t.printHeader()
|
||||
if t.isPreviewEnabled() {
|
||||
t.printPreview()
|
||||
}
|
||||
t.printPreview()
|
||||
}
|
||||
|
||||
func (t *Terminal) refresh() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user