mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-09 11:01:22 +00:00
fix: wrong line separators on windows (fixes #605)
This commit is contained in:
parent
2b9eaea9d4
commit
274dd37ae3
1 changed files with 6 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager
|
|||
import com.intellij.openapi.fileEditor.TextEditor
|
||||
import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager
|
||||
import com.intellij.testFramework.LightVirtualFile
|
||||
|
|
@ -144,7 +145,11 @@ object EditorUtil {
|
|||
editor.project?.let { project ->
|
||||
runUndoTransparentWriteAction {
|
||||
val document = editor.document
|
||||
document.replaceString(startOffset, endOffset, newText)
|
||||
document.replaceString(
|
||||
startOffset,
|
||||
endOffset,
|
||||
StringUtil.convertLineSeparators(newText)
|
||||
)
|
||||
|
||||
if (ConfigurationSettings.getCurrentState().isAutoFormattingEnabled) {
|
||||
reformatDocument(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue