mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-07-10 01:39:13 +00:00
fix: normalize line separators when initializing prompt editors
Settings -> ProxyAI -> Prompts could appear to hang ("loading" forever) on
Windows when the plugin was built locally. Source .txt prompts checked out
with autocrlf=true ended up CRLF inside the JAR, and AbstractEditorPromptPanel
fed those CRLF strings straight into createDocument. IntelliJ then queued a
background write action per editor to normalize the document, but those WAs
sat blocked behind the modal Settings dialog's WriteIntentReadAction, each
hitting the 10-second BG-WA timeout.
Fix it at both ends:
- Wrap details.instructions with StringUtil.convertLineSeparators before
passing to createDocument, mirroring updateEditorText. This also protects
against pre-existing CRLF that may already live in persisted
CodeGPT_PromptsSettings.xml from older installs.
- Add a .gitattributes rule forcing src/main/resources/prompts/**/*.txt to
eol=lf so the same condition cannot reappear on future Windows builds.
This commit is contained in:
parent
1c7a8569fe
commit
36defa0039
2 changed files with 2 additions and 1 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +1,2 @@
|
|||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
src/main/resources/prompts/**/*.txt text eol=lf
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ abstract class AbstractEditorPromptPanel(
|
|||
private fun createEditor(): Editor {
|
||||
return service<EditorFactory>()
|
||||
.run {
|
||||
createEditor(createDocument(details.instructions ?: ""))
|
||||
createEditor(createDocument(StringUtil.convertLineSeparators(details.instructions ?: "")))
|
||||
}
|
||||
.apply {
|
||||
settings.additionalLinesCount = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue