From 31acbf1c66bd900af08c7ec0f0b34eecf5b6e548 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Fri, 22 Oct 2021 18:29:10 +0200 Subject: [PATCH] Fix async demo syntax highlighting after file load (#1045) --- .../java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java b/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java index 062ab8e37..0cd867acb 100644 --- a/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java +++ b/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsAsyncDemo.java @@ -93,6 +93,7 @@ public void start(Stage primaryStage) { codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea)); Subscription cleanupWhenDone = codeArea.multiPlainChanges() .successionEnds(Duration.ofMillis(500)) + .retainLatestUntilLater(executor) .supplyTask(this::computeHighlightingAsync) .awaitLatest(codeArea.multiPlainChanges()) .filterMap(t -> {