Fix panic if replaceBuffer() is called with message not in buffer. Fixes #32
This commit is contained in:
parent
9308f4cb47
commit
16406d6c91
@ -231,6 +231,12 @@ func (view *MessageView) replaceBuffer(original messages.UIMessage, new messages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if start == -1 {
|
||||||
|
debug.Print("Called replaceBuffer() with message that was not in the buffer:", original)
|
||||||
|
view.appendBuffer(new)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(view.textBuffer) > end {
|
if len(view.textBuffer) > end {
|
||||||
end++
|
end++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user