Skip to content

Commit

Permalink
[ #152 ] Fixes #152
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Apr 4, 2018
1 parent fdb7020 commit 6f51947
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/org/ice1000/julia/lang/action/julia-edit-actions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ exit()
}

private fun write(stderr: List<String>, project: Project, file: VirtualFile, stdout: List<String>) {
if (stderr.isNotEmpty()) Messages.showDialog(
project,
stderr.joinToString("\n"),
JuliaBundle.message("julia.messages.doc-format.error"),
arrayOf(JuliaBundle.message("julia.yes")),
0, JuliaIcons.JOJO_ICON)
else file.getOutputStream(this).bufferedWriter().use {
if (stderr.isNotEmpty()) ApplicationManager.getApplication().invokeLater {
Messages.showDialog(
project,
stderr.joinToString("\n"),
JuliaBundle.message("julia.messages.doc-format.error"),
arrayOf(JuliaBundle.message("julia.yes")),
0, JuliaIcons.JOJO_ICON)
} else file.getOutputStream(this).bufferedWriter().use {
it.append(stdout.joinToString("\n"))
it.flush()
}
Expand Down

0 comments on commit 6f51947

Please sign in to comment.