Skip to content

Commit 3a0d1aa

Browse files
committed
Do not copy source code to the output #13
1 parent 034d519 commit 3a0d1aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scala-console/src/main/scala/ij_plugins/scala/console/ScalaConsolePaneModel.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ import scalafx.beans.property.{ReadOnlyBooleanProperty, ReadOnlyBooleanWrapper,
3838
*/
3939
class ScalaConsolePaneModel extends ModelFX {
4040

41-
val statusText = new StringProperty("Welcome to Scala Console")
42-
val editor = new Editor()
43-
val outputArea = new OutputArea()
41+
private val listCodeOnRun: Boolean = false
42+
private val _isReady = new ReadOnlyBooleanWrapper(this, "isReady", true)
43+
private val scalaInterpreter = new ScalaInterpreter()
4444

45-
private val _isReady = new ReadOnlyBooleanWrapper(this, "isReady", true)
45+
val statusText = new StringProperty("Welcome to Scala Console")
46+
val editor = new Editor()
47+
val outputArea = new OutputArea()
4648
val isReady: ReadOnlyBooleanProperty = _isReady.readOnlyProperty
4749

48-
private val scalaInterpreter = new ScalaInterpreter()
49-
5050
private val interpreterReactions =
5151
new Subscriber[InterpreterEvent, Publisher[InterpreterEvent]] {
5252
override def notify(pub: Publisher[InterpreterEvent], event: InterpreterEvent): Unit = {
@@ -89,7 +89,7 @@ class ScalaConsolePaneModel extends ModelFX {
8989
val code = if (selection != null && selection.nonEmpty) selection else editor.text
9090

9191
// Show which code will be run
92-
outputArea.model.list(code)
92+
if (listCodeOnRun) outputArea.model.list(code)
9393

9494
// Run the code
9595
scalaInterpreter.run(code)

0 commit comments

Comments
 (0)