Skip to content

Commit 2f2a89e

Browse files
authored
Merge pull request #57 from devchat-ai/feat/jcefbrower
Feat/jcefbrower
2 parents c5a0819 + 105c86e commit 2f2a89e

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

gui

src/main/kotlin/ai/devchat/idea/DevChatToolWindow.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ internal class DevChatToolWindowContent(project: Project) {
5454
// TODO: 'return' is not allowed here
5555
// return
5656
}
57-
val jbCefBrowser = JBCefBrowser()
57+
val jbCefBrowser = JBCefBrowserBuilder()
58+
.setOffScreenRendering(false)
59+
.build()
5860
content.add(jbCefBrowser.component, BorderLayout.CENTER)
5961

6062

@@ -138,10 +140,7 @@ internal class DevChatToolWindowContent(project: Project) {
138140
"--vscode-foreground:" + colorToCssRgb(foregroundColor) + ";" +
139141
"}" + "</style>"
140142
if (index != -1 && endIndex != -1) {
141-
html = """
142-
${html.substring(0, index + "<head>".length)}
143-
$styleTag${html.substring(endIndex)}
144-
""".trimIndent()
143+
html = html.substring(0, endIndex) + styleTag + html.substring(endIndex)
145144
}
146145
return html
147146
}

0 commit comments

Comments
 (0)