mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-11 21:39:11 +00:00
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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user