mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-15 23:38:41 +00:00
Add code blocks and python syntax highlighting.
This commit is contained in:
@@ -378,6 +378,12 @@ Window {
|
||||
text: qsTr("Conversation copied to clipboard.")
|
||||
}
|
||||
|
||||
PopupDialog {
|
||||
id: copyCodeMessage
|
||||
anchors.centerIn: parent
|
||||
text: qsTr("Code copied to clipboard.")
|
||||
}
|
||||
|
||||
PopupDialog {
|
||||
id: healthCheckFailed
|
||||
anchors.centerIn: parent
|
||||
@@ -607,6 +613,10 @@ Window {
|
||||
var integer = parseInt(link.split("://")[1]);
|
||||
referenceContextDialog.text = referencesContext[integer - 1];
|
||||
referenceContextDialog.open();
|
||||
} else {
|
||||
var success = responseText.tryCopyAtPosition(clickedPos);
|
||||
if (success)
|
||||
copyCodeMessage.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -618,6 +628,7 @@ Window {
|
||||
Component.onCompleted: {
|
||||
responseText.textDocument = textDocument
|
||||
responseText.setLinkColor(theme.linkColor);
|
||||
responseText.setHeaderColor(theme.backgroundLight);
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.Paragraph
|
||||
|
Reference in New Issue
Block a user