qml: fix hang in ChatView by processing text explicitly (#2543)

Fixes #2519

Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
Co-authored-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
AT
2024-07-08 17:24:02 -04:00
committed by GitHub
parent 64359e68e6
commit c11e0f4a98
5 changed files with 26 additions and 27 deletions

View File

@@ -879,7 +879,6 @@ Rectangle {
Layout.fillWidth: true
TextArea {
id: myTextArea
text: value
Layout.fillWidth: true
padding: 0
color: {
@@ -953,7 +952,7 @@ Rectangle {
height: enabled ? implicitHeight : 0
onTriggered: {
textProcessor.shouldProcessText = !textProcessor.shouldProcessText;
myTextArea.text = value
textProcessor.setValue(value);
}
}
}
@@ -974,11 +973,16 @@ Rectangle {
textProcessor.codeColors.headerColor = theme.codeHeaderColor
textProcessor.codeColors.backgroundColor = theme.codeBackgroundColor
textProcessor.textDocument = textDocument
chatModel.forceUpdate(index); // called to trigger a reprocessing of the text
textProcessor.setValue(value);
}
Component.onCompleted: {
resetChatViewTextProcessor();
chatModel.valueChanged.connect(function(i, value) {
if (index === i)
textProcessor.setValue(value);
}
);
}
Connections {