Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Send text directly into the text document from the chat view rather than using a signal to post process the text. This is still not ideal in that we want to move to preprocessing the text in the future and to do so by streaming the content in rather than replacing it all at the same time, but it does fix a hang that we experience with an infinite recursive loop of text changed signals in the markdown processing.
This fixes issue #2519.
Summary:
Fixes issue #2519 by sending text directly to the text document in the chat view, avoiding infinite recursive loops during markdown processing.
Key points:
forceUpdate
method fromgpt4all-chat/chatmodel.h
.valueChanged
signal inChatModel
class ingpt4all-chat/chatmodel.h
.updateValue
method inChatModel
to emitvalueChanged
signal.m_textDocument
withm_quickTextDocument
inChatViewTextProcessor
class ingpt4all-chat/chatviewtextprocessor.cpp
andgpt4all-chat/chatviewtextprocessor.h
.setValue
method toChatViewTextProcessor
class to set plain text directly.gpt4all-chat/qml/ChatView.qml
to usetextProcessor.setValue(value)
instead ofchatModel.forceUpdate(index)
.Generated with ❤️ by ellipsis.dev