File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/kotlin/org/scijava/scripting/fx Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 8686 <!-- NB: Work around duplicate classes issue in Kotlin dependencies-->
8787 <allowedDuplicateClasses >org/jetbrains/kotlin/daemon/common/*,kotlinx/coroutines/**</allowedDuplicateClasses >
8888
89+ <kotlinx-coroutines-core .version>1.3.1</kotlinx-coroutines-core .version>
8990 <scripting-kotlin .version>0.1.1</scripting-kotlin .version>
9091 </properties >
9192
101102 <groupId >org.jetbrains.kotlin</groupId >
102103 <artifactId >kotlin-stdlib-jdk8</artifactId >
103104 </dependency >
105+ <dependency >
106+ <groupId >org.jetbrains.kotlinx</groupId >
107+ <artifactId >kotlinx-coroutines-core</artifactId >
108+ <version >${kotlinx-coroutines-core.version} </version >
109+ </dependency >
104110
105111 <!-- Test dependencies -->
106112 <dependency >
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import javafx.scene.input.KeyCode
88import javafx.scene.input.KeyCodeCombination
99import javafx.scene.input.KeyCombination
1010import javafx.scene.input.KeyEvent
11+ import kotlinx.coroutines.GlobalScope
12+ import kotlinx.coroutines.launch
1113import org.scijava.Context
1214
1315class ScijavaReplFXTabs (
@@ -59,8 +61,7 @@ class ScijavaReplFXTabs(
5961 when {
6062 evalKeys.any { c -> c.match(it) } -> {
6163 it.consume()
62- // TODO use coroutines instead of thread
63- Thread { repl.evalCurrentPrompt() }.start()
64+ GlobalScope .launch { repl.evalCurrentPrompt() }
6465 }
6566 cycleTabsForwardKombination.any { c -> c.match(it) } -> {
6667 it.consume()
You can’t perform that action at this time.
0 commit comments