Skip to content

Commit 28e2317

Browse files
committed
Revert "Fix #1874 (maybe)"
This reverts commit 1a66cdb
1 parent cb5fd49 commit 28e2317

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/nl/hannahsten/texifyidea/inspections/latex/probablebugs/LatexUnicodeInspection.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.intellij.codeInspection.ProblemDescriptor
77
import com.intellij.codeInspection.ProblemHighlightType
88
import com.intellij.openapi.fileEditor.FileEditorManager
99
import com.intellij.openapi.project.Project
10-
import com.intellij.openapi.util.SystemInfo
1110
import com.intellij.openapi.util.TextRange
1211
import com.intellij.psi.PsiDocumentManager
1312
import com.intellij.psi.PsiFile
@@ -68,12 +67,7 @@ class LatexUnicodeInspection : TexifyInspectionBase() {
6867
internal fun unicodeEnabled(file: PsiFile): Boolean {
6968
// TeX Live 2018 is UTF-8 by default and loads inputenc automatically
7069
val compilerCompat = file.project.selectedRunConfig()?.compiler ?: return false
71-
if (compilerCompat == LatexCompiler.LUALATEX ||
72-
compilerCompat == LatexCompiler.XELATEX ||
73-
TexliveSdk.version >= 2018 ||
74-
// On Mac we cannot find the TeX Live version
75-
SystemInfo.isMac
76-
) {
70+
if (compilerCompat == LatexCompiler.LUALATEX || compilerCompat == LatexCompiler.XELATEX || TexliveSdk.version >= 2018) {
7771
return true
7872
}
7973

src/nl/hannahsten/texifyidea/util/SystemEnvironment.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package nl.hannahsten.texifyidea.util
22

3-
import com.intellij.execution.configurations.GeneralCommandLine
43
import java.io.File
54
import java.io.IOException
65
import java.util.concurrent.TimeUnit
@@ -40,10 +39,12 @@ class SystemEnvironment {
4039
*/
4140
fun runCommand(vararg commands: String, workingDirectory: File? = null): String? {
4241
return try {
43-
val proc = GeneralCommandLine(*commands)
44-
.withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
45-
.withWorkDirectory(workingDirectory)
46-
.createProcess()
42+
val command = arrayListOf(*commands)
43+
val proc = ProcessBuilder(command)
44+
.redirectOutput(ProcessBuilder.Redirect.PIPE)
45+
.redirectError(ProcessBuilder.Redirect.PIPE)
46+
.directory(workingDirectory)
47+
.start()
4748

4849
if (proc.waitFor(3, TimeUnit.SECONDS)) {
4950
proc.inputStream.bufferedReader().readText().trim() + proc.errorStream.bufferedReader().readText().trim()

0 commit comments

Comments
 (0)