File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
src/nl/hannahsten/texifyidea
inspections/latex/probablebugs Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import com.intellij.codeInspection.ProblemDescriptor
7
7
import com.intellij.codeInspection.ProblemHighlightType
8
8
import com.intellij.openapi.fileEditor.FileEditorManager
9
9
import com.intellij.openapi.project.Project
10
- import com.intellij.openapi.util.SystemInfo
11
10
import com.intellij.openapi.util.TextRange
12
11
import com.intellij.psi.PsiDocumentManager
13
12
import com.intellij.psi.PsiFile
@@ -68,12 +67,7 @@ class LatexUnicodeInspection : TexifyInspectionBase() {
68
67
internal fun unicodeEnabled (file : PsiFile ): Boolean {
69
68
// TeX Live 2018 is UTF-8 by default and loads inputenc automatically
70
69
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 ) {
77
71
return true
78
72
}
79
73
Original file line number Diff line number Diff line change 1
1
package nl.hannahsten.texifyidea.util
2
2
3
- import com.intellij.execution.configurations.GeneralCommandLine
4
3
import java.io.File
5
4
import java.io.IOException
6
5
import java.util.concurrent.TimeUnit
@@ -40,10 +39,12 @@ class SystemEnvironment {
40
39
*/
41
40
fun runCommand (vararg commands : String , workingDirectory : File ? = null): String? {
42
41
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()
47
48
48
49
if (proc.waitFor(3 , TimeUnit .SECONDS )) {
49
50
proc.inputStream.bufferedReader().readText().trim() + proc.errorStream.bufferedReader().readText().trim()
You can’t perform that action at this time.
0 commit comments